{"action":"created","comment":{"url":"https://api.github.com/repos/pyvideo/data/pulls/comments/136111745","pull_request_review_id":59605364,"id":136111745,"diff_hunk":"@@ -0,0 +1,140 @@\n+import openpyxl as op\n+from textwrap import wrap\n+import json\n+import os\n+#from os.path import join as slash\n+\n+# Process lightning talk from an excel file with these columns:\n+# Event, Pathname, Video, Time, Speakers, Name, Description\n+# run like \"cd <mypydatadir>; python tools/parse_lightning_spreadsheet.py\"\n+XLS_FILENAME = 'tools/lightning.xlsx'\n+\n+\n+class Talk:\n+    \"\"\" A talk.  Does not know its own conference. \"\"\"\n+\n+    def __init__(self, start, speakers, title, description):\n+        self.start = start if start else \"\"\n+        self.speakers = speakers if speakers else \"\"\n+        self.title = title if title else \"\"\n+        self.description = description if description else \"\"\n+\n+\n+def read_xls_file(filename):\n+    \"\"\" return two dictionaries indexed by filename:  talks and session_names \"\"\"\n+\n+    def c(rw, col):\n+        return worksheet.cell(row=rw, column=col).value\n+\n+    workbook = op.load_workbook(filename)\n+    worksheet = workbook.active\n+    talks = {}\n+    session_names = {}\n+    row = 2\n+    while c(row, 2):\n+        pathname = c(row, 2)\n+        talk = Talk(c(row, 4), c(row, 5), c(row, 6), c(row, 7))\n+        if pathname not in talks:\n+            talks[pathname] = []\n+            session_names[pathname] = c(row, 3)\n+        talks[pathname].append(talk)\n+        row += 1\n+    return talks, session_names\n+\n+\n+\n+\n+def table(topic_name, talks):\n+    def table_header_part(topic_name):\n+        column_titles = ['Start', 'Speakers', 'Subject']\n+        lines = []\n+        lines.append(topic_name)\n+        lines.append(\"\")\n+        lines.append(sep_line)\n+        lines.append(basic_line_format.format(*column_titles))\n+        lines.append(big_sep_line)\n+        return lines\n+\n+    def table_part_for_talk(talk):\n+        # format one talk, with as many lines necessary for longer of speakers or combination of title and description\n+\n+        start = wrap(talk.start, width[0])\n+        speakers = wrap(talk.speakers, width[1])\n+        title1 = wrap(talk.title, width[2] - 4)\n+        titles = ['**' + aline + '**' for aline in title1]\n+        desc = wrap('- ' + talk.description, width[2])\n+        big_col = titles + desc\n+\n+        num_lines = max(len(start), len(speakers), len(big_col))\n+        part = []\n+        for i in range(num_lines):\n+            st = \"\" if i >= len(start) else start[i]\n+            sp = \"\" if i >= len(speakers) else speakers[i]\n+            bi = \"\" if i >= len(big_col) else big_col[i]\n+            part.append(basic_line_format.format(st, sp, bi))\n+        return part\n+\n+    # set constants\n+    width = [8, 18, 54]\n+    sep_line = '+{}+{}+{}+'.format('-' * (width[0] + 2), '-' * (width[1] + 2), '-' * (width[2] + 2))\n+    big_sep_line = '+{}+{}+{}+'.format('=' * (width[0] + 2), '=' * (width[1] + 2), '=' * (width[2] + 2))\n+    basic_line_format = '+ {:' + str(width[0]) + '} | {:' + str(width[1]) + '} | {:' + str(width[2]) + '} +'\n+\n+    lines = table_header_part(topic_name)\n+    for talk in talks:\n+        talk_lines = table_part_for_talk(talk)\n+        lines.extend(talk_lines)\n+        lines.append(sep_line)\n+    return \"\\n\".join(lines)\n+\n+def quote_for_json(unquoted_new_contents):","path":"tools/parse_lightning_spreadsheet.py","position":90,"original_position":90,"commit_id":"fe4822288c3b5a6d8a783a06faa64fa7542b1309","original_commit_id":"7123b40250ee0edf5ab0efa1a3baa0ae044d7c3f","user":{"login":"Daniel-at-github","id":4407929,"avatar_url":"https://avatars3.githubusercontent.com/u/4407929?v=4","gravatar_id":"","url":"https://api.github.com/users/Daniel-at-github","html_url":"https://github.com/Daniel-at-github","followers_url":"https://api.github.com/users/Daniel-at-github/followers","following_url":"https://api.github.com/users/Daniel-at-github/following{/other_user}","gists_url":"https://api.github.com/users/Daniel-at-github/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel-at-github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel-at-github/subscriptions","organizations_url":"https://api.github.com/users/Daniel-at-github/orgs","repos_url":"https://api.github.com/users/Daniel-at-github/repos","events_url":"https://api.github.com/users/Daniel-at-github/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel-at-github/received_events","type":"User","site_admin":false},"body":"This is how I render it:\r\n~~~ bash\r\ncd ~/git/pyvideo\r\nmake html VERBOSE=1 && make serve\r\n~~~\r\nIf it works in OSX, it give you a copy of the web (this is how it's made).","created_at":"2017-08-30T15:55:26Z","updated_at":"2017-08-30T15:55:26Z","html_url":"https://github.com/pyvideo/data/pull/352#discussion_r136111745","pull_request_url":"https://api.github.com/repos/pyvideo/data/pulls/352","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/pyvideo/data/pulls/comments/136111745"},"html":{"href":"https://github.com/pyvideo/data/pull/352#discussion_r136111745"},"pull_request":{"href":"https://api.github.com/repos/pyvideo/data/pulls/352"}},"in_reply_to_id":135833287},"pull_request":{"url":"https://api.github.com/repos/pyvideo/data/pulls/352","id":138087591,"html_url":"https://github.com/pyvideo/data/pull/352","diff_url":"https://github.com/pyvideo/data/pull/352.diff","patch_url":"https://github.com/pyvideo/data/pull/352.patch","issue_url":"https://api.github.com/repos/pyvideo/data/issues/352","number":352,"state":"open","locked":false,"title":"Lightning Talk data and tool","user":{"login":"merriam","id":159998,"avatar_url":"https://avatars3.githubusercontent.com/u/159998?v=4","gravatar_id":"","url":"https://api.github.com/users/merriam","html_url":"https://github.com/merriam","followers_url":"https://api.github.com/users/merriam/followers","following_url":"https://api.github.com/users/merriam/following{/other_user}","gists_url":"https://api.github.com/users/merriam/gists{/gist_id}","starred_url":"https://api.github.com/users/merriam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merriam/subscriptions","organizations_url":"https://api.github.com/users/merriam/orgs","repos_url":"https://api.github.com/users/merriam/repos","events_url":"https://api.github.com/users/merriam/events{/privacy}","received_events_url":"https://api.github.com/users/merriam/received_events","type":"User","site_admin":false},"body":"Add lightning talk descriptions for all sessions of  SciPy 2017 and PyCon US 2017.  Added a spreadsheet of the data and tool to parse it into descriptions to tools/","created_at":"2017-08-29T04:21:17Z","updated_at":"2017-08-30T15:55:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8949c7387c67c57a6b5321830ac832ca8478b03","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pyvideo/data/pulls/352/commits","review_comments_url":"https://api.github.com/repos/pyvideo/data/pulls/352/comments","review_comment_url":"https://api.github.com/repos/pyvideo/data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pyvideo/data/issues/352/comments","statuses_url":"https://api.github.com/repos/pyvideo/data/statuses/fe4822288c3b5a6d8a783a06faa64fa7542b1309","head":{"label":"merriam:master","ref":"master","sha":"fe4822288c3b5a6d8a783a06faa64fa7542b1309","user":{"login":"merriam","id":159998,"avatar_url":"https://avatars3.githubusercontent.com/u/159998?v=4","gravatar_id":"","url":"https://api.github.com/users/merriam","html_url":"https://github.com/merriam","followers_url":"https://api.github.com/users/merriam/followers","following_url":"https://api.github.com/users/merriam/following{/other_user}","gists_url":"https://api.github.com/users/merriam/gists{/gist_id}","starred_url":"https://api.github.com/users/merriam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merriam/subscriptions","organizations_url":"https://api.github.com/users/merriam/orgs","repos_url":"https://api.github.com/users/merriam/repos","events_url":"https://api.github.com/users/merriam/events{/privacy}","received_events_url":"https://api.github.com/users/merriam/received_events","type":"User","site_admin":false},"repo":{"id":101581945,"name":"data","full_name":"merriam/data","owner":{"login":"merriam","id":159998,"avatar_url":"https://avatars3.githubusercontent.com/u/159998?v=4","gravatar_id":"","url":"https://api.github.com/users/merriam","html_url":"https://github.com/merriam","followers_url":"https://api.github.com/users/merriam/followers","following_url":"https://api.github.com/users/merriam/following{/other_user}","gists_url":"https://api.github.com/users/merriam/gists{/gist_id}","starred_url":"https://api.github.com/users/merriam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merriam/subscriptions","organizations_url":"https://api.github.com/users/merriam/orgs","repos_url":"https://api.github.com/users/merriam/repos","events_url":"https://api.github.com/users/merriam/events{/privacy}","received_events_url":"https://api.github.com/users/merriam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/merriam/data","description":"Python related videos and metadata powering => ","fork":true,"url":"https://api.github.com/repos/merriam/data","forks_url":"https://api.github.com/repos/merriam/data/forks","keys_url":"https://api.github.com/repos/merriam/data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/merriam/data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/merriam/data/teams","hooks_url":"https://api.github.com/repos/merriam/data/hooks","issue_events_url":"https://api.github.com/repos/merriam/data/issues/events{/number}","events_url":"https://api.github.com/repos/merriam/data/events","assignees_url":"https://api.github.com/repos/merriam/data/assignees{/user}","branches_url":"https://api.github.com/repos/merriam/data/branches{/branch}","tags_url":"https://api.github.com/repos/merriam/data/tags","blobs_url":"https://api.github.com/repos/merriam/data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/merriam/data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/merriam/data/git/refs{/sha}","trees_url":"https://api.github.com/repos/merriam/data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/merriam/data/statuses/{sha}","languages_url":"https://api.github.com/repos/merriam/data/languages","stargazers_url":"https://api.github.com/repos/merriam/data/stargazers","contributors_url":"https://api.github.com/repos/merriam/data/contributors","subscribers_url":"https://api.github.com/repos/merriam/data/subscribers","subscription_url":"https://api.github.com/repos/merriam/data/subscription","commits_url":"https://api.github.com/repos/merriam/data/commits{/sha}","git_commits_url":"https://api.github.com/repos/merriam/data/git/commits{/sha}","comments_url":"https://api.github.com/repos/merriam/data/comments{/number}","issue_comment_url":"https://api.github.com/repos/merriam/data/issues/comments{/number}","contents_url":"https://api.github.com/repos/merriam/data/contents/{+path}","compare_url":"https://api.github.com/repos/merriam/data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/merriam/data/merges","archive_url":"https://api.github.com/repos/merriam/data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/merriam/data/downloads","issues_url":"https://api.github.com/repos/merriam/data/issues{/number}","pulls_url":"https://api.github.com/repos/merriam/data/pulls{/number}","milestones_url":"https://api.github.com/repos/merriam/data/milestones{/number}","notifications_url":"https://api.github.com/repos/merriam/data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/merriam/data/labels{/name}","releases_url":"https://api.github.com/repos/merriam/data/releases{/id}","deployments_url":"https://api.github.com/repos/merriam/data/deployments","created_at":"2017-08-27T21:38:32Z","updated_at":"2017-08-27T21:38:44Z","pushed_at":"2017-08-29T16:04:07Z","git_url":"git://github.com/merriam/data.git","ssh_url":"git@github.com:merriam/data.git","clone_url":"https://github.com/merriam/data.git","svn_url":"https://github.com/merriam/data","homepage":"http://pyvideo.org","size":14085,"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":"pyvideo:master","ref":"master","sha":"0167917e62075d74b8077169aec71878ceed555a","user":{"login":"pyvideo","id":8503767,"avatar_url":"https://avatars2.githubusercontent.com/u/8503767?v=4","gravatar_id":"","url":"https://api.github.com/users/pyvideo","html_url":"https://github.com/pyvideo","followers_url":"https://api.github.com/users/pyvideo/followers","following_url":"https://api.github.com/users/pyvideo/following{/other_user}","gists_url":"https://api.github.com/users/pyvideo/gists{/gist_id}","starred_url":"https://api.github.com/users/pyvideo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyvideo/subscriptions","organizations_url":"https://api.github.com/users/pyvideo/orgs","repos_url":"https://api.github.com/users/pyvideo/repos","events_url":"https://api.github.com/users/pyvideo/events{/privacy}","received_events_url":"https://api.github.com/users/pyvideo/received_events","type":"Organization","site_admin":false},"repo":{"id":65705988,"name":"data","full_name":"pyvideo/data","owner":{"login":"pyvideo","id":8503767,"avatar_url":"https://avatars2.githubusercontent.com/u/8503767?v=4","gravatar_id":"","url":"https://api.github.com/users/pyvideo","html_url":"https://github.com/pyvideo","followers_url":"https://api.github.com/users/pyvideo/followers","following_url":"https://api.github.com/users/pyvideo/following{/other_user}","gists_url":"https://api.github.com/users/pyvideo/gists{/gist_id}","starred_url":"https://api.github.com/users/pyvideo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyvideo/subscriptions","organizations_url":"https://api.github.com/users/pyvideo/orgs","repos_url":"https://api.github.com/users/pyvideo/repos","events_url":"https://api.github.com/users/pyvideo/events{/privacy}","received_events_url":"https://api.github.com/users/pyvideo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pyvideo/data","description":"Python related videos and metadata powering => ","fork":false,"url":"https://api.github.com/repos/pyvideo/data","forks_url":"https://api.github.com/repos/pyvideo/data/forks","keys_url":"https://api.github.com/repos/pyvideo/data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyvideo/data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyvideo/data/teams","hooks_url":"https://api.github.com/repos/pyvideo/data/hooks","issue_events_url":"https://api.github.com/repos/pyvideo/data/issues/events{/number}","events_url":"https://api.github.com/repos/pyvideo/data/events","assignees_url":"https://api.github.com/repos/pyvideo/data/assignees{/user}","branches_url":"https://api.github.com/repos/pyvideo/data/branches{/branch}","tags_url":"https://api.github.com/repos/pyvideo/data/tags","blobs_url":"https://api.github.com/repos/pyvideo/data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyvideo/data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyvideo/data/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyvideo/data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyvideo/data/statuses/{sha}","languages_url":"https://api.github.com/repos/pyvideo/data/languages","stargazers_url":"https://api.github.com/repos/pyvideo/data/stargazers","contributors_url":"https://api.github.com/repos/pyvideo/data/contributors","subscribers_url":"https://api.github.com/repos/pyvideo/data/subscribers","subscription_url":"https://api.github.com/repos/pyvideo/data/subscription","commits_url":"https://api.github.com/repos/pyvideo/data/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyvideo/data/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyvideo/data/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyvideo/data/issues/comments{/number}","contents_url":"https://api.github.com/repos/pyvideo/data/contents/{+path}","compare_url":"https://api.github.com/repos/pyvideo/data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyvideo/data/merges","archive_url":"https://api.github.com/repos/pyvideo/data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyvideo/data/downloads","issues_url":"https://api.github.com/repos/pyvideo/data/issues{/number}","pulls_url":"https://api.github.com/repos/pyvideo/data/pulls{/number}","milestones_url":"https://api.github.com/repos/pyvideo/data/milestones{/number}","notifications_url":"https://api.github.com/repos/pyvideo/data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyvideo/data/labels{/name}","releases_url":"https://api.github.com/repos/pyvideo/data/releases{/id}","deployments_url":"https://api.github.com/repos/pyvideo/data/deployments","created_at":"2016-08-15T05:08:47Z","updated_at":"2017-08-25T16:56:23Z","pushed_at":"2017-08-29T17:39:33Z","git_url":"git://github.com/pyvideo/data.git","ssh_url":"git@github.com:pyvideo/data.git","clone_url":"https://github.com/pyvideo/data.git","svn_url":"https://github.com/pyvideo/data","homepage":"http://pyvideo.org","size":14057,"stargazers_count":94,"watchers_count":94,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":75,"mirror_url":null,"open_issues_count":40,"forks":75,"open_issues":40,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pyvideo/data/pulls/352"},"html":{"href":"https://github.com/pyvideo/data/pull/352"},"issue":{"href":"https://api.github.com/repos/pyvideo/data/issues/352"},"comments":{"href":"https://api.github.com/repos/pyvideo/data/issues/352/comments"},"review_comments":{"href":"https://api.github.com/repos/pyvideo/data/pulls/352/comments"},"review_comment":{"href":"https://api.github.com/repos/pyvideo/data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pyvideo/data/pulls/352/commits"},"statuses":{"href":"https://api.github.com/repos/pyvideo/data/statuses/fe4822288c3b5a6d8a783a06faa64fa7542b1309"}},"author_association":"NONE"}}
{"actor":{"display_login":"Daniel-at-github"}}