{"action":"created","comment":{"url":"https://api.github.com/repos/FNNDSC/pfioh/pulls/comments/132539847","pull_request_review_id":55632765,"id":132539847,"diff_hunk":"@@ -818,63 +804,56 @@ def do_POST_withCompression(self, **kwargs):\n             str_fileSuffix = \".zip\"\n \n         str_localFile   = \"%s%s%s\" % (str_unpackBase, str_fileOnly, str_fileSuffix)\n-\n+    \n+        #Decoding \n         if str_encoding == \"base64\":\n             d_ret['decode'] = {}\n-            data            = base64.b64decode(fileContent)\n+            d_ret['write']  = {}\n             try:\n-                with open(str_localFile, 'wb') as fh:\n-                    fh.write(data)\n+                data                        = base64.b64decode(fileContent)\n                 d_ret['decode']['status']   = True\n                 d_ret['decode']['msg']      = 'base64 decode successful!'\n-            except:\n+            except Exception as err:\n                 d_ret['decode']['status']   = False\n                 d_ret['decode']['msg']      = 'base64 decode unsuccessful!'\n                 self.ret_client(d_ret)\n                 self.qprint(d_ret, comms = 'tx')\n+                self.qprint(err)\n                 return d_ret\n-            d_ret['decode']['timestamp']  = '%s' % datetime.datetime.now()\n+\n         else:\n             d_ret['write']   = {}\n-            with open(str_localFile, 'wb') as fh:\n-                try:\n-                    fh.write(fileContent.decode())\n-                    d_ret['write']['decode'] = True\n-                except:\n-                    fh.write(fileContent)\n-                    d_ret['write']['decode'] = False\n-            d_ret['write']['file']      = str_localFile\n-            d_ret['write']['status']    = True\n-            d_ret['write']['msg']       = 'File written successfully!'\n-            d_ret['write']['filesize']  = \"{:,}\".format(os.stat(str_localFile).st_size)\n-            d_ret['write']['timestamp'] = '%s' % datetime.datetime.now()\n-            d_ret['status']             = True\n-            d_ret['msg']                = d_ret['write']['msg']\n-        fh.close()\n-        if b_unpack and d_compress['archive'] == 'zip':\n-            d_fio   =   zip_process(action          = 'unzip',\n-                                    path            = str_unpackPath,\n-                                    payloadFile     = str_localFile)\n-            d_ret['unzip']  = d_fio\n-            d_ret['status'] = d_fio['status']\n-            d_ret['msg']    = d_fio['msg']\n-            os.remove(str_localFile)\n-\n+            try:\n+                data = fileContent.decode()\n+                d_ret['write']['decode'] = True\n+            except Exception as err:\n+                d_ret['write']['decode'] = False\n+                data = fileContent\n+                self.qprint(err)\n+\n+        b_zip= b_unpack and (d_compress['archive'] == 'zip')\n+\n+        d_ret= self.storeData(file_name= str_localFile, \n+                              file_content= data, Path= str_unpackPath, is_zip=b_zip,d_ret=d_ret)\n+        \n         # pudb.set_trace()\n         d_ret['postop'] = self.postop_process(meta          = d_meta,\n                                               path          = str_unpackPath,\n                                               payloadFile   = str_localFile)\n \n+\n         self.send_response(200)\n         self.end_headers()\n \n         d_ret['User-agent'] = self.headers['user-agent']\n \n         # self.ret_client(d_ret)\n         self.qprint(d_ret, comms = 'tx')\n-\n         return d_ret\n \n+    def storeData(self, **kwargs):","path":"pfioh/pfioh.py","position":377,"original_position":377,"commit_id":"cd1ff6e95977db253ff1de59a9458a80dba7a8ab","original_commit_id":"2b47881ceeb3d77221606fa21b1ab6cd823f9ad5","user":{"login":"awalkaradi95moc","id":28954227,"avatar_url":"https://avatars3.githubusercontent.com/u/28954227?v=4","gravatar_id":"","url":"https://api.github.com/users/awalkaradi95moc","html_url":"https://github.com/awalkaradi95moc","followers_url":"https://api.github.com/users/awalkaradi95moc/followers","following_url":"https://api.github.com/users/awalkaradi95moc/following{/other_user}","gists_url":"https://api.github.com/users/awalkaradi95moc/gists{/gist_id}","starred_url":"https://api.github.com/users/awalkaradi95moc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awalkaradi95moc/subscriptions","organizations_url":"https://api.github.com/users/awalkaradi95moc/orgs","repos_url":"https://api.github.com/users/awalkaradi95moc/repos","events_url":"https://api.github.com/users/awalkaradi95moc/events{/privacy}","received_events_url":"https://api.github.com/users/awalkaradi95moc/received_events","type":"User","site_admin":false},"body":"I am basically declaring that function as abstract. The function is overridden in both MountDir and SwiftStore. \r\nI referred this : https://stackoverflow.com/a/4383103/5871403","created_at":"2017-08-10T18:59:59Z","updated_at":"2017-08-10T19:00:00Z","html_url":"https://github.com/FNNDSC/pfioh/pull/6#discussion_r132539847","pull_request_url":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/FNNDSC/pfioh/pulls/comments/132539847"},"html":{"href":"https://github.com/FNNDSC/pfioh/pull/6#discussion_r132539847"},"pull_request":{"href":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6","id":132518908,"html_url":"https://github.com/FNNDSC/pfioh/pull/6","diff_url":"https://github.com/FNNDSC/pfioh/pull/6.diff","patch_url":"https://github.com/FNNDSC/pfioh/pull/6.patch","issue_url":"https://api.github.com/repos/FNNDSC/pfioh/issues/6","number":6,"state":"open","locked":false,"title":"Swift option added for pfioh","user":{"login":"awalkaradi95moc","id":28954227,"avatar_url":"https://avatars3.githubusercontent.com/u/28954227?v=4","gravatar_id":"","url":"https://api.github.com/users/awalkaradi95moc","html_url":"https://github.com/awalkaradi95moc","followers_url":"https://api.github.com/users/awalkaradi95moc/followers","following_url":"https://api.github.com/users/awalkaradi95moc/following{/other_user}","gists_url":"https://api.github.com/users/awalkaradi95moc/gists{/gist_id}","starred_url":"https://api.github.com/users/awalkaradi95moc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awalkaradi95moc/subscriptions","organizations_url":"https://api.github.com/users/awalkaradi95moc/orgs","repos_url":"https://api.github.com/users/awalkaradi95moc/repos","events_url":"https://api.github.com/users/awalkaradi95moc/events{/privacy}","received_events_url":"https://api.github.com/users/awalkaradi95moc/received_events","type":"User","site_admin":false},"body":"@danmcp ","created_at":"2017-07-26T13:44:23Z","updated_at":"2017-08-10T19:00:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"302498ab0351046ca1b504bd256f168d1d906739","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6/commits","review_comments_url":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6/comments","review_comment_url":"https://api.github.com/repos/FNNDSC/pfioh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FNNDSC/pfioh/issues/6/comments","statuses_url":"https://api.github.com/repos/FNNDSC/pfioh/statuses/cd1ff6e95977db253ff1de59a9458a80dba7a8ab","head":{"label":"awalkaradi95moc:master","ref":"master","sha":"cd1ff6e95977db253ff1de59a9458a80dba7a8ab","user":{"login":"awalkaradi95moc","id":28954227,"avatar_url":"https://avatars3.githubusercontent.com/u/28954227?v=4","gravatar_id":"","url":"https://api.github.com/users/awalkaradi95moc","html_url":"https://github.com/awalkaradi95moc","followers_url":"https://api.github.com/users/awalkaradi95moc/followers","following_url":"https://api.github.com/users/awalkaradi95moc/following{/other_user}","gists_url":"https://api.github.com/users/awalkaradi95moc/gists{/gist_id}","starred_url":"https://api.github.com/users/awalkaradi95moc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awalkaradi95moc/subscriptions","organizations_url":"https://api.github.com/users/awalkaradi95moc/orgs","repos_url":"https://api.github.com/users/awalkaradi95moc/repos","events_url":"https://api.github.com/users/awalkaradi95moc/events{/privacy}","received_events_url":"https://api.github.com/users/awalkaradi95moc/received_events","type":"User","site_admin":false},"repo":{"id":95712671,"name":"pfioh","full_name":"awalkaradi95moc/pfioh","owner":{"login":"awalkaradi95moc","id":28954227,"avatar_url":"https://avatars3.githubusercontent.com/u/28954227?v=4","gravatar_id":"","url":"https://api.github.com/users/awalkaradi95moc","html_url":"https://github.com/awalkaradi95moc","followers_url":"https://api.github.com/users/awalkaradi95moc/followers","following_url":"https://api.github.com/users/awalkaradi95moc/following{/other_user}","gists_url":"https://api.github.com/users/awalkaradi95moc/gists{/gist_id}","starred_url":"https://api.github.com/users/awalkaradi95moc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awalkaradi95moc/subscriptions","organizations_url":"https://api.github.com/users/awalkaradi95moc/orgs","repos_url":"https://api.github.com/users/awalkaradi95moc/repos","events_url":"https://api.github.com/users/awalkaradi95moc/events{/privacy}","received_events_url":"https://api.github.com/users/awalkaradi95moc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/awalkaradi95moc/pfioh","description":"Path File IO Handler","fork":true,"url":"https://api.github.com/repos/awalkaradi95moc/pfioh","forks_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/forks","keys_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/teams","hooks_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/hooks","issue_events_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/issues/events{/number}","events_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/events","assignees_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/assignees{/user}","branches_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/branches{/branch}","tags_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/tags","blobs_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/git/refs{/sha}","trees_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/statuses/{sha}","languages_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/languages","stargazers_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/stargazers","contributors_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/contributors","subscribers_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/subscribers","subscription_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/subscription","commits_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/commits{/sha}","git_commits_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/git/commits{/sha}","comments_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/comments{/number}","issue_comment_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/issues/comments{/number}","contents_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/contents/{+path}","compare_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/merges","archive_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/downloads","issues_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/issues{/number}","pulls_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/pulls{/number}","milestones_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/milestones{/number}","notifications_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/labels{/name}","releases_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/releases{/id}","deployments_url":"https://api.github.com/repos/awalkaradi95moc/pfioh/deployments","created_at":"2017-06-28T21:20:23Z","updated_at":"2017-06-28T21:20:24Z","pushed_at":"2017-08-10T18:28:45Z","git_url":"git://github.com/awalkaradi95moc/pfioh.git","ssh_url":"git@github.com:awalkaradi95moc/pfioh.git","clone_url":"https://github.com/awalkaradi95moc/pfioh.git","svn_url":"https://github.com/awalkaradi95moc/pfioh","homepage":null,"size":208,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FNNDSC:master","ref":"master","sha":"8f9366daf4f05efec4a4b597bc11b921b02ebd6c","user":{"login":"FNNDSC","id":1093496,"avatar_url":"https://avatars0.githubusercontent.com/u/1093496?v=4","gravatar_id":"","url":"https://api.github.com/users/FNNDSC","html_url":"https://github.com/FNNDSC","followers_url":"https://api.github.com/users/FNNDSC/followers","following_url":"https://api.github.com/users/FNNDSC/following{/other_user}","gists_url":"https://api.github.com/users/FNNDSC/gists{/gist_id}","starred_url":"https://api.github.com/users/FNNDSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FNNDSC/subscriptions","organizations_url":"https://api.github.com/users/FNNDSC/orgs","repos_url":"https://api.github.com/users/FNNDSC/repos","events_url":"https://api.github.com/users/FNNDSC/events{/privacy}","received_events_url":"https://api.github.com/users/FNNDSC/received_events","type":"Organization","site_admin":false},"repo":{"id":87348668,"name":"pfioh","full_name":"FNNDSC/pfioh","owner":{"login":"FNNDSC","id":1093496,"avatar_url":"https://avatars0.githubusercontent.com/u/1093496?v=4","gravatar_id":"","url":"https://api.github.com/users/FNNDSC","html_url":"https://github.com/FNNDSC","followers_url":"https://api.github.com/users/FNNDSC/followers","following_url":"https://api.github.com/users/FNNDSC/following{/other_user}","gists_url":"https://api.github.com/users/FNNDSC/gists{/gist_id}","starred_url":"https://api.github.com/users/FNNDSC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FNNDSC/subscriptions","organizations_url":"https://api.github.com/users/FNNDSC/orgs","repos_url":"https://api.github.com/users/FNNDSC/repos","events_url":"https://api.github.com/users/FNNDSC/events{/privacy}","received_events_url":"https://api.github.com/users/FNNDSC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FNNDSC/pfioh","description":"Path File IO Handler","fork":false,"url":"https://api.github.com/repos/FNNDSC/pfioh","forks_url":"https://api.github.com/repos/FNNDSC/pfioh/forks","keys_url":"https://api.github.com/repos/FNNDSC/pfioh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FNNDSC/pfioh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FNNDSC/pfioh/teams","hooks_url":"https://api.github.com/repos/FNNDSC/pfioh/hooks","issue_events_url":"https://api.github.com/repos/FNNDSC/pfioh/issues/events{/number}","events_url":"https://api.github.com/repos/FNNDSC/pfioh/events","assignees_url":"https://api.github.com/repos/FNNDSC/pfioh/assignees{/user}","branches_url":"https://api.github.com/repos/FNNDSC/pfioh/branches{/branch}","tags_url":"https://api.github.com/repos/FNNDSC/pfioh/tags","blobs_url":"https://api.github.com/repos/FNNDSC/pfioh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FNNDSC/pfioh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FNNDSC/pfioh/git/refs{/sha}","trees_url":"https://api.github.com/repos/FNNDSC/pfioh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FNNDSC/pfioh/statuses/{sha}","languages_url":"https://api.github.com/repos/FNNDSC/pfioh/languages","stargazers_url":"https://api.github.com/repos/FNNDSC/pfioh/stargazers","contributors_url":"https://api.github.com/repos/FNNDSC/pfioh/contributors","subscribers_url":"https://api.github.com/repos/FNNDSC/pfioh/subscribers","subscription_url":"https://api.github.com/repos/FNNDSC/pfioh/subscription","commits_url":"https://api.github.com/repos/FNNDSC/pfioh/commits{/sha}","git_commits_url":"https://api.github.com/repos/FNNDSC/pfioh/git/commits{/sha}","comments_url":"https://api.github.com/repos/FNNDSC/pfioh/comments{/number}","issue_comment_url":"https://api.github.com/repos/FNNDSC/pfioh/issues/comments{/number}","contents_url":"https://api.github.com/repos/FNNDSC/pfioh/contents/{+path}","compare_url":"https://api.github.com/repos/FNNDSC/pfioh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FNNDSC/pfioh/merges","archive_url":"https://api.github.com/repos/FNNDSC/pfioh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FNNDSC/pfioh/downloads","issues_url":"https://api.github.com/repos/FNNDSC/pfioh/issues{/number}","pulls_url":"https://api.github.com/repos/FNNDSC/pfioh/pulls{/number}","milestones_url":"https://api.github.com/repos/FNNDSC/pfioh/milestones{/number}","notifications_url":"https://api.github.com/repos/FNNDSC/pfioh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FNNDSC/pfioh/labels{/name}","releases_url":"https://api.github.com/repos/FNNDSC/pfioh/releases{/id}","deployments_url":"https://api.github.com/repos/FNNDSC/pfioh/deployments","created_at":"2017-04-05T19:30:17Z","updated_at":"2017-06-22T13:54:45Z","pushed_at":"2017-08-10T18:28:47Z","git_url":"git://github.com/FNNDSC/pfioh.git","ssh_url":"git@github.com:FNNDSC/pfioh.git","clone_url":"https://github.com/FNNDSC/pfioh.git","svn_url":"https://github.com/FNNDSC/pfioh","homepage":null,"size":198,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6"},"html":{"href":"https://github.com/FNNDSC/pfioh/pull/6"},"issue":{"href":"https://api.github.com/repos/FNNDSC/pfioh/issues/6"},"comments":{"href":"https://api.github.com/repos/FNNDSC/pfioh/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/FNNDSC/pfioh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FNNDSC/pfioh/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/FNNDSC/pfioh/statuses/cd1ff6e95977db253ff1de59a9458a80dba7a8ab"}}}}
{"actor":{"display_login":"awalkaradi95moc"}}