GitHub PullRequestReviewCommentEvent at 2014-08-13 02:08:14
Repository: documentation
Actor: theengineear
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/plotly/documentation/pulls/comments/16154412","id":16154412,"diff_hunk":"@@ -524,34 +524,30 @@ def process_model_leaf(leaf, options):\n             raise plotly.exceptions.PlotlyError(\n                 \"unsuccessful request at resource. '{}'\"\n                 \"\".format(translator_server))\n-        code += res.content\n+        code = res.content\n         code = code.replace(\"<pre>\", \"\").replace(\"</pre>\", \"\")\n         code = code.replace('\">>>', \"\").replace('<<<\"', \"\")\n         code = code.replace(\"'>>>\", \"\").replace(\"<<<'\", \"\")\n-        exec_string = format_code(code, 'python', leaf, model, 'execution')\n-        leaf['python-exec'] = exec_string\n+        raw_exec_code = init + remove_header(code)\n+        leaf['python-exec'] = raw_exec_code\n     for language in model_languages:\n         time.sleep(.2)  # added to help with connection errors\n-        code = \"\"\n-        if 'init' in leaf['config'] and leaf['config']['init']:\n-            init_file = \"init.{}\".format(lang_to_ext[language])\n-            if init_file in leaf['files']:\n-                with open(leaf['files'][init_file]) as f:\n-                    code += f.read() + \"\\n\"\n-            else:\n-                raise plotly.exceptions.PlotlyError(\n-                    \"couldn't find '{}' in '{}'\"\n-                    \"\".format(init_file, leaf['path'])\n-                )\n+        init = get_init_code(leaf)\n+        try:\n+            plot_options = leaf['config']['plot-options']\n+        except KeyError:\n+            plot_options = {}\n+        plot_options['filename'] = leaf['id']\n+        plot_options['fileopt'] = 'overwrite'\n+        data = {'json_figure': model,\n+                'pretty': True,\n+                'plot_options': plot_options}\n         if language == 'nodejs' or language == 'js':  # todo, temporary fix!\n-            data = json.dumps({'json_figure': model,\n-                               'language': 'node',\n-                               'pretty': True})\n+            data['language'] = 'not_node'  # TODO change to 'node' later\n         else:\n-            data = json.dumps({'json_figure': model,\n-                               'language': language,\n-                               'pretty': True})\n-        res = get_plotly_response(translator_server, data=data)\n+            data['language'] = language\n+        # get documentation code...","path":"run.py","position":82,"original_position":82,"commit_id":"5051770c4a1e6c54ff8a273bc94ce9759003a2ae","original_commit_id":"5051770c4a1e6c54ff8a273bc94ce9759003a2ae","user":{"login":"theengineear","id":6611546,"avatar_url":"https://avatars.githubusercontent.com/u/6611546?v=2","gravatar_id":"21923dbd41887e6c037c5a3d55743601","url":"https://api.github.com/users/theengineear","html_url":"https://github.com/theengineear","followers_url":"https://api.github.com/users/theengineear/followers","following_url":"https://api.github.com/users/theengineear/following{/other_user}","gists_url":"https://api.github.com/users/theengineear/gists{/gist_id}","starred_url":"https://api.github.com/users/theengineear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theengineear/subscriptions","organizations_url":"https://api.github.com/users/theengineear/orgs","repos_url":"https://api.github.com/users/theengineear/repos","events_url":"https://api.github.com/users/theengineear/events{/privacy}","received_events_url":"https://api.github.com/users/theengineear/received_events","type":"User","site_admin":false},"body":"call the translator once to get the documentation code","created_at":"2014-08-13T02:08:14Z","updated_at":"2014-08-13T02:08:14Z","html_url":"https://github.com/plotly/documentation/pull/27#discussion_r16154412","pull_request_url":"https://api.github.com/repos/plotly/documentation/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/plotly/documentation/pulls/comments/16154412"},"html":{"href":"https://github.com/plotly/documentation/pull/27#discussion_r16154412"},"pull_request":{"href":"https://api.github.com/repos/plotly/documentation/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/plotly/documentation/pulls/27","id":19701454,"html_url":"https://github.com/plotly/documentation/pull/27","diff_url":"https://github.com/plotly/documentation/pull/27.diff","patch_url":"https://github.com/plotly/documentation/pull/27.patch","issue_url":"https://api.github.com/repos/plotly/documentation/issues/27","number":27,"state":"open","title":"removed plot-call creation. formatted new return from translator.","user":{"login":"theengineear","id":6611546,"avatar_url":"https://avatars.githubusercontent.com/u/6611546?v=2","gravatar_id":"21923dbd41887e6c037c5a3d55743601","url":"https://api.github.com/users/theengineear","html_url":"https://github.com/theengineear","followers_url":"https://api.github.com/users/theengineear/followers","following_url":"https://api.github.com/users/theengineear/following{/other_user}","gists_url":"https://api.github.com/users/theengineear/gists{/gist_id}","starred_url":"https://api.github.com/users/theengineear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theengineear/subscriptions","organizations_url":"https://api.github.com/users/theengineear/orgs","repos_url":"https://api.github.com/users/theengineear/repos","events_url":"https://api.github.com/users/theengineear/events{/privacy}","received_events_url":"https://api.github.com/users/theengineear/received_events","type":"User","site_admin":false},"body":"@etpinard, here are the changes we need. I need to change a reference from 'nodejs' to 'node' on the translator in streambed. but other than that, this *should* give us what we need.","created_at":"2014-08-13T02:05:05Z","updated_at":"2014-08-13T02:08:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46c3c2666b969778d931373c459d3c0bd684af8d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/plotly/documentation/pulls/27/commits","review_comments_url":"https://api.github.com/repos/plotly/documentation/pulls/27/comments","review_comment_url":"https://api.github.com/repos/plotly/documentation/pulls/comments/{number}","comments_url":"https://api.github.com/repos/plotly/documentation/issues/27/comments","statuses_url":"https://api.github.com/repos/plotly/documentation/statuses/5051770c4a1e6c54ff8a273bc94ce9759003a2ae","head":{"label":"plotly:translator-updates","ref":"translator-updates","sha":"5051770c4a1e6c54ff8a273bc94ce9759003a2ae","user":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=2","gravatar_id":"539b3403d351d8e6ec0c52af82bc9488","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"repo":{"id":18997629,"name":"documentation","full_name":"plotly/documentation","owner":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=2","gravatar_id":"539b3403d351d8e6ec0c52af82bc9488","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plotly/documentation","description":"The raw documentation examples as used in Plotly's official docs","fork":false,"url":"https://api.github.com/repos/plotly/documentation","forks_url":"https://api.github.com/repos/plotly/documentation/forks","keys_url":"https://api.github.com/repos/plotly/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plotly/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plotly/documentation/teams","hooks_url":"https://api.github.com/repos/plotly/documentation/hooks","issue_events_url":"https://api.github.com/repos/plotly/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/plotly/documentation/events","assignees_url":"https://api.github.com/repos/plotly/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/plotly/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/plotly/documentation/tags","blobs_url":"https://api.github.com/repos/plotly/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plotly/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plotly/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/plotly/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plotly/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/plotly/documentation/languages","stargazers_url":"https://api.github.com/repos/plotly/documentation/stargazers","contributors_url":"https://api.github.com/repos/plotly/documentation/contributors","subscribers_url":"https://api.github.com/repos/plotly/documentation/subscribers","subscription_url":"https://api.github.com/repos/plotly/documentation/subscription","commits_url":"https://api.github.com/repos/plotly/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/plotly/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/plotly/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/plotly/documentation/issues/comments/{number}","contents_url":"https://api.github.com/repos/plotly/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/plotly/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plotly/documentation/merges","archive_url":"https://api.github.com/repos/plotly/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plotly/documentation/downloads","issues_url":"https://api.github.com/repos/plotly/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/plotly/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/plotly/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/plotly/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plotly/documentation/labels{/name}","releases_url":"https://api.github.com/repos/plotly/documentation/releases{/id}","created_at":"2014-04-21T16:00:46Z","updated_at":"2014-07-16T20:29:40Z","pushed_at":"2014-08-13T02:03:59Z","git_url":"git://github.com/plotly/documentation.git","ssh_url":"git@github.com:plotly/documentation.git","clone_url":"https://github.com/plotly/documentation.git","svn_url":"https://github.com/plotly/documentation","homepage":"https://plot.ly/api","size":26289,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":9,"default_branch":"master"}},"base":{"label":"plotly:master","ref":"master","sha":"09acf6cc3c9fedb3625875e9cb95193cd1635dea","user":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=2","gravatar_id":"539b3403d351d8e6ec0c52af82bc9488","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"repo":{"id":18997629,"name":"documentation","full_name":"plotly/documentation","owner":{"login":"plotly","id":5997976,"avatar_url":"https://avatars.githubusercontent.com/u/5997976?v=2","gravatar_id":"539b3403d351d8e6ec0c52af82bc9488","url":"https://api.github.com/users/plotly","html_url":"https://github.com/plotly","followers_url":"https://api.github.com/users/plotly/followers","following_url":"https://api.github.com/users/plotly/following{/other_user}","gists_url":"https://api.github.com/users/plotly/gists{/gist_id}","starred_url":"https://api.github.com/users/plotly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plotly/subscriptions","organizations_url":"https://api.github.com/users/plotly/orgs","repos_url":"https://api.github.com/users/plotly/repos","events_url":"https://api.github.com/users/plotly/events{/privacy}","received_events_url":"https://api.github.com/users/plotly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/plotly/documentation","description":"The raw documentation examples as used in Plotly's official docs","fork":false,"url":"https://api.github.com/repos/plotly/documentation","forks_url":"https://api.github.com/repos/plotly/documentation/forks","keys_url":"https://api.github.com/repos/plotly/documentation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/plotly/documentation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/plotly/documentation/teams","hooks_url":"https://api.github.com/repos/plotly/documentation/hooks","issue_events_url":"https://api.github.com/repos/plotly/documentation/issues/events{/number}","events_url":"https://api.github.com/repos/plotly/documentation/events","assignees_url":"https://api.github.com/repos/plotly/documentation/assignees{/user}","branches_url":"https://api.github.com/repos/plotly/documentation/branches{/branch}","tags_url":"https://api.github.com/repos/plotly/documentation/tags","blobs_url":"https://api.github.com/repos/plotly/documentation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/plotly/documentation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/plotly/documentation/git/refs{/sha}","trees_url":"https://api.github.com/repos/plotly/documentation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/plotly/documentation/statuses/{sha}","languages_url":"https://api.github.com/repos/plotly/documentation/languages","stargazers_url":"https://api.github.com/repos/plotly/documentation/stargazers","contributors_url":"https://api.github.com/repos/plotly/documentation/contributors","subscribers_url":"https://api.github.com/repos/plotly/documentation/subscribers","subscription_url":"https://api.github.com/repos/plotly/documentation/subscription","commits_url":"https://api.github.com/repos/plotly/documentation/commits{/sha}","git_commits_url":"https://api.github.com/repos/plotly/documentation/git/commits{/sha}","comments_url":"https://api.github.com/repos/plotly/documentation/comments{/number}","issue_comment_url":"https://api.github.com/repos/plotly/documentation/issues/comments/{number}","contents_url":"https://api.github.com/repos/plotly/documentation/contents/{+path}","compare_url":"https://api.github.com/repos/plotly/documentation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/plotly/documentation/merges","archive_url":"https://api.github.com/repos/plotly/documentation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/plotly/documentation/downloads","issues_url":"https://api.github.com/repos/plotly/documentation/issues{/number}","pulls_url":"https://api.github.com/repos/plotly/documentation/pulls{/number}","milestones_url":"https://api.github.com/repos/plotly/documentation/milestones{/number}","notifications_url":"https://api.github.com/repos/plotly/documentation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/plotly/documentation/labels{/name}","releases_url":"https://api.github.com/repos/plotly/documentation/releases{/id}","created_at":"2014-04-21T16:00:46Z","updated_at":"2014-07-16T20:29:40Z","pushed_at":"2014-08-13T02:03:59Z","git_url":"git://github.com/plotly/documentation.git","ssh_url":"git@github.com:plotly/documentation.git","clone_url":"https://github.com/plotly/documentation.git","svn_url":"https://github.com/plotly/documentation","homepage":"https://plot.ly/api","size":26289,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/plotly/documentation/pulls/27"},"html":{"href":"https://github.com/plotly/documentation/pull/27"},"issue":{"href":"https://api.github.com/repos/plotly/documentation/issues/27"},"comments":{"href":"https://api.github.com/repos/plotly/documentation/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/plotly/documentation/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/plotly/documentation/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/plotly/documentation/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/plotly/documentation/statuses/5051770c4a1e6c54ff8a273bc94ce9759003a2ae"}}}}