{"action":"created","comment":{"url":"https://api.github.com/repos/osuosl/climesync/pulls/comments/60079313","id":60079313,"diff_hunk":"@@ -284,6 +285,35 @@ def get_times():\n     # Attempt to query the server for times with filtering parameters and return the response\n     return ts.get_times(query_parameters=post_data)\n \n+def sum_times():\n+    \"\"\"Sums all the times associated with a specific project and between optional start and end dates\"\"\"\n+\n+    query = get_fields([(\"!project\", \"Project slugs\"), \\\n+                        (\"*start\", \"Start date (yyyy-mm-dd)\"), \\\n+                        (\"*end\", \"End date (yyyy-mm-dd)\")])\n+\n+    result = ts.get_times(query)\n+\n+    try:\n+        for project in query[\"project\"]:\n+            time_sum = 0\n+\n+            for user_time in result:\n+                if project in user_time[\"project\"]:\n+                    time_sum += user_time[\"duration\"]\n+\n+            print \"\"","path":"climesync.py","position":29,"original_position":29,"commit_id":"321baa7804e2722cce7382127385d7efdf024448","original_commit_id":"321baa7804e2722cce7382127385d7efdf024448","user":{"login":"matthewrsj","id":12090084,"avatar_url":"https://avatars.githubusercontent.com/u/12090084?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewrsj","html_url":"https://github.com/matthewrsj","followers_url":"https://api.github.com/users/matthewrsj/followers","following_url":"https://api.github.com/users/matthewrsj/following{/other_user}","gists_url":"https://api.github.com/users/matthewrsj/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewrsj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewrsj/subscriptions","organizations_url":"https://api.github.com/users/matthewrsj/orgs","repos_url":"https://api.github.com/users/matthewrsj/repos","events_url":"https://api.github.com/users/matthewrsj/events{/privacy}","received_events_url":"https://api.github.com/users/matthewrsj/received_events","type":"User","site_admin":false},"body":"the quotes `\"\"` are not necessary if you are just trying to print a newline.\r\n\r\n```python\r\n>>> print \"\"\r\n\r\n>>> print\r\n\r\n>>> print \"\",\r\n\r\n>>> print \"\\n\"\r\n\r\n\r\n>>> \r\n```","created_at":"2016-04-18T15:28:54Z","updated_at":"2016-04-18T15:28:54Z","html_url":"https://github.com/osuosl/climesync/pull/16#discussion_r60079313","pull_request_url":"https://api.github.com/repos/osuosl/climesync/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/osuosl/climesync/pulls/comments/60079313"},"html":{"href":"https://github.com/osuosl/climesync/pull/16#discussion_r60079313"},"pull_request":{"href":"https://api.github.com/repos/osuosl/climesync/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/osuosl/climesync/pulls/16","id":66562945,"html_url":"https://github.com/osuosl/climesync/pull/16","diff_url":"https://github.com/osuosl/climesync/pull/16.diff","patch_url":"https://github.com/osuosl/climesync/pull/16.patch","issue_url":"https://api.github.com/repos/osuosl/climesync/issues/16","number":16,"state":"open","locked":false,"title":"Added option to sum total time worked on a project","user":{"login":"aaroncohen73","id":8020915,"avatar_url":"https://avatars.githubusercontent.com/u/8020915?v=3","gravatar_id":"","url":"https://api.github.com/users/aaroncohen73","html_url":"https://github.com/aaroncohen73","followers_url":"https://api.github.com/users/aaroncohen73/followers","following_url":"https://api.github.com/users/aaroncohen73/following{/other_user}","gists_url":"https://api.github.com/users/aaroncohen73/gists{/gist_id}","starred_url":"https://api.github.com/users/aaroncohen73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaroncohen73/subscriptions","organizations_url":"https://api.github.com/users/aaroncohen73/orgs","repos_url":"https://api.github.com/users/aaroncohen73/repos","events_url":"https://api.github.com/users/aaroncohen73/events{/privacy}","received_events_url":"https://api.github.com/users/aaroncohen73/received_events","type":"User","site_admin":false},"body":"By using the new \"st\" menu option, users can now view the total amount of time worked on a project and view the time worked between optional start and end dates.\r\n\r\nCloses #13 ","created_at":"2016-04-14T22:15:07Z","updated_at":"2016-04-18T15:28:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d86db9461752a47174c048e304b4c228f65c8e4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/osuosl/climesync/pulls/16/commits","review_comments_url":"https://api.github.com/repos/osuosl/climesync/pulls/16/comments","review_comment_url":"https://api.github.com/repos/osuosl/climesync/pulls/comments{/number}","comments_url":"https://api.github.com/repos/osuosl/climesync/issues/16/comments","statuses_url":"https://api.github.com/repos/osuosl/climesync/statuses/321baa7804e2722cce7382127385d7efdf024448","head":{"label":"osuosl:cohenaa/sum-project-times","ref":"cohenaa/sum-project-times","sha":"321baa7804e2722cce7382127385d7efdf024448","user":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"repo":{"id":54672492,"name":"climesync","full_name":"osuosl/climesync","owner":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osuosl/climesync","description":"CLI for the TimeSync API","fork":false,"url":"https://api.github.com/repos/osuosl/climesync","forks_url":"https://api.github.com/repos/osuosl/climesync/forks","keys_url":"https://api.github.com/repos/osuosl/climesync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osuosl/climesync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osuosl/climesync/teams","hooks_url":"https://api.github.com/repos/osuosl/climesync/hooks","issue_events_url":"https://api.github.com/repos/osuosl/climesync/issues/events{/number}","events_url":"https://api.github.com/repos/osuosl/climesync/events","assignees_url":"https://api.github.com/repos/osuosl/climesync/assignees{/user}","branches_url":"https://api.github.com/repos/osuosl/climesync/branches{/branch}","tags_url":"https://api.github.com/repos/osuosl/climesync/tags","blobs_url":"https://api.github.com/repos/osuosl/climesync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osuosl/climesync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osuosl/climesync/git/refs{/sha}","trees_url":"https://api.github.com/repos/osuosl/climesync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osuosl/climesync/statuses/{sha}","languages_url":"https://api.github.com/repos/osuosl/climesync/languages","stargazers_url":"https://api.github.com/repos/osuosl/climesync/stargazers","contributors_url":"https://api.github.com/repos/osuosl/climesync/contributors","subscribers_url":"https://api.github.com/repos/osuosl/climesync/subscribers","subscription_url":"https://api.github.com/repos/osuosl/climesync/subscription","commits_url":"https://api.github.com/repos/osuosl/climesync/commits{/sha}","git_commits_url":"https://api.github.com/repos/osuosl/climesync/git/commits{/sha}","comments_url":"https://api.github.com/repos/osuosl/climesync/comments{/number}","issue_comment_url":"https://api.github.com/repos/osuosl/climesync/issues/comments{/number}","contents_url":"https://api.github.com/repos/osuosl/climesync/contents/{+path}","compare_url":"https://api.github.com/repos/osuosl/climesync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osuosl/climesync/merges","archive_url":"https://api.github.com/repos/osuosl/climesync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osuosl/climesync/downloads","issues_url":"https://api.github.com/repos/osuosl/climesync/issues{/number}","pulls_url":"https://api.github.com/repos/osuosl/climesync/pulls{/number}","milestones_url":"https://api.github.com/repos/osuosl/climesync/milestones{/number}","notifications_url":"https://api.github.com/repos/osuosl/climesync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osuosl/climesync/labels{/name}","releases_url":"https://api.github.com/repos/osuosl/climesync/releases{/id}","deployments_url":"https://api.github.com/repos/osuosl/climesync/deployments","created_at":"2016-03-24T20:35:35Z","updated_at":"2016-04-01T16:22:39Z","pushed_at":"2016-04-15T21:54:59Z","git_url":"git://github.com/osuosl/climesync.git","ssh_url":"git@github.com:osuosl/climesync.git","clone_url":"https://github.com/osuosl/climesync.git","svn_url":"https://github.com/osuosl/climesync","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"osuosl:master","ref":"master","sha":"b6e12b16b5e2691cd11b4f98d048b12db980559d","user":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"repo":{"id":54672492,"name":"climesync","full_name":"osuosl/climesync","owner":{"login":"osuosl","id":1380625,"avatar_url":"https://avatars.githubusercontent.com/u/1380625?v=3","gravatar_id":"","url":"https://api.github.com/users/osuosl","html_url":"https://github.com/osuosl","followers_url":"https://api.github.com/users/osuosl/followers","following_url":"https://api.github.com/users/osuosl/following{/other_user}","gists_url":"https://api.github.com/users/osuosl/gists{/gist_id}","starred_url":"https://api.github.com/users/osuosl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osuosl/subscriptions","organizations_url":"https://api.github.com/users/osuosl/orgs","repos_url":"https://api.github.com/users/osuosl/repos","events_url":"https://api.github.com/users/osuosl/events{/privacy}","received_events_url":"https://api.github.com/users/osuosl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/osuosl/climesync","description":"CLI for the TimeSync API","fork":false,"url":"https://api.github.com/repos/osuosl/climesync","forks_url":"https://api.github.com/repos/osuosl/climesync/forks","keys_url":"https://api.github.com/repos/osuosl/climesync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/osuosl/climesync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/osuosl/climesync/teams","hooks_url":"https://api.github.com/repos/osuosl/climesync/hooks","issue_events_url":"https://api.github.com/repos/osuosl/climesync/issues/events{/number}","events_url":"https://api.github.com/repos/osuosl/climesync/events","assignees_url":"https://api.github.com/repos/osuosl/climesync/assignees{/user}","branches_url":"https://api.github.com/repos/osuosl/climesync/branches{/branch}","tags_url":"https://api.github.com/repos/osuosl/climesync/tags","blobs_url":"https://api.github.com/repos/osuosl/climesync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/osuosl/climesync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/osuosl/climesync/git/refs{/sha}","trees_url":"https://api.github.com/repos/osuosl/climesync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/osuosl/climesync/statuses/{sha}","languages_url":"https://api.github.com/repos/osuosl/climesync/languages","stargazers_url":"https://api.github.com/repos/osuosl/climesync/stargazers","contributors_url":"https://api.github.com/repos/osuosl/climesync/contributors","subscribers_url":"https://api.github.com/repos/osuosl/climesync/subscribers","subscription_url":"https://api.github.com/repos/osuosl/climesync/subscription","commits_url":"https://api.github.com/repos/osuosl/climesync/commits{/sha}","git_commits_url":"https://api.github.com/repos/osuosl/climesync/git/commits{/sha}","comments_url":"https://api.github.com/repos/osuosl/climesync/comments{/number}","issue_comment_url":"https://api.github.com/repos/osuosl/climesync/issues/comments{/number}","contents_url":"https://api.github.com/repos/osuosl/climesync/contents/{+path}","compare_url":"https://api.github.com/repos/osuosl/climesync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/osuosl/climesync/merges","archive_url":"https://api.github.com/repos/osuosl/climesync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/osuosl/climesync/downloads","issues_url":"https://api.github.com/repos/osuosl/climesync/issues{/number}","pulls_url":"https://api.github.com/repos/osuosl/climesync/pulls{/number}","milestones_url":"https://api.github.com/repos/osuosl/climesync/milestones{/number}","notifications_url":"https://api.github.com/repos/osuosl/climesync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/osuosl/climesync/labels{/name}","releases_url":"https://api.github.com/repos/osuosl/climesync/releases{/id}","deployments_url":"https://api.github.com/repos/osuosl/climesync/deployments","created_at":"2016-03-24T20:35:35Z","updated_at":"2016-04-01T16:22:39Z","pushed_at":"2016-04-15T21:54:59Z","git_url":"git://github.com/osuosl/climesync.git","ssh_url":"git@github.com:osuosl/climesync.git","clone_url":"https://github.com/osuosl/climesync.git","svn_url":"https://github.com/osuosl/climesync","homepage":null,"size":20,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/osuosl/climesync/pulls/16"},"html":{"href":"https://github.com/osuosl/climesync/pull/16"},"issue":{"href":"https://api.github.com/repos/osuosl/climesync/issues/16"},"comments":{"href":"https://api.github.com/repos/osuosl/climesync/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/osuosl/climesync/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/osuosl/climesync/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/osuosl/climesync/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/osuosl/climesync/statuses/321baa7804e2722cce7382127385d7efdf024448"}}}}