{"action":"created","comment":{"url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/comments/29071793","id":29071793,"diff_hunk":"@@ -0,0 +1,233 @@\n+'''\n+\n+@author: Kyle Dove\n+\n+Purpose: Download users list from Google Drive. Generate CSV files in \n+directory. Zip directory to be used to create Canvas practice courses.\n+\n+DATE           Author               Description   \n+===========    ===============      ============================================\n+Mar 31 2015    Kyle Dove\t\t\tTLUNIZIN-470\n+\t\t\t\t\t\t\t\t\tCreated.\n+\n+'''\n+\n+import logging\n+import time\n+import csv\n+import requests\n+import json\n+import os\n+import zipfile\n+from apiclient.discovery import build\n+from httplib2 import Http\n+from oauth2client import file, client, tools\n+from apiclient import errors\n+from apiclient import http\n+\n+def download_file(service, drive_file):\n+    download_url = drive_file['exportLinks']['text/csv']\n+    logger.info('DownloadUrl: ' + download_url)\n+    if download_url:\n+            resp, content = service._http.request(download_url)\n+            if resp.status == 200:\n+                    logger.info('Status: %s' % resp)\n+                    title = drive_file.get('title')\n+                    path = './input.csv'\n+                    file = open(path, 'wb')\n+                    file.write(content)\n+            else:\n+                    logger.info('An error occurred: %s' % resp)\n+                    return None\n+    else:\n+            # The file doesn't have any content stored on Drive.\n+            return None\n+\n+def zipdir(path, zip):\n+    for root, dirs, files in os.walk(path):\n+        for file in files:\n+            zip.write(os.path.join(root, file))\n+\n+#setup log","path":"practiceCourseGenerator/practiceCourseGenerator.py","position":51,"original_position":51,"commit_id":"73dbe92fe982cde33bc6ccc40838fbe7d56699a4","original_commit_id":"73dbe92fe982cde33bc6ccc40838fbe7d56699a4","user":{"login":"bkirschn","id":138902,"avatar_url":"https://avatars.githubusercontent.com/u/138902?v=3","gravatar_id":"","url":"https://api.github.com/users/bkirschn","html_url":"https://github.com/bkirschn","followers_url":"https://api.github.com/users/bkirschn/followers","following_url":"https://api.github.com/users/bkirschn/following{/other_user}","gists_url":"https://api.github.com/users/bkirschn/gists{/gist_id}","starred_url":"https://api.github.com/users/bkirschn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkirschn/subscriptions","organizations_url":"https://api.github.com/users/bkirschn/orgs","repos_url":"https://api.github.com/users/bkirschn/repos","events_url":"https://api.github.com/users/bkirschn/events{/privacy}","received_events_url":"https://api.github.com/users/bkirschn/received_events","type":"User","site_admin":false},"body":"I'd second this comment","created_at":"2015-04-24T18:10:55Z","updated_at":"2015-04-24T18:10:55Z","html_url":"https://github.com/tl-its-umich-edu/canvas/pull/48#discussion_r29071793","pull_request_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/comments/29071793"},"html":{"href":"https://github.com/tl-its-umich-edu/canvas/pull/48#discussion_r29071793"},"pull_request":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48","id":33977756,"html_url":"https://github.com/tl-its-umich-edu/canvas/pull/48","diff_url":"https://github.com/tl-its-umich-edu/canvas/pull/48.diff","patch_url":"https://github.com/tl-its-umich-edu/canvas/pull/48.patch","issue_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/48","number":48,"state":"open","locked":false,"title":"Tlunizin 470","user":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"body":"TLUNIZIN-470 Create a script to auto-generate three csvs needed for Canvas Practice Courses\r\n\r\nDue Date: 4/30/2015\r\n\r\n@bkirschn \r\n@lsloan ","created_at":"2015-04-23T17:27:03Z","updated_at":"2015-04-24T18:10:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb3b6d04acfea7bb082effe63a1e4ebef5bd8e4c","assignee":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48/commits","review_comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48/comments","review_comment_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/48/comments","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/statuses/73dbe92fe982cde33bc6ccc40838fbe7d56699a4","head":{"label":"tl-its-umich-edu:TLUNIZIN-470","ref":"TLUNIZIN-470","sha":"73dbe92fe982cde33bc6ccc40838fbe7d56699a4","user":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":22355901,"name":"canvas","full_name":"tl-its-umich-edu/canvas","owner":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tl-its-umich-edu/canvas","description":"Integration scripts between ITS TL and Instructure Canvas","fork":false,"url":"https://api.github.com/repos/tl-its-umich-edu/canvas","forks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/forks","keys_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/teams","hooks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/hooks","issue_events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/events{/number}","events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/events","assignees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/assignees{/user}","branches_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/branches{/branch}","tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/tags","blobs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/refs{/sha}","trees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/statuses/{sha}","languages_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/languages","stargazers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/stargazers","contributors_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/contributors","subscribers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/subscribers","subscription_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/subscription","commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/commits{/sha}","git_commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/commits{/sha}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/comments{/number}","issue_comment_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/comments{/number}","contents_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/contents/{+path}","compare_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/merges","archive_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/downloads","issues_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues{/number}","pulls_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls{/number}","milestones_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/milestones{/number}","notifications_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/labels{/name}","releases_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/releases{/id}","created_at":"2014-07-28T19:59:20Z","updated_at":"2015-04-14T19:05:58Z","pushed_at":"2015-04-23T17:27:03Z","git_url":"git://github.com/tl-its-umich-edu/canvas.git","ssh_url":"git@github.com:tl-its-umich-edu/canvas.git","clone_url":"https://github.com/tl-its-umich-edu/canvas.git","svn_url":"https://github.com/tl-its-umich-edu/canvas","homepage":"","size":2335,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"tl-its-umich-edu:master","ref":"master","sha":"7ba64f65d73b7fe0f3b42e52fc2861d4cc5f76f8","user":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":22355901,"name":"canvas","full_name":"tl-its-umich-edu/canvas","owner":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tl-its-umich-edu/canvas","description":"Integration scripts between ITS TL and Instructure Canvas","fork":false,"url":"https://api.github.com/repos/tl-its-umich-edu/canvas","forks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/forks","keys_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/teams","hooks_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/hooks","issue_events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/events{/number}","events_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/events","assignees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/assignees{/user}","branches_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/branches{/branch}","tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/tags","blobs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/refs{/sha}","trees_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/statuses/{sha}","languages_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/languages","stargazers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/stargazers","contributors_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/contributors","subscribers_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/subscribers","subscription_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/subscription","commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/commits{/sha}","git_commits_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/git/commits{/sha}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/comments{/number}","issue_comment_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/comments{/number}","contents_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/contents/{+path}","compare_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/merges","archive_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/downloads","issues_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues{/number}","pulls_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls{/number}","milestones_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/milestones{/number}","notifications_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/labels{/name}","releases_url":"https://api.github.com/repos/tl-its-umich-edu/canvas/releases{/id}","created_at":"2014-07-28T19:59:20Z","updated_at":"2015-04-14T19:05:58Z","pushed_at":"2015-04-23T17:27:03Z","git_url":"git://github.com/tl-its-umich-edu/canvas.git","ssh_url":"git@github.com:tl-its-umich-edu/canvas.git","clone_url":"https://github.com/tl-its-umich-edu/canvas.git","svn_url":"https://github.com/tl-its-umich-edu/canvas","homepage":"","size":2335,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48"},"html":{"href":"https://github.com/tl-its-umich-edu/canvas/pull/48"},"issue":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/48"},"comments":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/tl-its-umich-edu/canvas/statuses/73dbe92fe982cde33bc6ccc40838fbe7d56699a4"}}}}