{"action":"created","comment":{"url":"https://api.github.com/repos/wdas/reposado/pulls/comments/60657235","id":60657235,"diff_hunk":"@@ -230,6 +230,24 @@ def print_stderr(msg, *args):\n         print >> sys.stderr, concat_message(msg, *args)\n \n \n+def humanReadable(size_in_bytes):\n+    \"\"\"Returns sizes in human-readable units.\"\"\"\n+    try:\n+        size_in_bytes = int(size_in_bytes)\n+    except ValueError:\n+        size_in_bytes = 0\n+    units = [(\" bytes\", 2**10, int),\n+             (\" KiB\", 2**20, float),\n+             (\" MiB\", 2**30, float),\n+             (\" GiB\", 2**40, float),\n+             (\" TiB\", 2**50, float)]\n+    for suffix, limit, cast_unit in units:\n+        if size_in_bytes > limit:\n+            continue\n+        else:\n+            return str(cast_unit(round(size_in_bytes/float(limit/2**10), 1))) + suffix\n+\n+","path":"code/reposadolib/reposadocommon.py","position":null,"original_position":21,"commit_id":"277417315ea2862bff16a6c61f22f787bc039d0f","original_commit_id":"8e642cf72b1687977cff5af1ed1faab9d949d160","user":{"login":"jessepeterson","id":694298,"avatar_url":"https://avatars.githubusercontent.com/u/694298?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepeterson","html_url":"https://github.com/jessepeterson","followers_url":"https://api.github.com/users/jessepeterson/followers","following_url":"https://api.github.com/users/jessepeterson/following{/other_user}","gists_url":"https://api.github.com/users/jessepeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepeterson/subscriptions","organizations_url":"https://api.github.com/users/jessepeterson/orgs","repos_url":"https://api.github.com/users/jessepeterson/repos","events_url":"https://api.github.com/users/jessepeterson/events{/privacy}","received_events_url":"https://api.github.com/users/jessepeterson/received_events","type":"User","site_admin":false},"body":"Well, I reverted the base and now use SI units (in the same format as before). Yay or nay? 😄 ","created_at":"2016-04-21T21:21:00Z","updated_at":"2016-04-21T21:21:00Z","html_url":"https://github.com/wdas/reposado/pull/48#discussion_r60657235","pull_request_url":"https://api.github.com/repos/wdas/reposado/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/wdas/reposado/pulls/comments/60657235"},"html":{"href":"https://github.com/wdas/reposado/pull/48#discussion_r60657235"},"pull_request":{"href":"https://api.github.com/repos/wdas/reposado/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/wdas/reposado/pulls/48","id":67308310,"html_url":"https://github.com/wdas/reposado/pull/48","diff_url":"https://github.com/wdas/reposado/pull/48.diff","patch_url":"https://github.com/wdas/reposado/pull/48.patch","issue_url":"https://api.github.com/repos/wdas/reposado/issues/48","number":48,"state":"open","locked":false,"title":"Add human-readable sizes option","user":{"login":"jessepeterson","id":694298,"avatar_url":"https://avatars.githubusercontent.com/u/694298?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepeterson","html_url":"https://github.com/jessepeterson","followers_url":"https://api.github.com/users/jessepeterson/followers","following_url":"https://api.github.com/users/jessepeterson/following{/other_user}","gists_url":"https://api.github.com/users/jessepeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepeterson/subscriptions","organizations_url":"https://api.github.com/users/jessepeterson/orgs","repos_url":"https://api.github.com/users/jessepeterson/repos","events_url":"https://api.github.com/users/jessepeterson/events{/privacy}","received_events_url":"https://api.github.com/users/jessepeterson/received_events","type":"User","site_admin":false},"body":"Implements #16","created_at":"2016-04-21T07:27:35Z","updated_at":"2016-04-21T21:21:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e183ee78cc95dcf1ddd8d5a51fc5a76e9bed4a3b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wdas/reposado/pulls/48/commits","review_comments_url":"https://api.github.com/repos/wdas/reposado/pulls/48/comments","review_comment_url":"https://api.github.com/repos/wdas/reposado/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wdas/reposado/issues/48/comments","statuses_url":"https://api.github.com/repos/wdas/reposado/statuses/277417315ea2862bff16a6c61f22f787bc039d0f","head":{"label":"jessepeterson:human-sizes","ref":"human-sizes","sha":"277417315ea2862bff16a6c61f22f787bc039d0f","user":{"login":"jessepeterson","id":694298,"avatar_url":"https://avatars.githubusercontent.com/u/694298?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepeterson","html_url":"https://github.com/jessepeterson","followers_url":"https://api.github.com/users/jessepeterson/followers","following_url":"https://api.github.com/users/jessepeterson/following{/other_user}","gists_url":"https://api.github.com/users/jessepeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepeterson/subscriptions","organizations_url":"https://api.github.com/users/jessepeterson/orgs","repos_url":"https://api.github.com/users/jessepeterson/repos","events_url":"https://api.github.com/users/jessepeterson/events{/privacy}","received_events_url":"https://api.github.com/users/jessepeterson/received_events","type":"User","site_admin":false},"repo":{"id":8666178,"name":"reposado","full_name":"jessepeterson/reposado","owner":{"login":"jessepeterson","id":694298,"avatar_url":"https://avatars.githubusercontent.com/u/694298?v=3","gravatar_id":"","url":"https://api.github.com/users/jessepeterson","html_url":"https://github.com/jessepeterson","followers_url":"https://api.github.com/users/jessepeterson/followers","following_url":"https://api.github.com/users/jessepeterson/following{/other_user}","gists_url":"https://api.github.com/users/jessepeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/jessepeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessepeterson/subscriptions","organizations_url":"https://api.github.com/users/jessepeterson/orgs","repos_url":"https://api.github.com/users/jessepeterson/repos","events_url":"https://api.github.com/users/jessepeterson/events{/privacy}","received_events_url":"https://api.github.com/users/jessepeterson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jessepeterson/reposado","description":"Host Apple Software Updates on the hardware and OS of your choice.","fork":true,"url":"https://api.github.com/repos/jessepeterson/reposado","forks_url":"https://api.github.com/repos/jessepeterson/reposado/forks","keys_url":"https://api.github.com/repos/jessepeterson/reposado/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jessepeterson/reposado/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jessepeterson/reposado/teams","hooks_url":"https://api.github.com/repos/jessepeterson/reposado/hooks","issue_events_url":"https://api.github.com/repos/jessepeterson/reposado/issues/events{/number}","events_url":"https://api.github.com/repos/jessepeterson/reposado/events","assignees_url":"https://api.github.com/repos/jessepeterson/reposado/assignees{/user}","branches_url":"https://api.github.com/repos/jessepeterson/reposado/branches{/branch}","tags_url":"https://api.github.com/repos/jessepeterson/reposado/tags","blobs_url":"https://api.github.com/repos/jessepeterson/reposado/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jessepeterson/reposado/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jessepeterson/reposado/git/refs{/sha}","trees_url":"https://api.github.com/repos/jessepeterson/reposado/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jessepeterson/reposado/statuses/{sha}","languages_url":"https://api.github.com/repos/jessepeterson/reposado/languages","stargazers_url":"https://api.github.com/repos/jessepeterson/reposado/stargazers","contributors_url":"https://api.github.com/repos/jessepeterson/reposado/contributors","subscribers_url":"https://api.github.com/repos/jessepeterson/reposado/subscribers","subscription_url":"https://api.github.com/repos/jessepeterson/reposado/subscription","commits_url":"https://api.github.com/repos/jessepeterson/reposado/commits{/sha}","git_commits_url":"https://api.github.com/repos/jessepeterson/reposado/git/commits{/sha}","comments_url":"https://api.github.com/repos/jessepeterson/reposado/comments{/number}","issue_comment_url":"https://api.github.com/repos/jessepeterson/reposado/issues/comments{/number}","contents_url":"https://api.github.com/repos/jessepeterson/reposado/contents/{+path}","compare_url":"https://api.github.com/repos/jessepeterson/reposado/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jessepeterson/reposado/merges","archive_url":"https://api.github.com/repos/jessepeterson/reposado/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jessepeterson/reposado/downloads","issues_url":"https://api.github.com/repos/jessepeterson/reposado/issues{/number}","pulls_url":"https://api.github.com/repos/jessepeterson/reposado/pulls{/number}","milestones_url":"https://api.github.com/repos/jessepeterson/reposado/milestones{/number}","notifications_url":"https://api.github.com/repos/jessepeterson/reposado/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jessepeterson/reposado/labels{/name}","releases_url":"https://api.github.com/repos/jessepeterson/reposado/releases{/id}","deployments_url":"https://api.github.com/repos/jessepeterson/reposado/deployments","created_at":"2013-03-09T06:41:51Z","updated_at":"2015-03-18T06:54:25Z","pushed_at":"2016-04-21T20:10:20Z","git_url":"git://github.com/jessepeterson/reposado.git","ssh_url":"git@github.com:jessepeterson/reposado.git","clone_url":"https://github.com/jessepeterson/reposado.git","svn_url":"https://github.com/jessepeterson/reposado","homepage":"","size":191,"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":"wdas:master","ref":"master","sha":"54f978155b9ff1e2c1df67fdf72114f1a9131f81","user":{"login":"wdas","id":125487,"avatar_url":"https://avatars.githubusercontent.com/u/125487?v=3","gravatar_id":"","url":"https://api.github.com/users/wdas","html_url":"https://github.com/wdas","followers_url":"https://api.github.com/users/wdas/followers","following_url":"https://api.github.com/users/wdas/following{/other_user}","gists_url":"https://api.github.com/users/wdas/gists{/gist_id}","starred_url":"https://api.github.com/users/wdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdas/subscriptions","organizations_url":"https://api.github.com/users/wdas/orgs","repos_url":"https://api.github.com/users/wdas/repos","events_url":"https://api.github.com/users/wdas/events{/privacy}","received_events_url":"https://api.github.com/users/wdas/received_events","type":"Organization","site_admin":false},"repo":{"id":1662330,"name":"reposado","full_name":"wdas/reposado","owner":{"login":"wdas","id":125487,"avatar_url":"https://avatars.githubusercontent.com/u/125487?v=3","gravatar_id":"","url":"https://api.github.com/users/wdas","html_url":"https://github.com/wdas","followers_url":"https://api.github.com/users/wdas/followers","following_url":"https://api.github.com/users/wdas/following{/other_user}","gists_url":"https://api.github.com/users/wdas/gists{/gist_id}","starred_url":"https://api.github.com/users/wdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdas/subscriptions","organizations_url":"https://api.github.com/users/wdas/orgs","repos_url":"https://api.github.com/users/wdas/repos","events_url":"https://api.github.com/users/wdas/events{/privacy}","received_events_url":"https://api.github.com/users/wdas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wdas/reposado","description":"Host Apple Software Updates on the hardware and OS of your choice.","fork":false,"url":"https://api.github.com/repos/wdas/reposado","forks_url":"https://api.github.com/repos/wdas/reposado/forks","keys_url":"https://api.github.com/repos/wdas/reposado/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wdas/reposado/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wdas/reposado/teams","hooks_url":"https://api.github.com/repos/wdas/reposado/hooks","issue_events_url":"https://api.github.com/repos/wdas/reposado/issues/events{/number}","events_url":"https://api.github.com/repos/wdas/reposado/events","assignees_url":"https://api.github.com/repos/wdas/reposado/assignees{/user}","branches_url":"https://api.github.com/repos/wdas/reposado/branches{/branch}","tags_url":"https://api.github.com/repos/wdas/reposado/tags","blobs_url":"https://api.github.com/repos/wdas/reposado/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wdas/reposado/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wdas/reposado/git/refs{/sha}","trees_url":"https://api.github.com/repos/wdas/reposado/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wdas/reposado/statuses/{sha}","languages_url":"https://api.github.com/repos/wdas/reposado/languages","stargazers_url":"https://api.github.com/repos/wdas/reposado/stargazers","contributors_url":"https://api.github.com/repos/wdas/reposado/contributors","subscribers_url":"https://api.github.com/repos/wdas/reposado/subscribers","subscription_url":"https://api.github.com/repos/wdas/reposado/subscription","commits_url":"https://api.github.com/repos/wdas/reposado/commits{/sha}","git_commits_url":"https://api.github.com/repos/wdas/reposado/git/commits{/sha}","comments_url":"https://api.github.com/repos/wdas/reposado/comments{/number}","issue_comment_url":"https://api.github.com/repos/wdas/reposado/issues/comments{/number}","contents_url":"https://api.github.com/repos/wdas/reposado/contents/{+path}","compare_url":"https://api.github.com/repos/wdas/reposado/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wdas/reposado/merges","archive_url":"https://api.github.com/repos/wdas/reposado/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wdas/reposado/downloads","issues_url":"https://api.github.com/repos/wdas/reposado/issues{/number}","pulls_url":"https://api.github.com/repos/wdas/reposado/pulls{/number}","milestones_url":"https://api.github.com/repos/wdas/reposado/milestones{/number}","notifications_url":"https://api.github.com/repos/wdas/reposado/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wdas/reposado/labels{/name}","releases_url":"https://api.github.com/repos/wdas/reposado/releases{/id}","deployments_url":"https://api.github.com/repos/wdas/reposado/deployments","created_at":"2011-04-25T23:52:37Z","updated_at":"2016-04-19T14:07:10Z","pushed_at":"2016-04-21T20:10:20Z","git_url":"git://github.com/wdas/reposado.git","ssh_url":"git@github.com:wdas/reposado.git","clone_url":"https://github.com/wdas/reposado.git","svn_url":"https://github.com/wdas/reposado","homepage":"","size":244,"stargazers_count":472,"watchers_count":472,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":3,"forks":80,"open_issues":3,"watchers":472,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wdas/reposado/pulls/48"},"html":{"href":"https://github.com/wdas/reposado/pull/48"},"issue":{"href":"https://api.github.com/repos/wdas/reposado/issues/48"},"comments":{"href":"https://api.github.com/repos/wdas/reposado/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/wdas/reposado/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/wdas/reposado/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wdas/reposado/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/wdas/reposado/statuses/277417315ea2862bff16a6c61f22f787bc039d0f"}}}}