{"action":"created","comment":{"url":"https://api.github.com/repos/immuta/bakula/pulls/comments/39744169","id":39744169,"diff_hunk":"@@ -0,0 +1,84 @@\n+#!/usr/bin/python\n+\n+import os\n+\n+# class Inboxer provides basic capabilities to put a file in the master inbox,\n+# create a hardlink to that file in the correct container inboxes path and then\n+# delete the original file in the master inbox.\n+class Inboxer:\n+    # Initialize class with default paths to the master inbox and container inboxes\n+    def __init__(self, masterInboxPath=\"master_inbox\", containerInboxesPath=\"container_inboxes\"):\n+        self.masterInboxPath = masterInboxPath\n+        self.containerInboxesPath = containerInboxesPath\n+\n+        if not os.path.exists(self.masterInboxPath):\n+            os.makedirs(self.masterInboxPath)\n+\n+        if not os.path.exists(self.containerInboxesPath):\n+            os.makedirs(self.containerInboxesPath)\n+\n+    # Private, static method to check if a string contains just a number or not\n+    @staticmethod\n+    def __isNumber(str):\n+        try:\n+            int(str)\n+            return True\n+        except ValueError:\n+            return False\n+\n+    # Static method that uses filenames to find the next number regardless\n+    # of modified or created times\n+    @staticmethod\n+    def currentUpperBound(dir):","path":"bakula/server/inboxer.py","position":32,"original_position":32,"commit_id":"c91656f60d11630df62c8b46b342a00f651d4388","original_commit_id":"c91656f60d11630df62c8b46b342a00f651d4388","user":{"login":"ericjperry","id":5107961,"avatar_url":"https://avatars.githubusercontent.com/u/5107961?v=3","gravatar_id":"","url":"https://api.github.com/users/ericjperry","html_url":"https://github.com/ericjperry","followers_url":"https://api.github.com/users/ericjperry/followers","following_url":"https://api.github.com/users/ericjperry/following{/other_user}","gists_url":"https://api.github.com/users/ericjperry/gists{/gist_id}","starred_url":"https://api.github.com/users/ericjperry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericjperry/subscriptions","organizations_url":"https://api.github.com/users/ericjperry/orgs","repos_url":"https://api.github.com/users/ericjperry/repos","events_url":"https://api.github.com/users/ericjperry/events{/privacy}","received_events_url":"https://api.github.com/users/ericjperry/received_events","type":"User","site_admin":false},"body":":+1:  to using peewee, should be fairly simple: https://peewee.readthedocs.org/en/latest/peewee/querying.html#atomic-updates.\r\n\r\nI assume we're just going to use the sqlite/file approach for now with peewee?","created_at":"2015-09-17T13:26:01Z","updated_at":"2015-09-17T13:26:01Z","html_url":"https://github.com/immuta/bakula/pull/23#discussion_r39744169","pull_request_url":"https://api.github.com/repos/immuta/bakula/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/immuta/bakula/pulls/comments/39744169"},"html":{"href":"https://github.com/immuta/bakula/pull/23#discussion_r39744169"},"pull_request":{"href":"https://api.github.com/repos/immuta/bakula/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/immuta/bakula/pulls/23","id":45259028,"html_url":"https://github.com/immuta/bakula/pull/23","diff_url":"https://github.com/immuta/bakula/pull/23.diff","patch_url":"https://github.com/immuta/bakula/pull/23.patch","issue_url":"https://api.github.com/repos/immuta/bakula/issues/23","number":23,"state":"open","locked":false,"title":"Created initial implementation of Inboxer","user":{"login":"KrisSiegel","id":1885826,"avatar_url":"https://avatars.githubusercontent.com/u/1885826?v=3","gravatar_id":"","url":"https://api.github.com/users/KrisSiegel","html_url":"https://github.com/KrisSiegel","followers_url":"https://api.github.com/users/KrisSiegel/followers","following_url":"https://api.github.com/users/KrisSiegel/following{/other_user}","gists_url":"https://api.github.com/users/KrisSiegel/gists{/gist_id}","starred_url":"https://api.github.com/users/KrisSiegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrisSiegel/subscriptions","organizations_url":"https://api.github.com/users/KrisSiegel/orgs","repos_url":"https://api.github.com/users/KrisSiegel/repos","events_url":"https://api.github.com/users/KrisSiegel/events{/privacy}","received_events_url":"https://api.github.com/users/KrisSiegel/received_events","type":"User","site_admin":false},"body":"This PR covers the creation of the Inboxer class designed to facilitate the following as part of #4:\r\n\r\n- Putting stuff into the master inbox\r\n- Promoting stuff from a master inbox into a container inbox\r\n- Setup hard links between the container inbox and the master inbox\r\n- After a hard link is verified to have been created the original file in the inbox is deleted\r\n\r\nThis is a rough first cut and currently only supports putting stuff into the master inbox via a file path (need to add a method to take in bytes for our rest service). I'm not expecting its current representation to be indicative of what the final version will be.\r\n\r\nPlease take a look @sapanshah @ericjperry ","created_at":"2015-09-17T07:21:54Z","updated_at":"2015-09-17T13:26:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9268db8658a89250743534d25478c85f7c73315f","assignee":{"login":"KrisSiegel","id":1885826,"avatar_url":"https://avatars.githubusercontent.com/u/1885826?v=3","gravatar_id":"","url":"https://api.github.com/users/KrisSiegel","html_url":"https://github.com/KrisSiegel","followers_url":"https://api.github.com/users/KrisSiegel/followers","following_url":"https://api.github.com/users/KrisSiegel/following{/other_user}","gists_url":"https://api.github.com/users/KrisSiegel/gists{/gist_id}","starred_url":"https://api.github.com/users/KrisSiegel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrisSiegel/subscriptions","organizations_url":"https://api.github.com/users/KrisSiegel/orgs","repos_url":"https://api.github.com/users/KrisSiegel/repos","events_url":"https://api.github.com/users/KrisSiegel/events{/privacy}","received_events_url":"https://api.github.com/users/KrisSiegel/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/immuta/bakula/pulls/23/commits","review_comments_url":"https://api.github.com/repos/immuta/bakula/pulls/23/comments","review_comment_url":"https://api.github.com/repos/immuta/bakula/pulls/comments{/number}","comments_url":"https://api.github.com/repos/immuta/bakula/issues/23/comments","statuses_url":"https://api.github.com/repos/immuta/bakula/statuses/c91656f60d11630df62c8b46b342a00f651d4388","head":{"label":"immuta:inboxer","ref":"inboxer","sha":"c91656f60d11630df62c8b46b342a00f651d4388","user":{"login":"immuta","id":7513613,"avatar_url":"https://avatars.githubusercontent.com/u/7513613?v=3","gravatar_id":"","url":"https://api.github.com/users/immuta","html_url":"https://github.com/immuta","followers_url":"https://api.github.com/users/immuta/followers","following_url":"https://api.github.com/users/immuta/following{/other_user}","gists_url":"https://api.github.com/users/immuta/gists{/gist_id}","starred_url":"https://api.github.com/users/immuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immuta/subscriptions","organizations_url":"https://api.github.com/users/immuta/orgs","repos_url":"https://api.github.com/users/immuta/repos","events_url":"https://api.github.com/users/immuta/events{/privacy}","received_events_url":"https://api.github.com/users/immuta/received_events","type":"Organization","site_admin":false},"repo":{"id":34423808,"name":"bakula","full_name":"immuta/bakula","owner":{"login":"immuta","id":7513613,"avatar_url":"https://avatars.githubusercontent.com/u/7513613?v=3","gravatar_id":"","url":"https://api.github.com/users/immuta","html_url":"https://github.com/immuta","followers_url":"https://api.github.com/users/immuta/followers","following_url":"https://api.github.com/users/immuta/following{/other_user}","gists_url":"https://api.github.com/users/immuta/gists{/gist_id}","starred_url":"https://api.github.com/users/immuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immuta/subscriptions","organizations_url":"https://api.github.com/users/immuta/orgs","repos_url":"https://api.github.com/users/immuta/repos","events_url":"https://api.github.com/users/immuta/events{/privacy}","received_events_url":"https://api.github.com/users/immuta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/immuta/bakula","description":"","fork":false,"url":"https://api.github.com/repos/immuta/bakula","forks_url":"https://api.github.com/repos/immuta/bakula/forks","keys_url":"https://api.github.com/repos/immuta/bakula/keys{/key_id}","collaborators_url":"https://api.github.com/repos/immuta/bakula/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/immuta/bakula/teams","hooks_url":"https://api.github.com/repos/immuta/bakula/hooks","issue_events_url":"https://api.github.com/repos/immuta/bakula/issues/events{/number}","events_url":"https://api.github.com/repos/immuta/bakula/events","assignees_url":"https://api.github.com/repos/immuta/bakula/assignees{/user}","branches_url":"https://api.github.com/repos/immuta/bakula/branches{/branch}","tags_url":"https://api.github.com/repos/immuta/bakula/tags","blobs_url":"https://api.github.com/repos/immuta/bakula/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/immuta/bakula/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/immuta/bakula/git/refs{/sha}","trees_url":"https://api.github.com/repos/immuta/bakula/git/trees{/sha}","statuses_url":"https://api.github.com/repos/immuta/bakula/statuses/{sha}","languages_url":"https://api.github.com/repos/immuta/bakula/languages","stargazers_url":"https://api.github.com/repos/immuta/bakula/stargazers","contributors_url":"https://api.github.com/repos/immuta/bakula/contributors","subscribers_url":"https://api.github.com/repos/immuta/bakula/subscribers","subscription_url":"https://api.github.com/repos/immuta/bakula/subscription","commits_url":"https://api.github.com/repos/immuta/bakula/commits{/sha}","git_commits_url":"https://api.github.com/repos/immuta/bakula/git/commits{/sha}","comments_url":"https://api.github.com/repos/immuta/bakula/comments{/number}","issue_comment_url":"https://api.github.com/repos/immuta/bakula/issues/comments{/number}","contents_url":"https://api.github.com/repos/immuta/bakula/contents/{+path}","compare_url":"https://api.github.com/repos/immuta/bakula/compare/{base}...{head}","merges_url":"https://api.github.com/repos/immuta/bakula/merges","archive_url":"https://api.github.com/repos/immuta/bakula/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/immuta/bakula/downloads","issues_url":"https://api.github.com/repos/immuta/bakula/issues{/number}","pulls_url":"https://api.github.com/repos/immuta/bakula/pulls{/number}","milestones_url":"https://api.github.com/repos/immuta/bakula/milestones{/number}","notifications_url":"https://api.github.com/repos/immuta/bakula/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/immuta/bakula/labels{/name}","releases_url":"https://api.github.com/repos/immuta/bakula/releases{/id}","created_at":"2015-04-23T00:25:47Z","updated_at":"2015-09-16T20:51:34Z","pushed_at":"2015-09-17T12:01:26Z","git_url":"git://github.com/immuta/bakula.git","ssh_url":"git@github.com:immuta/bakula.git","clone_url":"https://github.com/immuta/bakula.git","svn_url":"https://github.com/immuta/bakula","homepage":null,"size":211,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":3,"default_branch":"master"}},"base":{"label":"immuta:master","ref":"master","sha":"543f0d77013d33699cc678c8818b1e7645fd646a","user":{"login":"immuta","id":7513613,"avatar_url":"https://avatars.githubusercontent.com/u/7513613?v=3","gravatar_id":"","url":"https://api.github.com/users/immuta","html_url":"https://github.com/immuta","followers_url":"https://api.github.com/users/immuta/followers","following_url":"https://api.github.com/users/immuta/following{/other_user}","gists_url":"https://api.github.com/users/immuta/gists{/gist_id}","starred_url":"https://api.github.com/users/immuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immuta/subscriptions","organizations_url":"https://api.github.com/users/immuta/orgs","repos_url":"https://api.github.com/users/immuta/repos","events_url":"https://api.github.com/users/immuta/events{/privacy}","received_events_url":"https://api.github.com/users/immuta/received_events","type":"Organization","site_admin":false},"repo":{"id":34423808,"name":"bakula","full_name":"immuta/bakula","owner":{"login":"immuta","id":7513613,"avatar_url":"https://avatars.githubusercontent.com/u/7513613?v=3","gravatar_id":"","url":"https://api.github.com/users/immuta","html_url":"https://github.com/immuta","followers_url":"https://api.github.com/users/immuta/followers","following_url":"https://api.github.com/users/immuta/following{/other_user}","gists_url":"https://api.github.com/users/immuta/gists{/gist_id}","starred_url":"https://api.github.com/users/immuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/immuta/subscriptions","organizations_url":"https://api.github.com/users/immuta/orgs","repos_url":"https://api.github.com/users/immuta/repos","events_url":"https://api.github.com/users/immuta/events{/privacy}","received_events_url":"https://api.github.com/users/immuta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/immuta/bakula","description":"","fork":false,"url":"https://api.github.com/repos/immuta/bakula","forks_url":"https://api.github.com/repos/immuta/bakula/forks","keys_url":"https://api.github.com/repos/immuta/bakula/keys{/key_id}","collaborators_url":"https://api.github.com/repos/immuta/bakula/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/immuta/bakula/teams","hooks_url":"https://api.github.com/repos/immuta/bakula/hooks","issue_events_url":"https://api.github.com/repos/immuta/bakula/issues/events{/number}","events_url":"https://api.github.com/repos/immuta/bakula/events","assignees_url":"https://api.github.com/repos/immuta/bakula/assignees{/user}","branches_url":"https://api.github.com/repos/immuta/bakula/branches{/branch}","tags_url":"https://api.github.com/repos/immuta/bakula/tags","blobs_url":"https://api.github.com/repos/immuta/bakula/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/immuta/bakula/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/immuta/bakula/git/refs{/sha}","trees_url":"https://api.github.com/repos/immuta/bakula/git/trees{/sha}","statuses_url":"https://api.github.com/repos/immuta/bakula/statuses/{sha}","languages_url":"https://api.github.com/repos/immuta/bakula/languages","stargazers_url":"https://api.github.com/repos/immuta/bakula/stargazers","contributors_url":"https://api.github.com/repos/immuta/bakula/contributors","subscribers_url":"https://api.github.com/repos/immuta/bakula/subscribers","subscription_url":"https://api.github.com/repos/immuta/bakula/subscription","commits_url":"https://api.github.com/repos/immuta/bakula/commits{/sha}","git_commits_url":"https://api.github.com/repos/immuta/bakula/git/commits{/sha}","comments_url":"https://api.github.com/repos/immuta/bakula/comments{/number}","issue_comment_url":"https://api.github.com/repos/immuta/bakula/issues/comments{/number}","contents_url":"https://api.github.com/repos/immuta/bakula/contents/{+path}","compare_url":"https://api.github.com/repos/immuta/bakula/compare/{base}...{head}","merges_url":"https://api.github.com/repos/immuta/bakula/merges","archive_url":"https://api.github.com/repos/immuta/bakula/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/immuta/bakula/downloads","issues_url":"https://api.github.com/repos/immuta/bakula/issues{/number}","pulls_url":"https://api.github.com/repos/immuta/bakula/pulls{/number}","milestones_url":"https://api.github.com/repos/immuta/bakula/milestones{/number}","notifications_url":"https://api.github.com/repos/immuta/bakula/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/immuta/bakula/labels{/name}","releases_url":"https://api.github.com/repos/immuta/bakula/releases{/id}","created_at":"2015-04-23T00:25:47Z","updated_at":"2015-09-16T20:51:34Z","pushed_at":"2015-09-17T12:01:26Z","git_url":"git://github.com/immuta/bakula.git","ssh_url":"git@github.com:immuta/bakula.git","clone_url":"https://github.com/immuta/bakula.git","svn_url":"https://github.com/immuta/bakula","homepage":null,"size":211,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/immuta/bakula/pulls/23"},"html":{"href":"https://github.com/immuta/bakula/pull/23"},"issue":{"href":"https://api.github.com/repos/immuta/bakula/issues/23"},"comments":{"href":"https://api.github.com/repos/immuta/bakula/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/immuta/bakula/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/immuta/bakula/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/immuta/bakula/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/immuta/bakula/statuses/c91656f60d11630df62c8b46b342a00f651d4388"}}}}