{"action":"created","comment":{"url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/comments/69019956","id":69019956,"diff_hunk":"@@ -0,0 +1,79 @@\n+import glob\n+import os\n+import re\n+import shutil\n+import sys\n+\n+# inserting path here so the following imports work wherever you run the script\n+# in coala-bears\n+sys.path.insert(0, '..')\n+\n+from coalib.collecting.Importers import iimport_objects\n+from string import Template\n+\n+\n+def create_directory(folder_name):\n+    \"\"\"\n+    Checks if the folder exists, and creates it if it doesn't.\n+\n+    :param name: The directory name.\n+    \"\"\"\n+    if not os.path.exists(folder_name):\n+        os.mkdir(folder_name)\n+\n+\n+def create_empty_file(file_name):\n+    \"\"\"\n+    Creates an empty file.\n+\n+    :param file_name: Name of the file.\n+    \"\"\"\n+    if not os.path.exists(file_name):\n+        open(file_name, 'w').close()\n+\n+\n+def main():\n+    create_directory('upload')\n+\n+    bears_full_filenames = glob.glob('**/*Bear.py')\n+\n+    for bear_file_name in bears_full_filenames:\n+        file_name = bear_file_name\n+        bear_name = re.match(r'.+/(.*)\\.py', bear_file_name).group(1)\n+        bear_object = list(iimport_objects(file_name, attributes='kind',","path":"bears/uploadTool.py","position":43,"original_position":43,"commit_id":"6c08ccf0960f061f64683d94f69e528ae9c14127","original_commit_id":"6c08ccf0960f061f64683d94f69e528ae9c14127","user":{"login":"justuswilhelm","id":1641042,"avatar_url":"https://avatars.githubusercontent.com/u/1641042?v=3","gravatar_id":"","url":"https://api.github.com/users/justuswilhelm","html_url":"https://github.com/justuswilhelm","followers_url":"https://api.github.com/users/justuswilhelm/followers","following_url":"https://api.github.com/users/justuswilhelm/following{/other_user}","gists_url":"https://api.github.com/users/justuswilhelm/gists{/gist_id}","starred_url":"https://api.github.com/users/justuswilhelm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justuswilhelm/subscriptions","organizations_url":"https://api.github.com/users/justuswilhelm/orgs","repos_url":"https://api.github.com/users/justuswilhelm/repos","events_url":"https://api.github.com/users/justuswilhelm/events{/privacy}","received_events_url":"https://api.github.com/users/justuswilhelm/received_events","type":"User","site_admin":false},"body":"py magic: use next( to retrieve entry 0 without building a list","created_at":"2016-06-29T20:22:59Z","updated_at":"2016-06-29T20:22:59Z","html_url":"https://github.com/coala-analyzer/coala-bears/pull/561#discussion_r69019956","pull_request_url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561","_links":{"self":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/comments/69019956"},"html":{"href":"https://github.com/coala-analyzer/coala-bears/pull/561#discussion_r69019956"},"pull_request":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561"}}},"pull_request":{"url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561","id":75467399,"html_url":"https://github.com/coala-analyzer/coala-bears/pull/561","diff_url":"https://github.com/coala-analyzer/coala-bears/pull/561.diff","patch_url":"https://github.com/coala-analyzer/coala-bears/pull/561.patch","issue_url":"https://api.github.com/repos/coala-analyzer/coala-bears/issues/561","number":561,"state":"open","locked":false,"title":"uploadTool: Add it","user":{"login":"Adrianzatreanu","id":15572459,"avatar_url":"https://avatars.githubusercontent.com/u/15572459?v=3","gravatar_id":"","url":"https://api.github.com/users/Adrianzatreanu","html_url":"https://github.com/Adrianzatreanu","followers_url":"https://api.github.com/users/Adrianzatreanu/followers","following_url":"https://api.github.com/users/Adrianzatreanu/following{/other_user}","gists_url":"https://api.github.com/users/Adrianzatreanu/gists{/gist_id}","starred_url":"https://api.github.com/users/Adrianzatreanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adrianzatreanu/subscriptions","organizations_url":"https://api.github.com/users/Adrianzatreanu/orgs","repos_url":"https://api.github.com/users/Adrianzatreanu/repos","events_url":"https://api.github.com/users/Adrianzatreanu/events{/privacy}","received_events_url":"https://api.github.com/users/Adrianzatreanu/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-28T12:21:38Z","updated_at":"2016-06-29T20:22:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"973bcc4808151270cbf5f47819a16ebfc5bb579f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561/commits","review_comments_url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561/comments","review_comment_url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coala-analyzer/coala-bears/issues/561/comments","statuses_url":"https://api.github.com/repos/coala-analyzer/coala-bears/statuses/6c08ccf0960f061f64683d94f69e528ae9c14127","head":{"label":"Adrianzatreanu:uploadTool","ref":"uploadTool","sha":"6c08ccf0960f061f64683d94f69e528ae9c14127","user":{"login":"Adrianzatreanu","id":15572459,"avatar_url":"https://avatars.githubusercontent.com/u/15572459?v=3","gravatar_id":"","url":"https://api.github.com/users/Adrianzatreanu","html_url":"https://github.com/Adrianzatreanu","followers_url":"https://api.github.com/users/Adrianzatreanu/followers","following_url":"https://api.github.com/users/Adrianzatreanu/following{/other_user}","gists_url":"https://api.github.com/users/Adrianzatreanu/gists{/gist_id}","starred_url":"https://api.github.com/users/Adrianzatreanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adrianzatreanu/subscriptions","organizations_url":"https://api.github.com/users/Adrianzatreanu/orgs","repos_url":"https://api.github.com/users/Adrianzatreanu/repos","events_url":"https://api.github.com/users/Adrianzatreanu/events{/privacy}","received_events_url":"https://api.github.com/users/Adrianzatreanu/received_events","type":"User","site_admin":false},"repo":{"id":52351313,"name":"coala-bears","full_name":"Adrianzatreanu/coala-bears","owner":{"login":"Adrianzatreanu","id":15572459,"avatar_url":"https://avatars.githubusercontent.com/u/15572459?v=3","gravatar_id":"","url":"https://api.github.com/users/Adrianzatreanu","html_url":"https://github.com/Adrianzatreanu","followers_url":"https://api.github.com/users/Adrianzatreanu/followers","following_url":"https://api.github.com/users/Adrianzatreanu/following{/other_user}","gists_url":"https://api.github.com/users/Adrianzatreanu/gists{/gist_id}","starred_url":"https://api.github.com/users/Adrianzatreanu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adrianzatreanu/subscriptions","organizations_url":"https://api.github.com/users/Adrianzatreanu/orgs","repos_url":"https://api.github.com/users/Adrianzatreanu/repos","events_url":"https://api.github.com/users/Adrianzatreanu/events{/privacy}","received_events_url":"https://api.github.com/users/Adrianzatreanu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Adrianzatreanu/coala-bears","description":"Bears for coala","fork":true,"url":"https://api.github.com/repos/Adrianzatreanu/coala-bears","forks_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/forks","keys_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/teams","hooks_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/hooks","issue_events_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/issues/events{/number}","events_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/events","assignees_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/assignees{/user}","branches_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/branches{/branch}","tags_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/tags","blobs_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/git/refs{/sha}","trees_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/statuses/{sha}","languages_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/languages","stargazers_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/stargazers","contributors_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/contributors","subscribers_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/subscribers","subscription_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/subscription","commits_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/commits{/sha}","git_commits_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/git/commits{/sha}","comments_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/comments{/number}","issue_comment_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/issues/comments{/number}","contents_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/contents/{+path}","compare_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/merges","archive_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/downloads","issues_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/issues{/number}","pulls_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/pulls{/number}","milestones_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/milestones{/number}","notifications_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/labels{/name}","releases_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/releases{/id}","deployments_url":"https://api.github.com/repos/Adrianzatreanu/coala-bears/deployments","created_at":"2016-02-23T10:36:15Z","updated_at":"2016-02-23T10:36:16Z","pushed_at":"2016-06-29T19:17:58Z","git_url":"git://github.com/Adrianzatreanu/coala-bears.git","ssh_url":"git@github.com:Adrianzatreanu/coala-bears.git","clone_url":"https://github.com/Adrianzatreanu/coala-bears.git","svn_url":"https://github.com/Adrianzatreanu/coala-bears","homepage":"http://coala-analyzer.org/","size":623,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"coala-analyzer:master","ref":"master","sha":"ed6c195d3d5e4b000e11cfcd8fcd28b4cb1caa1e","user":{"login":"coala-analyzer","id":10620750,"avatar_url":"https://avatars.githubusercontent.com/u/10620750?v=3","gravatar_id":"","url":"https://api.github.com/users/coala-analyzer","html_url":"https://github.com/coala-analyzer","followers_url":"https://api.github.com/users/coala-analyzer/followers","following_url":"https://api.github.com/users/coala-analyzer/following{/other_user}","gists_url":"https://api.github.com/users/coala-analyzer/gists{/gist_id}","starred_url":"https://api.github.com/users/coala-analyzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coala-analyzer/subscriptions","organizations_url":"https://api.github.com/users/coala-analyzer/orgs","repos_url":"https://api.github.com/users/coala-analyzer/repos","events_url":"https://api.github.com/users/coala-analyzer/events{/privacy}","received_events_url":"https://api.github.com/users/coala-analyzer/received_events","type":"Organization","site_admin":false},"repo":{"id":51688289,"name":"coala-bears","full_name":"coala-analyzer/coala-bears","owner":{"login":"coala-analyzer","id":10620750,"avatar_url":"https://avatars.githubusercontent.com/u/10620750?v=3","gravatar_id":"","url":"https://api.github.com/users/coala-analyzer","html_url":"https://github.com/coala-analyzer","followers_url":"https://api.github.com/users/coala-analyzer/followers","following_url":"https://api.github.com/users/coala-analyzer/following{/other_user}","gists_url":"https://api.github.com/users/coala-analyzer/gists{/gist_id}","starred_url":"https://api.github.com/users/coala-analyzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coala-analyzer/subscriptions","organizations_url":"https://api.github.com/users/coala-analyzer/orgs","repos_url":"https://api.github.com/users/coala-analyzer/repos","events_url":"https://api.github.com/users/coala-analyzer/events{/privacy}","received_events_url":"https://api.github.com/users/coala-analyzer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coala-analyzer/coala-bears","description":"Bears for coala","fork":false,"url":"https://api.github.com/repos/coala-analyzer/coala-bears","forks_url":"https://api.github.com/repos/coala-analyzer/coala-bears/forks","keys_url":"https://api.github.com/repos/coala-analyzer/coala-bears/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coala-analyzer/coala-bears/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coala-analyzer/coala-bears/teams","hooks_url":"https://api.github.com/repos/coala-analyzer/coala-bears/hooks","issue_events_url":"https://api.github.com/repos/coala-analyzer/coala-bears/issues/events{/number}","events_url":"https://api.github.com/repos/coala-analyzer/coala-bears/events","assignees_url":"https://api.github.com/repos/coala-analyzer/coala-bears/assignees{/user}","branches_url":"https://api.github.com/repos/coala-analyzer/coala-bears/branches{/branch}","tags_url":"https://api.github.com/repos/coala-analyzer/coala-bears/tags","blobs_url":"https://api.github.com/repos/coala-analyzer/coala-bears/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coala-analyzer/coala-bears/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coala-analyzer/coala-bears/git/refs{/sha}","trees_url":"https://api.github.com/repos/coala-analyzer/coala-bears/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coala-analyzer/coala-bears/statuses/{sha}","languages_url":"https://api.github.com/repos/coala-analyzer/coala-bears/languages","stargazers_url":"https://api.github.com/repos/coala-analyzer/coala-bears/stargazers","contributors_url":"https://api.github.com/repos/coala-analyzer/coala-bears/contributors","subscribers_url":"https://api.github.com/repos/coala-analyzer/coala-bears/subscribers","subscription_url":"https://api.github.com/repos/coala-analyzer/coala-bears/subscription","commits_url":"https://api.github.com/repos/coala-analyzer/coala-bears/commits{/sha}","git_commits_url":"https://api.github.com/repos/coala-analyzer/coala-bears/git/commits{/sha}","comments_url":"https://api.github.com/repos/coala-analyzer/coala-bears/comments{/number}","issue_comment_url":"https://api.github.com/repos/coala-analyzer/coala-bears/issues/comments{/number}","contents_url":"https://api.github.com/repos/coala-analyzer/coala-bears/contents/{+path}","compare_url":"https://api.github.com/repos/coala-analyzer/coala-bears/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coala-analyzer/coala-bears/merges","archive_url":"https://api.github.com/repos/coala-analyzer/coala-bears/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coala-analyzer/coala-bears/downloads","issues_url":"https://api.github.com/repos/coala-analyzer/coala-bears/issues{/number}","pulls_url":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls{/number}","milestones_url":"https://api.github.com/repos/coala-analyzer/coala-bears/milestones{/number}","notifications_url":"https://api.github.com/repos/coala-analyzer/coala-bears/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coala-analyzer/coala-bears/labels{/name}","releases_url":"https://api.github.com/repos/coala-analyzer/coala-bears/releases{/id}","deployments_url":"https://api.github.com/repos/coala-analyzer/coala-bears/deployments","created_at":"2016-02-14T09:25:11Z","updated_at":"2016-06-13T19:52:49Z","pushed_at":"2016-06-29T19:17:59Z","git_url":"git://github.com/coala-analyzer/coala-bears.git","ssh_url":"git@github.com:coala-analyzer/coala-bears.git","clone_url":"https://github.com/coala-analyzer/coala-bears.git","svn_url":"https://github.com/coala-analyzer/coala-bears","homepage":"http://coala-analyzer.org/","size":805,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":138,"forks":57,"open_issues":138,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561"},"html":{"href":"https://github.com/coala-analyzer/coala-bears/pull/561"},"issue":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/issues/561"},"comments":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/issues/561/comments"},"review_comments":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561/comments"},"review_comment":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/pulls/561/commits"},"statuses":{"href":"https://api.github.com/repos/coala-analyzer/coala-bears/statuses/6c08ccf0960f061f64683d94f69e528ae9c14127"}}}}
{"actor":{"display_login":"justuswilhelm"}}