{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/greentea/pulls/comments/62050740","id":62050740,"diff_hunk":"@@ -0,0 +1,68 @@\n+\"\"\"\n+mbed SDK\n+Copyright (c) 2011-2015 ARM Limited\n+\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+Author: Przemyslaw Wirkus <Przemyslaw.Wirkus@arm.com>\n+\"\"\"\n+\n+import os\n+import sys\n+import json\n+import platform\n+import pkg_resources  # part of setuptools\n+\n+\n+packages = ['mbed-greentea', 'mbed-host-tests', 'mbed-ls', 'pyserial']\n+\n+def mbed_os_info():\n+    \"\"\"! Returns information about host OS\n+    @return Returns tuple with information about OS and host platform\n+    \"\"\"\n+    result = (os.name,\n+              platform.system(),\n+              platform.release(),\n+              platform.version(),\n+              sys.platform)\n+    return result\n+\n+\n+def mbed_get_global_info():\n+    info_dict = dict()\n+\n+    info_dict['os'] = dict()\n+    info_dict['mbed-tools'] = dict()\n+    info_dict['python'] = dict()\n+\n+    info_dict['os']['os_info'] = mbed_os_info()\n+    info_dict['os']['uname'] = platform.uname()","path":"mbed_greentea/mbed_info.py","position":49,"original_position":49,"commit_id":"939de34902194aa8c9fccdb7fb44ee21ec158d92","original_commit_id":"939de34902194aa8c9fccdb7fb44ee21ec158d92","user":{"login":"jupe","id":3822425,"avatar_url":"https://avatars.githubusercontent.com/u/3822425?v=3","gravatar_id":"","url":"https://api.github.com/users/jupe","html_url":"https://github.com/jupe","followers_url":"https://api.github.com/users/jupe/followers","following_url":"https://api.github.com/users/jupe/following{/other_user}","gists_url":"https://api.github.com/users/jupe/gists{/gist_id}","starred_url":"https://api.github.com/users/jupe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupe/subscriptions","organizations_url":"https://api.github.com/users/jupe/orgs","repos_url":"https://api.github.com/users/jupe/repos","events_url":"https://api.github.com/users/jupe/events{/privacy}","received_events_url":"https://api.github.com/users/jupe/received_events","type":"User","site_admin":false},"body":"i think you should take username away from this, its quite private..","created_at":"2016-05-04T14:41:24Z","updated_at":"2016-05-04T14:41:24Z","html_url":"https://github.com/ARMmbed/greentea/pull/116#discussion_r62050740","pull_request_url":"https://api.github.com/repos/ARMmbed/greentea/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/greentea/pulls/comments/62050740"},"html":{"href":"https://github.com/ARMmbed/greentea/pull/116#discussion_r62050740"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/greentea/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/greentea/pulls/116","id":68871885,"html_url":"https://github.com/ARMmbed/greentea/pull/116","diff_url":"https://github.com/ARMmbed/greentea/pull/116.diff","patch_url":"https://github.com/ARMmbed/greentea/pull/116.patch","issue_url":"https://api.github.com/repos/ARMmbed/greentea/issues/116","number":116,"state":"open","locked":false,"title":"Simple system info report for debug / support","user":{"login":"PrzemekWirkus","id":6360720,"avatar_url":"https://avatars.githubusercontent.com/u/6360720?v=3","gravatar_id":"","url":"https://api.github.com/users/PrzemekWirkus","html_url":"https://github.com/PrzemekWirkus","followers_url":"https://api.github.com/users/PrzemekWirkus/followers","following_url":"https://api.github.com/users/PrzemekWirkus/following{/other_user}","gists_url":"https://api.github.com/users/PrzemekWirkus/gists{/gist_id}","starred_url":"https://api.github.com/users/PrzemekWirkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrzemekWirkus/subscriptions","organizations_url":"https://api.github.com/users/PrzemekWirkus/orgs","repos_url":"https://api.github.com/users/PrzemekWirkus/repos","events_url":"https://api.github.com/users/PrzemekWirkus/events{/privacy}","received_events_url":"https://api.github.com/users/PrzemekWirkus/received_events","type":"User","site_admin":false},"body":"## Description\r\n* There is a need to easily report test tools versions so users can report them to team.\r\n* This PR adds kernel of a functionality to print information about system and tools/Python packages used to run test environment.\r\n* It will help us to diagnose certain issues reported by external and internal tools users.\r\n\r\n\r\n## Changes:\r\n* Add --info switch, prints system info and exits\r\n\r\n## Example\r\n\r\nSimple command:\r\n```\r\n$ mbedgt --info\r\n```\r\n\r\nPrints in JSON formated output data regarding system and mbed tools packages manes / versions / dependencies:\r\n\r\nExample output:\r\n```json\r\n{\r\n    \"python\": {\r\n        \"version\": \"2.7.11\",\r\n        \"version_info\": \"sys.version_info(major=2, minor=7, micro=11, releaselevel='final', serial=0)\"\r\n    },\r\n    \"mbed-tools\": {\r\n        \"packages\": {\r\n            \"mbed-ls\": \"0.2.6\",\r\n            \"pyserial\": \"3.0.1\",\r\n            \"mbed-host-tests\": \"0.2.6\",\r\n            \"mbed-greentea\": \"0.2.10\"\r\n        },\r\n        \"details\": {\r\n            \"mbed-ls\": [\r\n                \"mbed-ls 0.2.6\",\r\n                \"prettytable 0.7.2\"\r\n            ],\r\n            \"pyserial\": [\r\n                \"pyserial 3.0.1\"\r\n            ],\r\n            \"mbed-host-tests\": [\r\n                \"mbed-host-tests 0.2.6\",\r\n                \"prettytable 0.7.2\",\r\n                \"pyserial 3.0.1\"\r\n            ],\r\n            \"mbed-greentea\": [\r\n                \"mbed-greentea 0.2.10\",\r\n                \"colorama 0.3.7\",\r\n                \"mock 1.3.0\",\r\n                \"lockfile 0.12.2\",\r\n                \"junit-xml 1.6\",\r\n                \"mbed-ls 0.2.6\",\r\n                \"mbed-host-tests 0.2.6\",\r\n                \"pyserial 3.0.1\",\r\n                \"prettytable 0.7.2\",\r\n                \"six 1.10.0\",\r\n                \"funcsigs 0.4\",\r\n                \"pbr 1.8.1\",\r\n                \"six 1.10.0\"\r\n            ]\r\n        }\r\n    },\r\n    \"os\": {\r\n        \"uname\": [\r\n            \"Windows\",\r\n            \"username\",\r\n            \"7\",\r\n            \"6.1.7601\",\r\n            \"AMD64\",\r\n            \"Intel64 Family 6 Model 58 Stepping 9, GenuineIntel\"\r\n        ],\r\n        \"details\": {\r\n            \"os_win\": [\r\n                \"7\",\r\n                \"6.1.7601\",\r\n                \"SP1\",\r\n                \"Multiprocessor Free\"\r\n            ]\r\n        },\r\n        \"os_info\": [\r\n            \"nt\",\r\n            \"Windows\",\r\n            \"7\",\r\n            \"6.1.7601\",\r\n            \"win32\"\r\n        ]\r\n    }\r\n}\r\n```","created_at":"2016-05-04T14:32:45Z","updated_at":"2016-05-04T14:41:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de368c9be1400e42eb1c43b1d84dddac41bc7885","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/greentea/pulls/116/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/greentea/pulls/116/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/greentea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/greentea/issues/116/comments","statuses_url":"https://api.github.com/repos/ARMmbed/greentea/statuses/939de34902194aa8c9fccdb7fb44ee21ec158d92","head":{"label":"ARMmbed:devel_verbose_ver","ref":"devel_verbose_ver","sha":"939de34902194aa8c9fccdb7fb44ee21ec158d92","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":27880964,"name":"greentea","full_name":"ARMmbed/greentea","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/greentea","description":"\"Generic Regression Environment for test automation\" for mbed","fork":false,"url":"https://api.github.com/repos/ARMmbed/greentea","forks_url":"https://api.github.com/repos/ARMmbed/greentea/forks","keys_url":"https://api.github.com/repos/ARMmbed/greentea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/greentea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/greentea/teams","hooks_url":"https://api.github.com/repos/ARMmbed/greentea/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/greentea/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/greentea/events","assignees_url":"https://api.github.com/repos/ARMmbed/greentea/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/greentea/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/greentea/tags","blobs_url":"https://api.github.com/repos/ARMmbed/greentea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/greentea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/greentea/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/greentea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/greentea/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/greentea/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/greentea/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/greentea/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/greentea/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/greentea/subscription","commits_url":"https://api.github.com/repos/ARMmbed/greentea/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/greentea/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/greentea/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/greentea/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/greentea/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/greentea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/greentea/merges","archive_url":"https://api.github.com/repos/ARMmbed/greentea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/greentea/downloads","issues_url":"https://api.github.com/repos/ARMmbed/greentea/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/greentea/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/greentea/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/greentea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/greentea/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/greentea/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/greentea/deployments","created_at":"2014-12-11T16:39:08Z","updated_at":"2016-04-29T15:35:41Z","pushed_at":"2016-05-04T14:32:45Z","git_url":"git://github.com/ARMmbed/greentea.git","ssh_url":"git@github.com:ARMmbed/greentea.git","clone_url":"https://github.com/ARMmbed/greentea.git","svn_url":"https://github.com/ARMmbed/greentea","homepage":"","size":636,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":13,"forks":19,"open_issues":13,"watchers":9,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"703f29c119a867d1a4c8418e8a40475e9724ec23","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":27880964,"name":"greentea","full_name":"ARMmbed/greentea","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/greentea","description":"\"Generic Regression Environment for test automation\" for mbed","fork":false,"url":"https://api.github.com/repos/ARMmbed/greentea","forks_url":"https://api.github.com/repos/ARMmbed/greentea/forks","keys_url":"https://api.github.com/repos/ARMmbed/greentea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/greentea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/greentea/teams","hooks_url":"https://api.github.com/repos/ARMmbed/greentea/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/greentea/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/greentea/events","assignees_url":"https://api.github.com/repos/ARMmbed/greentea/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/greentea/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/greentea/tags","blobs_url":"https://api.github.com/repos/ARMmbed/greentea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/greentea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/greentea/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/greentea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/greentea/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/greentea/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/greentea/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/greentea/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/greentea/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/greentea/subscription","commits_url":"https://api.github.com/repos/ARMmbed/greentea/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/greentea/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/greentea/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/greentea/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/greentea/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/greentea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/greentea/merges","archive_url":"https://api.github.com/repos/ARMmbed/greentea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/greentea/downloads","issues_url":"https://api.github.com/repos/ARMmbed/greentea/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/greentea/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/greentea/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/greentea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/greentea/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/greentea/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/greentea/deployments","created_at":"2014-12-11T16:39:08Z","updated_at":"2016-04-29T15:35:41Z","pushed_at":"2016-05-04T14:32:45Z","git_url":"git://github.com/ARMmbed/greentea.git","ssh_url":"git@github.com:ARMmbed/greentea.git","clone_url":"https://github.com/ARMmbed/greentea.git","svn_url":"https://github.com/ARMmbed/greentea","homepage":"","size":636,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":13,"forks":19,"open_issues":13,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/greentea/pulls/116"},"html":{"href":"https://github.com/ARMmbed/greentea/pull/116"},"issue":{"href":"https://api.github.com/repos/ARMmbed/greentea/issues/116"},"comments":{"href":"https://api.github.com/repos/ARMmbed/greentea/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/greentea/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/greentea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/greentea/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/greentea/statuses/939de34902194aa8c9fccdb7fb44ee21ec158d92"}}}}