{"action":"created","comment":{"url":"https://api.github.com/repos/zulip/zulip/pulls/comments/109991297","pull_request_review_id":31130111,"id":109991297,"diff_hunk":"@@ -74,14 +84,30 @@ def __init__(self, name, client_name=None, logo=None, secondary_line_text=None,\n         self.url = url\n \n         if doc is None:\n-            doc = self.DEFAULT_DOC_PATH.format(name=name)\n+            try:\n+                doc = self.DEFAULT_DOC_PATH.format(name=name, ext='md')\n+                loader.get_template(doc)\n+            except loader.TemplateDoesNotExist:\n+                doc = self.DEFAULT_DOC_PATH.format(name=name, ext='html')","path":"zerver/lib/integrations.py","position":52,"original_position":52,"commit_id":"060859ef67a660e60aacfa754f720e4564c230a8","original_commit_id":"060859ef67a660e60aacfa754f720e4564c230a8","user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars3.githubusercontent.com/u/2746074?v=3","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"body":"Actually, I have a concern here -- since this runs at import time, is `loader.get_template()` expensive?  If so, we might want to do something cheaper.  \r\n\r\nI did some quick testing and confirmed that this appears to add like 10ms to the import time for this module:\r\n```\r\n# Post-branch\r\nIn [2]: print time.time(); import zerver.lib.integrations; print time.time()\r\n1491416444.57\r\n1491416444.7\r\n\r\n# Pre-branch\r\nIn [2]: print time.time(); import zerver.lib.integrations; print time.time()\r\n1491416460.92\r\n1491416460.98\r\n```\r\n\r\nShould we just use an `os.path.join()` check to see which file exists rather than `loader.get_template()`?","created_at":"2017-04-05T18:22:09Z","updated_at":"2017-04-05T18:22:09Z","html_url":"https://github.com/zulip/zulip/pull/4398#discussion_r109991297","pull_request_url":"https://api.github.com/repos/zulip/zulip/pulls/4398","_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments/109991297"},"html":{"href":"https://github.com/zulip/zulip/pull/4398#discussion_r109991297"},"pull_request":{"href":"https://api.github.com/repos/zulip/zulip/pulls/4398"}}},"pull_request":{"url":"https://api.github.com/repos/zulip/zulip/pulls/4398","id":113918333,"html_url":"https://github.com/zulip/zulip/pull/4398","diff_url":"https://github.com/zulip/zulip/pull/4398.diff","patch_url":"https://github.com/zulip/zulip/pull/4398.patch","issue_url":"https://api.github.com/repos/zulip/zulip/issues/4398","number":4398,"state":"open","locked":false,"title":"Support writing integration documentation in markdown","user":{"login":"umairwaheed","id":641763,"avatar_url":"https://avatars2.githubusercontent.com/u/641763?v=3","gravatar_id":"","url":"https://api.github.com/users/umairwaheed","html_url":"https://github.com/umairwaheed","followers_url":"https://api.github.com/users/umairwaheed/followers","following_url":"https://api.github.com/users/umairwaheed/following{/other_user}","gists_url":"https://api.github.com/users/umairwaheed/gists{/gist_id}","starred_url":"https://api.github.com/users/umairwaheed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairwaheed/subscriptions","organizations_url":"https://api.github.com/users/umairwaheed/orgs","repos_url":"https://api.github.com/users/umairwaheed/repos","events_url":"https://api.github.com/users/umairwaheed/events{/privacy}","received_events_url":"https://api.github.com/users/umairwaheed/received_events","type":"User","site_admin":false},"body":"Fixes #4011","created_at":"2017-04-03T12:24:23Z","updated_at":"2017-04-05T18:22:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2a386fb22d80bd68d70dc878c6b5dd164e0b61ad","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zulip/zulip/pulls/4398/commits","review_comments_url":"https://api.github.com/repos/zulip/zulip/pulls/4398/comments","review_comment_url":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/4398/comments","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/060859ef67a660e60aacfa754f720e4564c230a8","head":{"label":"umairwaheed:4011-markdown-documentation","ref":"4011-markdown-documentation","sha":"060859ef67a660e60aacfa754f720e4564c230a8","user":{"login":"umairwaheed","id":641763,"avatar_url":"https://avatars2.githubusercontent.com/u/641763?v=3","gravatar_id":"","url":"https://api.github.com/users/umairwaheed","html_url":"https://github.com/umairwaheed","followers_url":"https://api.github.com/users/umairwaheed/followers","following_url":"https://api.github.com/users/umairwaheed/following{/other_user}","gists_url":"https://api.github.com/users/umairwaheed/gists{/gist_id}","starred_url":"https://api.github.com/users/umairwaheed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairwaheed/subscriptions","organizations_url":"https://api.github.com/users/umairwaheed/orgs","repos_url":"https://api.github.com/users/umairwaheed/repos","events_url":"https://api.github.com/users/umairwaheed/events{/privacy}","received_events_url":"https://api.github.com/users/umairwaheed/received_events","type":"User","site_admin":false},"repo":{"id":56792781,"name":"zulip","full_name":"umairwaheed/zulip","owner":{"login":"umairwaheed","id":641763,"avatar_url":"https://avatars2.githubusercontent.com/u/641763?v=3","gravatar_id":"","url":"https://api.github.com/users/umairwaheed","html_url":"https://github.com/umairwaheed","followers_url":"https://api.github.com/users/umairwaheed/followers","following_url":"https://api.github.com/users/umairwaheed/following{/other_user}","gists_url":"https://api.github.com/users/umairwaheed/gists{/gist_id}","starred_url":"https://api.github.com/users/umairwaheed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umairwaheed/subscriptions","organizations_url":"https://api.github.com/users/umairwaheed/orgs","repos_url":"https://api.github.com/users/umairwaheed/repos","events_url":"https://api.github.com/users/umairwaheed/events{/privacy}","received_events_url":"https://api.github.com/users/umairwaheed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/umairwaheed/zulip","description":"Zulip server - powerful open source group chat","fork":true,"url":"https://api.github.com/repos/umairwaheed/zulip","forks_url":"https://api.github.com/repos/umairwaheed/zulip/forks","keys_url":"https://api.github.com/repos/umairwaheed/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umairwaheed/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umairwaheed/zulip/teams","hooks_url":"https://api.github.com/repos/umairwaheed/zulip/hooks","issue_events_url":"https://api.github.com/repos/umairwaheed/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/umairwaheed/zulip/events","assignees_url":"https://api.github.com/repos/umairwaheed/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/umairwaheed/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/umairwaheed/zulip/tags","blobs_url":"https://api.github.com/repos/umairwaheed/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umairwaheed/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umairwaheed/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/umairwaheed/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umairwaheed/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/umairwaheed/zulip/languages","stargazers_url":"https://api.github.com/repos/umairwaheed/zulip/stargazers","contributors_url":"https://api.github.com/repos/umairwaheed/zulip/contributors","subscribers_url":"https://api.github.com/repos/umairwaheed/zulip/subscribers","subscription_url":"https://api.github.com/repos/umairwaheed/zulip/subscription","commits_url":"https://api.github.com/repos/umairwaheed/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/umairwaheed/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/umairwaheed/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/umairwaheed/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/umairwaheed/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/umairwaheed/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umairwaheed/zulip/merges","archive_url":"https://api.github.com/repos/umairwaheed/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umairwaheed/zulip/downloads","issues_url":"https://api.github.com/repos/umairwaheed/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/umairwaheed/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/umairwaheed/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/umairwaheed/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umairwaheed/zulip/labels{/name}","releases_url":"https://api.github.com/repos/umairwaheed/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/umairwaheed/zulip/deployments","created_at":"2016-04-21T17:22:21Z","updated_at":"2016-12-06T16:12:26Z","pushed_at":"2017-04-05T10:53:02Z","git_url":"git://github.com/umairwaheed/zulip.git","ssh_url":"git@github.com:umairwaheed/zulip.git","clone_url":"https://github.com/umairwaheed/zulip.git","svn_url":"https://github.com/umairwaheed/zulip","homepage":"","size":153384,"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":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zulip:master","ref":"master","sha":"bccda3c76af93b104047434e9111d7ae9800ed07","user":{"login":"zulip","id":4921959,"avatar_url":"https://avatars1.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"repo":{"id":43160685,"name":"zulip","full_name":"zulip/zulip","owner":{"login":"zulip","id":4921959,"avatar_url":"https://avatars1.githubusercontent.com/u/4921959?v=3","gravatar_id":"","url":"https://api.github.com/users/zulip","html_url":"https://github.com/zulip","followers_url":"https://api.github.com/users/zulip/followers","following_url":"https://api.github.com/users/zulip/following{/other_user}","gists_url":"https://api.github.com/users/zulip/gists{/gist_id}","starred_url":"https://api.github.com/users/zulip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zulip/subscriptions","organizations_url":"https://api.github.com/users/zulip/orgs","repos_url":"https://api.github.com/users/zulip/repos","events_url":"https://api.github.com/users/zulip/events{/privacy}","received_events_url":"https://api.github.com/users/zulip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zulip/zulip","description":"Zulip server - powerful open source group chat","fork":false,"url":"https://api.github.com/repos/zulip/zulip","forks_url":"https://api.github.com/repos/zulip/zulip/forks","keys_url":"https://api.github.com/repos/zulip/zulip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zulip/zulip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zulip/zulip/teams","hooks_url":"https://api.github.com/repos/zulip/zulip/hooks","issue_events_url":"https://api.github.com/repos/zulip/zulip/issues/events{/number}","events_url":"https://api.github.com/repos/zulip/zulip/events","assignees_url":"https://api.github.com/repos/zulip/zulip/assignees{/user}","branches_url":"https://api.github.com/repos/zulip/zulip/branches{/branch}","tags_url":"https://api.github.com/repos/zulip/zulip/tags","blobs_url":"https://api.github.com/repos/zulip/zulip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zulip/zulip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zulip/zulip/git/refs{/sha}","trees_url":"https://api.github.com/repos/zulip/zulip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zulip/zulip/statuses/{sha}","languages_url":"https://api.github.com/repos/zulip/zulip/languages","stargazers_url":"https://api.github.com/repos/zulip/zulip/stargazers","contributors_url":"https://api.github.com/repos/zulip/zulip/contributors","subscribers_url":"https://api.github.com/repos/zulip/zulip/subscribers","subscription_url":"https://api.github.com/repos/zulip/zulip/subscription","commits_url":"https://api.github.com/repos/zulip/zulip/commits{/sha}","git_commits_url":"https://api.github.com/repos/zulip/zulip/git/commits{/sha}","comments_url":"https://api.github.com/repos/zulip/zulip/comments{/number}","issue_comment_url":"https://api.github.com/repos/zulip/zulip/issues/comments{/number}","contents_url":"https://api.github.com/repos/zulip/zulip/contents/{+path}","compare_url":"https://api.github.com/repos/zulip/zulip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zulip/zulip/merges","archive_url":"https://api.github.com/repos/zulip/zulip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zulip/zulip/downloads","issues_url":"https://api.github.com/repos/zulip/zulip/issues{/number}","pulls_url":"https://api.github.com/repos/zulip/zulip/pulls{/number}","milestones_url":"https://api.github.com/repos/zulip/zulip/milestones{/number}","notifications_url":"https://api.github.com/repos/zulip/zulip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zulip/zulip/labels{/name}","releases_url":"https://api.github.com/repos/zulip/zulip/releases{/id}","deployments_url":"https://api.github.com/repos/zulip/zulip/deployments","created_at":"2015-09-25T16:37:25Z","updated_at":"2017-04-05T14:47:45Z","pushed_at":"2017-04-05T18:09:44Z","git_url":"git://github.com/zulip/zulip.git","ssh_url":"git@github.com:zulip/zulip.git","clone_url":"https://github.com/zulip/zulip.git","svn_url":"https://github.com/zulip/zulip","homepage":"","size":153208,"stargazers_count":4624,"watchers_count":4624,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1200,"mirror_url":null,"open_issues_count":757,"forks":1200,"open_issues":757,"watchers":4624,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zulip/zulip/pulls/4398"},"html":{"href":"https://github.com/zulip/zulip/pull/4398"},"issue":{"href":"https://api.github.com/repos/zulip/zulip/issues/4398"},"comments":{"href":"https://api.github.com/repos/zulip/zulip/issues/4398/comments"},"review_comments":{"href":"https://api.github.com/repos/zulip/zulip/pulls/4398/comments"},"review_comment":{"href":"https://api.github.com/repos/zulip/zulip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zulip/zulip/pulls/4398/commits"},"statuses":{"href":"https://api.github.com/repos/zulip/zulip/statuses/060859ef67a660e60aacfa754f720e4564c230a8"}}}}
{"actor":{"display_login":"timabbott"}}