{"action":"created","comment":{"url":"https://api.github.com/repos/innovia/training-exercise/pulls/comments/68498242","id":68498242,"diff_hunk":"@@ -0,0 +1,34 @@\n+# Copyright (c) 2016 Ami . All rights reserved\n+\n+import os\n+\n+def find_files_in_folder(path, extention, file_max_size):\n+    file_list = []\n+\n+    for current_folder, subfolders, file_names in os.walk(path):\n+        for file_name in file_names:\n+            full_path = os.path.abspath(os.path.join(current_folder, file_name))\n+            file_size = os.path.getsize(full_path)\n+\n+            if file_name.lower().endswith(extention) and file_size < file_max_size:\n+                file_list.append(full_path)\n+\n+    return file_list\n+\n+def main():\n+    folder = './little pics'\n+    full_path = os.path.abspath(folder)\n+\n+    if not os.path.exists(full_path):\n+        print(\"Could not find the folder at \" + full_path)\n+        exit(1)\n+\n+    file_list = find_files_in_folder(path=folder, extention='jpg', file_max_size=2000)\n+\n+    if file_list:\n+        for file_name in file_list:\n+            print(\"Deleting {}...\".format(file_name))\n+            os.remove(full_path)\n+\n+if __name__ == '__main__':","path":"06-files-input-and-output/remove_files.py","position":33,"original_position":33,"commit_id":"fd36f6b4b942200294a469c318c982151c87ef52","original_commit_id":"fd36f6b4b942200294a469c318c982151c87ef52","user":{"login":"innovia","id":112025,"avatar_url":"https://avatars.githubusercontent.com/u/112025?v=3","gravatar_id":"","url":"https://api.github.com/users/innovia","html_url":"https://github.com/innovia","followers_url":"https://api.github.com/users/innovia/followers","following_url":"https://api.github.com/users/innovia/following{/other_user}","gists_url":"https://api.github.com/users/innovia/gists{/gist_id}","starred_url":"https://api.github.com/users/innovia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/innovia/subscriptions","organizations_url":"https://api.github.com/users/innovia/orgs","repos_url":"https://api.github.com/users/innovia/repos","events_url":"https://api.github.com/users/innovia/events{/privacy}","received_events_url":"https://api.github.com/users/innovia/received_events","type":"User","site_admin":false},"body":"This one is the auto complete from pycharm, i'll fix that snippet","created_at":"2016-06-26T06:19:04Z","updated_at":"2016-06-26T06:19:04Z","html_url":"https://github.com/innovia/training-exercise/pull/9#discussion_r68498242","pull_request_url":"https://api.github.com/repos/innovia/training-exercise/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/innovia/training-exercise/pulls/comments/68498242"},"html":{"href":"https://github.com/innovia/training-exercise/pull/9#discussion_r68498242"},"pull_request":{"href":"https://api.github.com/repos/innovia/training-exercise/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/innovia/training-exercise/pulls/9","id":74925908,"html_url":"https://github.com/innovia/training-exercise/pull/9","diff_url":"https://github.com/innovia/training-exercise/pull/9.diff","patch_url":"https://github.com/innovia/training-exercise/pull/9.patch","issue_url":"https://api.github.com/repos/innovia/training-exercise/issues/9","number":9,"state":"open","locked":false,"title":"[master] 06 files input and output - remove files smaller than 2000","user":{"login":"innovia","id":112025,"avatar_url":"https://avatars.githubusercontent.com/u/112025?v=3","gravatar_id":"","url":"https://api.github.com/users/innovia","html_url":"https://github.com/innovia","followers_url":"https://api.github.com/users/innovia/followers","following_url":"https://api.github.com/users/innovia/following{/other_user}","gists_url":"https://api.github.com/users/innovia/gists{/gist_id}","starred_url":"https://api.github.com/users/innovia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/innovia/subscriptions","organizations_url":"https://api.github.com/users/innovia/orgs","repos_url":"https://api.github.com/users/innovia/repos","events_url":"https://api.github.com/users/innovia/events{/privacy}","received_events_url":"https://api.github.com/users/innovia/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-23T09:51:56Z","updated_at":"2016-06-26T06:19:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c15419c69d070ee91f1d01a8bd491d4061a8dc2d","assignee":{"login":"boarik","id":4247190,"avatar_url":"https://avatars.githubusercontent.com/u/4247190?v=3","gravatar_id":"","url":"https://api.github.com/users/boarik","html_url":"https://github.com/boarik","followers_url":"https://api.github.com/users/boarik/followers","following_url":"https://api.github.com/users/boarik/following{/other_user}","gists_url":"https://api.github.com/users/boarik/gists{/gist_id}","starred_url":"https://api.github.com/users/boarik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boarik/subscriptions","organizations_url":"https://api.github.com/users/boarik/orgs","repos_url":"https://api.github.com/users/boarik/repos","events_url":"https://api.github.com/users/boarik/events{/privacy}","received_events_url":"https://api.github.com/users/boarik/received_events","type":"User","site_admin":false},"assignees":[{"login":"boarik","id":4247190,"avatar_url":"https://avatars.githubusercontent.com/u/4247190?v=3","gravatar_id":"","url":"https://api.github.com/users/boarik","html_url":"https://github.com/boarik","followers_url":"https://api.github.com/users/boarik/followers","following_url":"https://api.github.com/users/boarik/following{/other_user}","gists_url":"https://api.github.com/users/boarik/gists{/gist_id}","starred_url":"https://api.github.com/users/boarik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boarik/subscriptions","organizations_url":"https://api.github.com/users/boarik/orgs","repos_url":"https://api.github.com/users/boarik/repos","events_url":"https://api.github.com/users/boarik/events{/privacy}","received_events_url":"https://api.github.com/users/boarik/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/innovia/training-exercise/pulls/9/commits","review_comments_url":"https://api.github.com/repos/innovia/training-exercise/pulls/9/comments","review_comment_url":"https://api.github.com/repos/innovia/training-exercise/pulls/comments{/number}","comments_url":"https://api.github.com/repos/innovia/training-exercise/issues/9/comments","statuses_url":"https://api.github.com/repos/innovia/training-exercise/statuses/fd36f6b4b942200294a469c318c982151c87ef52","head":{"label":"innovia:06-files-input-and-output","ref":"06-files-input-and-output","sha":"fd36f6b4b942200294a469c318c982151c87ef52","user":{"login":"innovia","id":112025,"avatar_url":"https://avatars.githubusercontent.com/u/112025?v=3","gravatar_id":"","url":"https://api.github.com/users/innovia","html_url":"https://github.com/innovia","followers_url":"https://api.github.com/users/innovia/followers","following_url":"https://api.github.com/users/innovia/following{/other_user}","gists_url":"https://api.github.com/users/innovia/gists{/gist_id}","starred_url":"https://api.github.com/users/innovia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/innovia/subscriptions","organizations_url":"https://api.github.com/users/innovia/orgs","repos_url":"https://api.github.com/users/innovia/repos","events_url":"https://api.github.com/users/innovia/events{/privacy}","received_events_url":"https://api.github.com/users/innovia/received_events","type":"User","site_admin":false},"repo":{"id":61481262,"name":"training-exercise","full_name":"innovia/training-exercise","owner":{"login":"innovia","id":112025,"avatar_url":"https://avatars.githubusercontent.com/u/112025?v=3","gravatar_id":"","url":"https://api.github.com/users/innovia","html_url":"https://github.com/innovia","followers_url":"https://api.github.com/users/innovia/followers","following_url":"https://api.github.com/users/innovia/following{/other_user}","gists_url":"https://api.github.com/users/innovia/gists{/gist_id}","starred_url":"https://api.github.com/users/innovia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/innovia/subscriptions","organizations_url":"https://api.github.com/users/innovia/orgs","repos_url":"https://api.github.com/users/innovia/repos","events_url":"https://api.github.com/users/innovia/events{/privacy}","received_events_url":"https://api.github.com/users/innovia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/innovia/training-exercise","description":"","fork":false,"url":"https://api.github.com/repos/innovia/training-exercise","forks_url":"https://api.github.com/repos/innovia/training-exercise/forks","keys_url":"https://api.github.com/repos/innovia/training-exercise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/innovia/training-exercise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/innovia/training-exercise/teams","hooks_url":"https://api.github.com/repos/innovia/training-exercise/hooks","issue_events_url":"https://api.github.com/repos/innovia/training-exercise/issues/events{/number}","events_url":"https://api.github.com/repos/innovia/training-exercise/events","assignees_url":"https://api.github.com/repos/innovia/training-exercise/assignees{/user}","branches_url":"https://api.github.com/repos/innovia/training-exercise/branches{/branch}","tags_url":"https://api.github.com/repos/innovia/training-exercise/tags","blobs_url":"https://api.github.com/repos/innovia/training-exercise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/innovia/training-exercise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/innovia/training-exercise/git/refs{/sha}","trees_url":"https://api.github.com/repos/innovia/training-exercise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/innovia/training-exercise/statuses/{sha}","languages_url":"https://api.github.com/repos/innovia/training-exercise/languages","stargazers_url":"https://api.github.com/repos/innovia/training-exercise/stargazers","contributors_url":"https://api.github.com/repos/innovia/training-exercise/contributors","subscribers_url":"https://api.github.com/repos/innovia/training-exercise/subscribers","subscription_url":"https://api.github.com/repos/innovia/training-exercise/subscription","commits_url":"https://api.github.com/repos/innovia/training-exercise/commits{/sha}","git_commits_url":"https://api.github.com/repos/innovia/training-exercise/git/commits{/sha}","comments_url":"https://api.github.com/repos/innovia/training-exercise/comments{/number}","issue_comment_url":"https://api.github.com/repos/innovia/training-exercise/issues/comments{/number}","contents_url":"https://api.github.com/repos/innovia/training-exercise/contents/{+path}","compare_url":"https://api.github.com/repos/innovia/training-exercise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/innovia/training-exercise/merges","archive_url":"https://api.github.com/repos/innovia/training-exercise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/innovia/training-exercise/downloads","issues_url":"https://api.github.com/repos/innovia/training-exercise/issues{/number}","pulls_url":"https://api.github.com/repos/innovia/training-exercise/pulls{/number}","milestones_url":"https://api.github.com/repos/innovia/training-exercise/milestones{/number}","notifications_url":"https://api.github.com/repos/innovia/training-exercise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/innovia/training-exercise/labels{/name}","releases_url":"https://api.github.com/repos/innovia/training-exercise/releases{/id}","deployments_url":"https://api.github.com/repos/innovia/training-exercise/deployments","created_at":"2016-06-19T13:21:38Z","updated_at":"2016-06-20T12:42:49Z","pushed_at":"2016-06-26T06:01:10Z","git_url":"git://github.com/innovia/training-exercise.git","ssh_url":"git@github.com:innovia/training-exercise.git","clone_url":"https://github.com/innovia/training-exercise.git","svn_url":"https://github.com/innovia/training-exercise","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"innovia:master","ref":"master","sha":"9a4501b93c07b00a19560cc325f2191bb2a2b304","user":{"login":"innovia","id":112025,"avatar_url":"https://avatars.githubusercontent.com/u/112025?v=3","gravatar_id":"","url":"https://api.github.com/users/innovia","html_url":"https://github.com/innovia","followers_url":"https://api.github.com/users/innovia/followers","following_url":"https://api.github.com/users/innovia/following{/other_user}","gists_url":"https://api.github.com/users/innovia/gists{/gist_id}","starred_url":"https://api.github.com/users/innovia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/innovia/subscriptions","organizations_url":"https://api.github.com/users/innovia/orgs","repos_url":"https://api.github.com/users/innovia/repos","events_url":"https://api.github.com/users/innovia/events{/privacy}","received_events_url":"https://api.github.com/users/innovia/received_events","type":"User","site_admin":false},"repo":{"id":61481262,"name":"training-exercise","full_name":"innovia/training-exercise","owner":{"login":"innovia","id":112025,"avatar_url":"https://avatars.githubusercontent.com/u/112025?v=3","gravatar_id":"","url":"https://api.github.com/users/innovia","html_url":"https://github.com/innovia","followers_url":"https://api.github.com/users/innovia/followers","following_url":"https://api.github.com/users/innovia/following{/other_user}","gists_url":"https://api.github.com/users/innovia/gists{/gist_id}","starred_url":"https://api.github.com/users/innovia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/innovia/subscriptions","organizations_url":"https://api.github.com/users/innovia/orgs","repos_url":"https://api.github.com/users/innovia/repos","events_url":"https://api.github.com/users/innovia/events{/privacy}","received_events_url":"https://api.github.com/users/innovia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/innovia/training-exercise","description":"","fork":false,"url":"https://api.github.com/repos/innovia/training-exercise","forks_url":"https://api.github.com/repos/innovia/training-exercise/forks","keys_url":"https://api.github.com/repos/innovia/training-exercise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/innovia/training-exercise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/innovia/training-exercise/teams","hooks_url":"https://api.github.com/repos/innovia/training-exercise/hooks","issue_events_url":"https://api.github.com/repos/innovia/training-exercise/issues/events{/number}","events_url":"https://api.github.com/repos/innovia/training-exercise/events","assignees_url":"https://api.github.com/repos/innovia/training-exercise/assignees{/user}","branches_url":"https://api.github.com/repos/innovia/training-exercise/branches{/branch}","tags_url":"https://api.github.com/repos/innovia/training-exercise/tags","blobs_url":"https://api.github.com/repos/innovia/training-exercise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/innovia/training-exercise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/innovia/training-exercise/git/refs{/sha}","trees_url":"https://api.github.com/repos/innovia/training-exercise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/innovia/training-exercise/statuses/{sha}","languages_url":"https://api.github.com/repos/innovia/training-exercise/languages","stargazers_url":"https://api.github.com/repos/innovia/training-exercise/stargazers","contributors_url":"https://api.github.com/repos/innovia/training-exercise/contributors","subscribers_url":"https://api.github.com/repos/innovia/training-exercise/subscribers","subscription_url":"https://api.github.com/repos/innovia/training-exercise/subscription","commits_url":"https://api.github.com/repos/innovia/training-exercise/commits{/sha}","git_commits_url":"https://api.github.com/repos/innovia/training-exercise/git/commits{/sha}","comments_url":"https://api.github.com/repos/innovia/training-exercise/comments{/number}","issue_comment_url":"https://api.github.com/repos/innovia/training-exercise/issues/comments{/number}","contents_url":"https://api.github.com/repos/innovia/training-exercise/contents/{+path}","compare_url":"https://api.github.com/repos/innovia/training-exercise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/innovia/training-exercise/merges","archive_url":"https://api.github.com/repos/innovia/training-exercise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/innovia/training-exercise/downloads","issues_url":"https://api.github.com/repos/innovia/training-exercise/issues{/number}","pulls_url":"https://api.github.com/repos/innovia/training-exercise/pulls{/number}","milestones_url":"https://api.github.com/repos/innovia/training-exercise/milestones{/number}","notifications_url":"https://api.github.com/repos/innovia/training-exercise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/innovia/training-exercise/labels{/name}","releases_url":"https://api.github.com/repos/innovia/training-exercise/releases{/id}","deployments_url":"https://api.github.com/repos/innovia/training-exercise/deployments","created_at":"2016-06-19T13:21:38Z","updated_at":"2016-06-20T12:42:49Z","pushed_at":"2016-06-26T06:01:10Z","git_url":"git://github.com/innovia/training-exercise.git","ssh_url":"git@github.com:innovia/training-exercise.git","clone_url":"https://github.com/innovia/training-exercise.git","svn_url":"https://github.com/innovia/training-exercise","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/innovia/training-exercise/pulls/9"},"html":{"href":"https://github.com/innovia/training-exercise/pull/9"},"issue":{"href":"https://api.github.com/repos/innovia/training-exercise/issues/9"},"comments":{"href":"https://api.github.com/repos/innovia/training-exercise/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/innovia/training-exercise/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/innovia/training-exercise/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/innovia/training-exercise/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/innovia/training-exercise/statuses/fd36f6b4b942200294a469c318c982151c87ef52"}}}}
{"actor":{"display_login":"innovia"}}