{"action":"created","comment":{"url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/comments/24847750","id":24847750,"diff_hunk":"@@ -427,42 +414,29 @@ def logout(args):\n         if state[\"interactive\"]:\n             dxpy.AUTH_HELPER = None\n         else:\n-            write_env_var(\"DX_SECURITY_CONTEXT\", None)\n+            dxpy.config.write(\"DX_SECURITY_CONTEXT\", None)\n \n def set_api(protocol, host, port, write):\n-    os.environ['DX_APISERVER_PROTOCOL'] = protocol\n-    os.environ['DX_APISERVER_HOST'] = host\n-    os.environ['DX_APISERVER_PORT'] = port\n+    dxpy.config.update(DX_APISERVER_PROTOCOL=protocol,\n+                       DX_APISERVER_HOST=host,\n+                       DX_APISERVER_PORT=port)\n     if write:\n-        write_env_var(\"DX_APISERVER_PROTOCOL\", protocol)\n-        write_env_var(\"DX_APISERVER_HOST\", host)\n-        write_env_var(\"DX_APISERVER_PORT\", port)\n-    dxpy.set_api_server_info(host=host, port=port, protocol=protocol)\n+        dxpy.config.save()\n \n def set_project(project, write, name=None):\n     if dxpy.JOB_ID is None:\n-        os.environ['DX_PROJECT_CONTEXT_ID'] = project\n-        if name is not None:\n-            set_env_var(\"DX_PROJECT_CONTEXT_NAME\", name)\n-        if write:\n-            write_env_var(\"DX_PROJECT_CONTEXT_ID\", project)\n-            if name is not None:\n-                write_env_var(\"DX_PROJECT_CONTEXT_NAME\", name)\n-            else:\n-                try:\n-                    os.remove(os.path.expanduser('~/.dnanexus_config/DX_PROJECT_CONTEXT_NAME'))","path":"src/python/dxpy/scripts/dx.py","position":169,"original_position":169,"commit_id":"3466631e29cebd0a831af9772cdb6f3b5815bc87","original_commit_id":"c90eac899d1259eaa5235cd11cc856123610aeec","user":{"login":"psung","id":146557,"avatar_url":"https://avatars.githubusercontent.com/u/146557?v=3","gravatar_id":"","url":"https://api.github.com/users/psung","html_url":"https://github.com/psung","followers_url":"https://api.github.com/users/psung/followers","following_url":"https://api.github.com/users/psung/following{/other_user}","gists_url":"https://api.github.com/users/psung/gists{/gist_id}","starred_url":"https://api.github.com/users/psung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psung/subscriptions","organizations_url":"https://api.github.com/users/psung/orgs","repos_url":"https://api.github.com/users/psung/repos","events_url":"https://api.github.com/users/psung/events{/privacy}","received_events_url":"https://api.github.com/users/psung/received_events","type":"User","site_admin":false},"body":"None that I can foresee; I looked through its callers just now too.","created_at":"2015-02-17T19:54:24Z","updated_at":"2015-02-17T19:54:24Z","html_url":"https://github.com/dnanexus/dx-toolkit/pull/87#discussion_r24847750","pull_request_url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/comments/24847750"},"html":{"href":"https://github.com/dnanexus/dx-toolkit/pull/87#discussion_r24847750"},"pull_request":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87","id":28172432,"html_url":"https://github.com/dnanexus/dx-toolkit/pull/87","diff_url":"https://github.com/dnanexus/dx-toolkit/pull/87.diff","patch_url":"https://github.com/dnanexus/dx-toolkit/pull/87.patch","issue_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/87","number":87,"state":"open","locked":false,"title":"PTFM-13654 dxpy config manager","user":{"login":"kislyuk","id":862013,"avatar_url":"https://avatars.githubusercontent.com/u/862013?v=3","gravatar_id":"","url":"https://api.github.com/users/kislyuk","html_url":"https://github.com/kislyuk","followers_url":"https://api.github.com/users/kislyuk/followers","following_url":"https://api.github.com/users/kislyuk/following{/other_user}","gists_url":"https://api.github.com/users/kislyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/kislyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kislyuk/subscriptions","organizations_url":"https://api.github.com/users/kislyuk/orgs","repos_url":"https://api.github.com/users/kislyuk/repos","events_url":"https://api.github.com/users/kislyuk/events{/privacy}","received_events_url":"https://api.github.com/users/kislyuk/received_events","type":"User","site_admin":false},"body":"@psung, please review.\r\n\r\n* Unify dxpy configuration management\r\n* Save and load entire configuration at once, never piecemeal\r\n* Simplify and deduplicate code in some places\r\n* Begin test suite\r\n","created_at":"2015-01-28T07:02:11Z","updated_at":"2015-02-17T19:54:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef2303475942708bf53a34bac5d9a5d1344c9d74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87/commits","review_comments_url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87/comments","review_comment_url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/87/comments","statuses_url":"https://api.github.com/repos/dnanexus/dx-toolkit/statuses/3466631e29cebd0a831af9772cdb6f3b5815bc87","head":{"label":"dnanexus:PTFM-13654-dxpy-config","ref":"PTFM-13654-dxpy-config","sha":"3466631e29cebd0a831af9772cdb6f3b5815bc87","user":{"login":"dnanexus","id":1161297,"avatar_url":"https://avatars.githubusercontent.com/u/1161297?v=3","gravatar_id":"","url":"https://api.github.com/users/dnanexus","html_url":"https://github.com/dnanexus","followers_url":"https://api.github.com/users/dnanexus/followers","following_url":"https://api.github.com/users/dnanexus/following{/other_user}","gists_url":"https://api.github.com/users/dnanexus/gists{/gist_id}","starred_url":"https://api.github.com/users/dnanexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnanexus/subscriptions","organizations_url":"https://api.github.com/users/dnanexus/orgs","repos_url":"https://api.github.com/users/dnanexus/repos","events_url":"https://api.github.com/users/dnanexus/events{/privacy}","received_events_url":"https://api.github.com/users/dnanexus/received_events","type":"Organization","site_admin":false},"repo":{"id":4802269,"name":"dx-toolkit","full_name":"dnanexus/dx-toolkit","owner":{"login":"dnanexus","id":1161297,"avatar_url":"https://avatars.githubusercontent.com/u/1161297?v=3","gravatar_id":"","url":"https://api.github.com/users/dnanexus","html_url":"https://github.com/dnanexus","followers_url":"https://api.github.com/users/dnanexus/followers","following_url":"https://api.github.com/users/dnanexus/following{/other_user}","gists_url":"https://api.github.com/users/dnanexus/gists{/gist_id}","starred_url":"https://api.github.com/users/dnanexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnanexus/subscriptions","organizations_url":"https://api.github.com/users/dnanexus/orgs","repos_url":"https://api.github.com/users/dnanexus/repos","events_url":"https://api.github.com/users/dnanexus/events{/privacy}","received_events_url":"https://api.github.com/users/dnanexus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dnanexus/dx-toolkit","description":"DNAnexus platform client libraries.","fork":false,"url":"https://api.github.com/repos/dnanexus/dx-toolkit","forks_url":"https://api.github.com/repos/dnanexus/dx-toolkit/forks","keys_url":"https://api.github.com/repos/dnanexus/dx-toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnanexus/dx-toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnanexus/dx-toolkit/teams","hooks_url":"https://api.github.com/repos/dnanexus/dx-toolkit/hooks","issue_events_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/dnanexus/dx-toolkit/events","assignees_url":"https://api.github.com/repos/dnanexus/dx-toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/dnanexus/dx-toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/dnanexus/dx-toolkit/tags","blobs_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnanexus/dx-toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/dnanexus/dx-toolkit/languages","stargazers_url":"https://api.github.com/repos/dnanexus/dx-toolkit/stargazers","contributors_url":"https://api.github.com/repos/dnanexus/dx-toolkit/contributors","subscribers_url":"https://api.github.com/repos/dnanexus/dx-toolkit/subscribers","subscription_url":"https://api.github.com/repos/dnanexus/dx-toolkit/subscription","commits_url":"https://api.github.com/repos/dnanexus/dx-toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnanexus/dx-toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/comments/{number}","contents_url":"https://api.github.com/repos/dnanexus/dx-toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/dnanexus/dx-toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnanexus/dx-toolkit/merges","archive_url":"https://api.github.com/repos/dnanexus/dx-toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnanexus/dx-toolkit/downloads","issues_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/dnanexus/dx-toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/dnanexus/dx-toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnanexus/dx-toolkit/labels{/name}","releases_url":"https://api.github.com/repos/dnanexus/dx-toolkit/releases{/id}","created_at":"2012-06-27T00:23:47Z","updated_at":"2015-02-14T14:58:59Z","pushed_at":"2015-02-17T19:22:55Z","git_url":"git://github.com/dnanexus/dx-toolkit.git","ssh_url":"git@github.com:dnanexus/dx-toolkit.git","clone_url":"https://github.com/dnanexus/dx-toolkit.git","svn_url":"https://github.com/dnanexus/dx-toolkit","homepage":"","size":27253,"stargazers_count":17,"watchers_count":17,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":5,"forks":13,"open_issues":5,"watchers":17,"default_branch":"master"}},"base":{"label":"dnanexus:master","ref":"master","sha":"26690325522b23f1171a5aa313cdd344c9c45c98","user":{"login":"dnanexus","id":1161297,"avatar_url":"https://avatars.githubusercontent.com/u/1161297?v=3","gravatar_id":"","url":"https://api.github.com/users/dnanexus","html_url":"https://github.com/dnanexus","followers_url":"https://api.github.com/users/dnanexus/followers","following_url":"https://api.github.com/users/dnanexus/following{/other_user}","gists_url":"https://api.github.com/users/dnanexus/gists{/gist_id}","starred_url":"https://api.github.com/users/dnanexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnanexus/subscriptions","organizations_url":"https://api.github.com/users/dnanexus/orgs","repos_url":"https://api.github.com/users/dnanexus/repos","events_url":"https://api.github.com/users/dnanexus/events{/privacy}","received_events_url":"https://api.github.com/users/dnanexus/received_events","type":"Organization","site_admin":false},"repo":{"id":4802269,"name":"dx-toolkit","full_name":"dnanexus/dx-toolkit","owner":{"login":"dnanexus","id":1161297,"avatar_url":"https://avatars.githubusercontent.com/u/1161297?v=3","gravatar_id":"","url":"https://api.github.com/users/dnanexus","html_url":"https://github.com/dnanexus","followers_url":"https://api.github.com/users/dnanexus/followers","following_url":"https://api.github.com/users/dnanexus/following{/other_user}","gists_url":"https://api.github.com/users/dnanexus/gists{/gist_id}","starred_url":"https://api.github.com/users/dnanexus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnanexus/subscriptions","organizations_url":"https://api.github.com/users/dnanexus/orgs","repos_url":"https://api.github.com/users/dnanexus/repos","events_url":"https://api.github.com/users/dnanexus/events{/privacy}","received_events_url":"https://api.github.com/users/dnanexus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dnanexus/dx-toolkit","description":"DNAnexus platform client libraries.","fork":false,"url":"https://api.github.com/repos/dnanexus/dx-toolkit","forks_url":"https://api.github.com/repos/dnanexus/dx-toolkit/forks","keys_url":"https://api.github.com/repos/dnanexus/dx-toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnanexus/dx-toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnanexus/dx-toolkit/teams","hooks_url":"https://api.github.com/repos/dnanexus/dx-toolkit/hooks","issue_events_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/dnanexus/dx-toolkit/events","assignees_url":"https://api.github.com/repos/dnanexus/dx-toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/dnanexus/dx-toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/dnanexus/dx-toolkit/tags","blobs_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnanexus/dx-toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/dnanexus/dx-toolkit/languages","stargazers_url":"https://api.github.com/repos/dnanexus/dx-toolkit/stargazers","contributors_url":"https://api.github.com/repos/dnanexus/dx-toolkit/contributors","subscribers_url":"https://api.github.com/repos/dnanexus/dx-toolkit/subscribers","subscription_url":"https://api.github.com/repos/dnanexus/dx-toolkit/subscription","commits_url":"https://api.github.com/repos/dnanexus/dx-toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnanexus/dx-toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnanexus/dx-toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/comments/{number}","contents_url":"https://api.github.com/repos/dnanexus/dx-toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/dnanexus/dx-toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnanexus/dx-toolkit/merges","archive_url":"https://api.github.com/repos/dnanexus/dx-toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnanexus/dx-toolkit/downloads","issues_url":"https://api.github.com/repos/dnanexus/dx-toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/dnanexus/dx-toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/dnanexus/dx-toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnanexus/dx-toolkit/labels{/name}","releases_url":"https://api.github.com/repos/dnanexus/dx-toolkit/releases{/id}","created_at":"2012-06-27T00:23:47Z","updated_at":"2015-02-14T14:58:59Z","pushed_at":"2015-02-17T19:22:55Z","git_url":"git://github.com/dnanexus/dx-toolkit.git","ssh_url":"git@github.com:dnanexus/dx-toolkit.git","clone_url":"https://github.com/dnanexus/dx-toolkit.git","svn_url":"https://github.com/dnanexus/dx-toolkit","homepage":"","size":27253,"stargazers_count":17,"watchers_count":17,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":5,"forks":13,"open_issues":5,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87"},"html":{"href":"https://github.com/dnanexus/dx-toolkit/pull/87"},"issue":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/87"},"comments":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/dnanexus/dx-toolkit/statuses/3466631e29cebd0a831af9772cdb6f3b5815bc87"}}}}