{"action":"created","comment":{"url":"https://api.github.com/repos/Morriar/Missions/pulls/comments/75054289","id":75054289,"diff_hunk":"@@ -0,0 +1,202 @@\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+# Player's submission for Pep8 missions\n+#\n+# TODO: Pep8Term is crap software to install and to execute.\n+# Currently, this program assume the following:\n+#\n+# * `pep8` and `asem8` are in the PATH\n+# * `trap` and `pep8os.pepo` are in the current working directory\n+module submissions\n+\n+import missions\n+import players\n+import markdown\n+import poset\n+\n+redef class TestCase\n+\t# Try the test case on a `program`.\n+\tfun run(program: Program, i: Int): TestResult do\n+\t\tvar res = new TestResult(self, program)\n+\n+\t\t# We get a subdirectory (a testspace) for each test case\n+\t\tvar ws = program.workspace.as(not null)\n+\t\tvar tdir = \"test{i}\"\n+\t\tvar ts = ws / tdir\n+\t\tts.mkdir\n+\n+\t\t# Prepare the input/output\n+\t\tvar ifile = ts / \"input.txt\"\n+\t\tself.i.write_to_file(ifile)\n+\t\tvar ofile = ts / \"output.txt\"\n+\t\tvar sfile = ts / \"sav.txt\"\n+\t\tself.o.write_to_file(sfile)\n+\n+\t\t# Prepare the execution command\n+\t\t# Because `pep8` is interactive.\n+\t\tvar canned_command = \"\"\"\n+l\n+source\n+i\n+f\n+{{{tdir}}}/input.txt\n+o\n+f\n+{{{tdir}}}/output.txt\n+x\n+q\n+\"\"\"\n+\t\tcanned_command.write_to_file(ts/\"canned_command\")\n+\n+\t\t# Try to execute the program on the test input\n+\t\t# TODO: some time/space limit!","path":"src/model/submissions.nit","position":62,"original_position":62,"commit_id":"baf2acfb1d668d4cc7fdac908b4322eaf5e8553a","original_commit_id":"baf2acfb1d668d4cc7fdac908b4322eaf5e8553a","user":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"body":"and jail? do we assume that pop8 is safe?","created_at":"2016-08-17T02:28:55Z","updated_at":"2016-08-17T02:28:55Z","html_url":"https://github.com/Morriar/Missions/pull/26#discussion_r75054289","pull_request_url":"https://api.github.com/repos/Morriar/Missions/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/Morriar/Missions/pulls/comments/75054289"},"html":{"href":"https://github.com/Morriar/Missions/pull/26#discussion_r75054289"},"pull_request":{"href":"https://api.github.com/repos/Morriar/Missions/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/Morriar/Missions/pulls/26","id":81405032,"html_url":"https://github.com/Morriar/Missions/pull/26","diff_url":"https://github.com/Morriar/Missions/pull/26.diff","patch_url":"https://github.com/Morriar/Missions/pull/26.patch","issue_url":"https://api.github.com/repos/Morriar/Missions/issues/26","number":26,"state":"open","locked":false,"title":"RFC: model proposal for submission/testcases","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-16T02:14:40Z","updated_at":"2016-08-17T02:28:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78e1b53599bfebdd0e43a6f1302e9889ee87cffe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Morriar/Missions/pulls/26/commits","review_comments_url":"https://api.github.com/repos/Morriar/Missions/pulls/26/comments","review_comment_url":"https://api.github.com/repos/Morriar/Missions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Morriar/Missions/issues/26/comments","statuses_url":"https://api.github.com/repos/Morriar/Missions/statuses/baf2acfb1d668d4cc7fdac908b4322eaf5e8553a","head":{"label":"privat:testcases","ref":"testcases","sha":"baf2acfb1d668d4cc7fdac908b4322eaf5e8553a","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":65594617,"name":"Missions","full_name":"privat/Missions","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/Missions","description":null,"fork":true,"url":"https://api.github.com/repos/privat/Missions","forks_url":"https://api.github.com/repos/privat/Missions/forks","keys_url":"https://api.github.com/repos/privat/Missions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/Missions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/Missions/teams","hooks_url":"https://api.github.com/repos/privat/Missions/hooks","issue_events_url":"https://api.github.com/repos/privat/Missions/issues/events{/number}","events_url":"https://api.github.com/repos/privat/Missions/events","assignees_url":"https://api.github.com/repos/privat/Missions/assignees{/user}","branches_url":"https://api.github.com/repos/privat/Missions/branches{/branch}","tags_url":"https://api.github.com/repos/privat/Missions/tags","blobs_url":"https://api.github.com/repos/privat/Missions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/Missions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/Missions/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/Missions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/Missions/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/Missions/languages","stargazers_url":"https://api.github.com/repos/privat/Missions/stargazers","contributors_url":"https://api.github.com/repos/privat/Missions/contributors","subscribers_url":"https://api.github.com/repos/privat/Missions/subscribers","subscription_url":"https://api.github.com/repos/privat/Missions/subscription","commits_url":"https://api.github.com/repos/privat/Missions/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/Missions/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/Missions/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/Missions/issues/comments{/number}","contents_url":"https://api.github.com/repos/privat/Missions/contents/{+path}","compare_url":"https://api.github.com/repos/privat/Missions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/Missions/merges","archive_url":"https://api.github.com/repos/privat/Missions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/Missions/downloads","issues_url":"https://api.github.com/repos/privat/Missions/issues{/number}","pulls_url":"https://api.github.com/repos/privat/Missions/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/Missions/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/Missions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/Missions/labels{/name}","releases_url":"https://api.github.com/repos/privat/Missions/releases{/id}","deployments_url":"https://api.github.com/repos/privat/Missions/deployments","created_at":"2016-08-13T02:16:25Z","updated_at":"2016-08-13T02:16:26Z","pushed_at":"2016-08-17T02:15:32Z","git_url":"git://github.com/privat/Missions.git","ssh_url":"git@github.com:privat/Missions.git","clone_url":"https://github.com/privat/Missions.git","svn_url":"https://github.com/privat/Missions","homepage":null,"size":151,"stargazers_count":0,"watchers_count":0,"language":"Nit","has_issues":false,"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":"Morriar:master","ref":"master","sha":"76156762f50f28dda7d23b95c5162d72ad4fd178","user":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"repo":{"id":65479349,"name":"Missions","full_name":"Morriar/Missions","owner":{"login":"Morriar","id":583144,"avatar_url":"https://avatars.githubusercontent.com/u/583144?v=3","gravatar_id":"","url":"https://api.github.com/users/Morriar","html_url":"https://github.com/Morriar","followers_url":"https://api.github.com/users/Morriar/followers","following_url":"https://api.github.com/users/Morriar/following{/other_user}","gists_url":"https://api.github.com/users/Morriar/gists{/gist_id}","starred_url":"https://api.github.com/users/Morriar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morriar/subscriptions","organizations_url":"https://api.github.com/users/Morriar/orgs","repos_url":"https://api.github.com/users/Morriar/repos","events_url":"https://api.github.com/users/Morriar/events{/privacy}","received_events_url":"https://api.github.com/users/Morriar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Morriar/Missions","description":null,"fork":false,"url":"https://api.github.com/repos/Morriar/Missions","forks_url":"https://api.github.com/repos/Morriar/Missions/forks","keys_url":"https://api.github.com/repos/Morriar/Missions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Morriar/Missions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Morriar/Missions/teams","hooks_url":"https://api.github.com/repos/Morriar/Missions/hooks","issue_events_url":"https://api.github.com/repos/Morriar/Missions/issues/events{/number}","events_url":"https://api.github.com/repos/Morriar/Missions/events","assignees_url":"https://api.github.com/repos/Morriar/Missions/assignees{/user}","branches_url":"https://api.github.com/repos/Morriar/Missions/branches{/branch}","tags_url":"https://api.github.com/repos/Morriar/Missions/tags","blobs_url":"https://api.github.com/repos/Morriar/Missions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Morriar/Missions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Morriar/Missions/git/refs{/sha}","trees_url":"https://api.github.com/repos/Morriar/Missions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Morriar/Missions/statuses/{sha}","languages_url":"https://api.github.com/repos/Morriar/Missions/languages","stargazers_url":"https://api.github.com/repos/Morriar/Missions/stargazers","contributors_url":"https://api.github.com/repos/Morriar/Missions/contributors","subscribers_url":"https://api.github.com/repos/Morriar/Missions/subscribers","subscription_url":"https://api.github.com/repos/Morriar/Missions/subscription","commits_url":"https://api.github.com/repos/Morriar/Missions/commits{/sha}","git_commits_url":"https://api.github.com/repos/Morriar/Missions/git/commits{/sha}","comments_url":"https://api.github.com/repos/Morriar/Missions/comments{/number}","issue_comment_url":"https://api.github.com/repos/Morriar/Missions/issues/comments{/number}","contents_url":"https://api.github.com/repos/Morriar/Missions/contents/{+path}","compare_url":"https://api.github.com/repos/Morriar/Missions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Morriar/Missions/merges","archive_url":"https://api.github.com/repos/Morriar/Missions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Morriar/Missions/downloads","issues_url":"https://api.github.com/repos/Morriar/Missions/issues{/number}","pulls_url":"https://api.github.com/repos/Morriar/Missions/pulls{/number}","milestones_url":"https://api.github.com/repos/Morriar/Missions/milestones{/number}","notifications_url":"https://api.github.com/repos/Morriar/Missions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Morriar/Missions/labels{/name}","releases_url":"https://api.github.com/repos/Morriar/Missions/releases{/id}","deployments_url":"https://api.github.com/repos/Morriar/Missions/deployments","created_at":"2016-08-11T15:13:15Z","updated_at":"2016-08-12T23:11:47Z","pushed_at":"2016-08-17T02:15:33Z","git_url":"git://github.com/Morriar/Missions.git","ssh_url":"git@github.com:Morriar/Missions.git","clone_url":"https://github.com/Morriar/Missions.git","svn_url":"https://github.com/Morriar/Missions","homepage":null,"size":152,"stargazers_count":1,"watchers_count":1,"language":"Nit","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Morriar/Missions/pulls/26"},"html":{"href":"https://github.com/Morriar/Missions/pull/26"},"issue":{"href":"https://api.github.com/repos/Morriar/Missions/issues/26"},"comments":{"href":"https://api.github.com/repos/Morriar/Missions/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/Morriar/Missions/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/Morriar/Missions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Morriar/Missions/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/Morriar/Missions/statuses/baf2acfb1d668d4cc7fdac908b4322eaf5e8553a"}}}}
{"actor":{"display_login":"Morriar"}}