{"action":"created","comment":{"url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/comments/122546579","pull_request_review_id":44678007,"id":122546579,"diff_hunk":"@@ -0,0 +1,52 @@\n+class Ingredient(object):\n+    def __init__(self, ingredient_data):\n+        # Let's assert that, if the first character is a number, then the first two words represent a quantity,\n+        # i.e. 1 cup flour, 2 tablespoons sugar (for measurable quantities)\n+        # If the first charcter isn't a number, then we assume it's an indivisble quantity \"Pinch of Salt\"\n+        if ingredient_data == '':\n+            self.quantity = 'None'\n+            self.food = 'None'\n+            return\n+\n+        if ord(ingredient_data[0]) >= 48 and ord(ingredient_data[0]) <= 57:\n+            i = 0\n+            count = 0\n+            for i in range(len(ingredient_data)):\n+                character = ingredient_data[i]\n+                if ord(character) == 32:\n+                    count += 1\n+                    if count == 2:\n+                        break\n+            self.quantity = ingredient_data[0:i:1].strip()\n+            self.food = ingredient_data[i:len(ingredient_data):1].strip()\n+        else:\n+            self.quantity = ''\n+            self.food = ingredient_data.strip()\n+\n+    def __str__(self):\n+        return \"Ingredient(quantity=\\\"{}\\\", type=\\\"{}\\\")\".format(self.quantity, self.food)\n+","path":"recipebook/ingredients.py","position":28,"original_position":28,"commit_id":"3d3b54e4c9899f22b94621354ce850e061100cc3","original_commit_id":"3d3b54e4c9899f22b94621354ce850e061100cc3","user":{"login":"brextonpham","id":8564752,"avatar_url":"https://avatars0.githubusercontent.com/u/8564752?v=3","gravatar_id":"","url":"https://api.github.com/users/brextonpham","html_url":"https://github.com/brextonpham","followers_url":"https://api.github.com/users/brextonpham/followers","following_url":"https://api.github.com/users/brextonpham/following{/other_user}","gists_url":"https://api.github.com/users/brextonpham/gists{/gist_id}","starred_url":"https://api.github.com/users/brextonpham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brextonpham/subscriptions","organizations_url":"https://api.github.com/users/brextonpham/orgs","repos_url":"https://api.github.com/users/brextonpham/repos","events_url":"https://api.github.com/users/brextonpham/events{/privacy}","received_events_url":"https://api.github.com/users/brextonpham/received_events","type":"User","site_admin":false},"body":"IngredientList doesn't need to be a class, it can just be a list of Ingredients\r\nif they didn't make it into a plain old list, then they should have changed things like size and get_ingredient to __len__ and __getattr__ magic methods","created_at":"2017-06-16T22:40:41Z","updated_at":"2017-06-16T22:40:41Z","html_url":"https://github.com/stanfordpython/assign3-submissions-spr1617/pull/14#discussion_r122546579","pull_request_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/comments/122546579"},"html":{"href":"https://github.com/stanfordpython/assign3-submissions-spr1617/pull/14#discussion_r122546579"},"pull_request":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14","id":126105027,"html_url":"https://github.com/stanfordpython/assign3-submissions-spr1617/pull/14","diff_url":"https://github.com/stanfordpython/assign3-submissions-spr1617/pull/14.diff","patch_url":"https://github.com/stanfordpython/assign3-submissions-spr1617/pull/14.patch","issue_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/14","number":14,"state":"open","locked":false,"title":"Assignment 2 submission for jgeary-2","user":{"login":"brextonpham","id":8564752,"avatar_url":"https://avatars0.githubusercontent.com/u/8564752?v=3","gravatar_id":"","url":"https://api.github.com/users/brextonpham","html_url":"https://github.com/brextonpham","followers_url":"https://api.github.com/users/brextonpham/followers","following_url":"https://api.github.com/users/brextonpham/following{/other_user}","gists_url":"https://api.github.com/users/brextonpham/gists{/gist_id}","starred_url":"https://api.github.com/users/brextonpham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brextonpham/subscriptions","organizations_url":"https://api.github.com/users/brextonpham/orgs","repos_url":"https://api.github.com/users/brextonpham/repos","events_url":"https://api.github.com/users/brextonpham/events{/privacy}","received_events_url":"https://api.github.com/users/brextonpham/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-16T20:02:31Z","updated_at":"2017-06-16T22:40:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8414c18e0a3fc5788cd72954ea2d8eb35d9f757","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14/commits","review_comments_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14/comments","review_comment_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/14/comments","statuses_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/statuses/3d3b54e4c9899f22b94621354ce850e061100cc3","head":{"label":"stanfordpython:jgeary-2","ref":"jgeary-2","sha":"3d3b54e4c9899f22b94621354ce850e061100cc3","user":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"repo":{"id":92363981,"name":"assign3-submissions-spr1617","full_name":"stanfordpython/assign3-submissions-spr1617","owner":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stanfordpython/assign3-submissions-spr1617","description":"Submissions for Assignment 3 for CS41 – Spring 2017","fork":false,"url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617","forks_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/forks","keys_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/teams","hooks_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/hooks","issue_events_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/events{/number}","events_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/events","assignees_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/assignees{/user}","branches_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/branches{/branch}","tags_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/tags","blobs_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/refs{/sha}","trees_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/statuses/{sha}","languages_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/languages","stargazers_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/stargazers","contributors_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/contributors","subscribers_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/subscribers","subscription_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/subscription","commits_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/commits{/sha}","git_commits_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/commits{/sha}","comments_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/comments{/number}","issue_comment_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/comments{/number}","contents_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/contents/{+path}","compare_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/merges","archive_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/downloads","issues_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues{/number}","pulls_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls{/number}","milestones_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/milestones{/number}","notifications_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/labels{/name}","releases_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/releases{/id}","deployments_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/deployments","created_at":"2017-05-25T04:15:18Z","updated_at":"2017-05-25T04:15:18Z","pushed_at":"2017-06-16T20:02:31Z","git_url":"git://github.com/stanfordpython/assign3-submissions-spr1617.git","ssh_url":"git@github.com:stanfordpython/assign3-submissions-spr1617.git","clone_url":"https://github.com/stanfordpython/assign3-submissions-spr1617.git","svn_url":"https://github.com/stanfordpython/assign3-submissions-spr1617","homepage":null,"size":85,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"stanfordpython:master","ref":"master","sha":"faa357a2fcfb99512a217a1fb092bb2cd804df14","user":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"repo":{"id":92363981,"name":"assign3-submissions-spr1617","full_name":"stanfordpython/assign3-submissions-spr1617","owner":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stanfordpython/assign3-submissions-spr1617","description":"Submissions for Assignment 3 for CS41 – Spring 2017","fork":false,"url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617","forks_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/forks","keys_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/teams","hooks_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/hooks","issue_events_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/events{/number}","events_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/events","assignees_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/assignees{/user}","branches_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/branches{/branch}","tags_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/tags","blobs_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/refs{/sha}","trees_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/statuses/{sha}","languages_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/languages","stargazers_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/stargazers","contributors_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/contributors","subscribers_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/subscribers","subscription_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/subscription","commits_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/commits{/sha}","git_commits_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/git/commits{/sha}","comments_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/comments{/number}","issue_comment_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/comments{/number}","contents_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/contents/{+path}","compare_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/merges","archive_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/downloads","issues_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues{/number}","pulls_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls{/number}","milestones_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/milestones{/number}","notifications_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/labels{/name}","releases_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/releases{/id}","deployments_url":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/deployments","created_at":"2017-05-25T04:15:18Z","updated_at":"2017-05-25T04:15:18Z","pushed_at":"2017-06-16T20:02:31Z","git_url":"git://github.com/stanfordpython/assign3-submissions-spr1617.git","ssh_url":"git@github.com:stanfordpython/assign3-submissions-spr1617.git","clone_url":"https://github.com/stanfordpython/assign3-submissions-spr1617.git","svn_url":"https://github.com/stanfordpython/assign3-submissions-spr1617","homepage":null,"size":85,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14"},"html":{"href":"https://github.com/stanfordpython/assign3-submissions-spr1617/pull/14"},"issue":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/14"},"comments":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/stanfordpython/assign3-submissions-spr1617/statuses/3d3b54e4c9899f22b94621354ce850e061100cc3"}}}}
{"actor":{"display_login":"brextonpham"}}