{"action":"created","comment":{"url":"https://api.github.com/repos/onefinestay/nameko/pulls/comments/29761294","id":29761294,"diff_hunk":"@@ -53,11 +83,17 @@ def main(args):\n     ctx = {}\n     ctx['n'] = make_nameko_helper(config)\n \n-    # Support the regular Python interpreter startup script if someone\n-    # is using it.\n-    startup = os.environ.get('PYTHONSTARTUP')\n-    if startup and os.path.isfile(startup):\n-        with open(startup, 'r') as f:\n-            eval(compile(f.read(), startup, 'exec'), ctx)\n+    try:\n+        if args.plain:\n+            raise ImportError\n+\n+        run_shell(shell=args.interface, banner=banner, local=ctx)\n+    except ImportError:\n+        # Support the regular Python interpreter startup script if someone","path":"nameko/cli/shell.py","position":64,"original_position":64,"commit_id":"28932f40f910faaf6b72f7b7b929062e3c523289","original_commit_id":"28932f40f910faaf6b72f7b7b929062e3c523289","user":{"login":"davidszotten","id":412005,"avatar_url":"https://avatars.githubusercontent.com/u/412005?v=3","gravatar_id":"","url":"https://api.github.com/users/davidszotten","html_url":"https://github.com/davidszotten","followers_url":"https://api.github.com/users/davidszotten/followers","following_url":"https://api.github.com/users/davidszotten/following{/other_user}","gists_url":"https://api.github.com/users/davidszotten/gists{/gist_id}","starred_url":"https://api.github.com/users/davidszotten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidszotten/subscriptions","organizations_url":"https://api.github.com/users/davidszotten/orgs","repos_url":"https://api.github.com/users/davidszotten/repos","events_url":"https://api.github.com/users/davidszotten/events{/privacy}","received_events_url":"https://api.github.com/users/davidszotten/received_events","type":"User","site_admin":false},"body":"from what i can tell (using latest versions on pypi, might differ between versions), calling `embed` in bpython causes pythonstartup to be executed, but in ipython. one option is to run it \"manually\" for all shells (like this), and then unset the environment variable to prevent it from running again. thoughts?","created_at":"2015-05-06T14:11:03Z","updated_at":"2015-05-06T14:11:03Z","html_url":"https://github.com/onefinestay/nameko/pull/245#discussion_r29761294","pull_request_url":"https://api.github.com/repos/onefinestay/nameko/pulls/245","_links":{"self":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/comments/29761294"},"html":{"href":"https://github.com/onefinestay/nameko/pull/245#discussion_r29761294"},"pull_request":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/onefinestay/nameko/pulls/245","id":33864621,"html_url":"https://github.com/onefinestay/nameko/pull/245","diff_url":"https://github.com/onefinestay/nameko/pull/245.diff","patch_url":"https://github.com/onefinestay/nameko/pull/245.patch","issue_url":"https://api.github.com/repos/onefinestay/nameko/issues/245","number":245,"state":"open","locked":false,"title":"Optional interactive interpreters","user":{"login":"Mytho","id":539075,"avatar_url":"https://avatars.githubusercontent.com/u/539075?v=3","gravatar_id":"","url":"https://api.github.com/users/Mytho","html_url":"https://github.com/Mytho","followers_url":"https://api.github.com/users/Mytho/followers","following_url":"https://api.github.com/users/Mytho/following{/other_user}","gists_url":"https://api.github.com/users/Mytho/gists{/gist_id}","starred_url":"https://api.github.com/users/Mytho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mytho/subscriptions","organizations_url":"https://api.github.com/users/Mytho/orgs","repos_url":"https://api.github.com/users/Mytho/repos","events_url":"https://api.github.com/users/Mytho/events{/privacy}","received_events_url":"https://api.github.com/users/Mytho/received_events","type":"User","site_admin":false},"body":"Implements issue #210.\r\n\r\nThis allows the optional use of bpython or IPython as the interactive interpreter. I used the referenced [Django code](https://github.com/django/django/blob/9996158db467f9bef8243fcc36dc3602570e3613/django/core/management/commands/shell.py) as an example for this implementation.","created_at":"2015-04-22T14:38:18Z","updated_at":"2015-05-06T14:11:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a5fa5207fdd2d63a1e03f7b7ed1d8a23b07eb1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/onefinestay/nameko/pulls/245/commits","review_comments_url":"https://api.github.com/repos/onefinestay/nameko/pulls/245/comments","review_comment_url":"https://api.github.com/repos/onefinestay/nameko/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onefinestay/nameko/issues/245/comments","statuses_url":"https://api.github.com/repos/onefinestay/nameko/statuses/28932f40f910faaf6b72f7b7b929062e3c523289","head":{"label":"Mytho:optional-interactive-interpreters","ref":"optional-interactive-interpreters","sha":"28932f40f910faaf6b72f7b7b929062e3c523289","user":{"login":"Mytho","id":539075,"avatar_url":"https://avatars.githubusercontent.com/u/539075?v=3","gravatar_id":"","url":"https://api.github.com/users/Mytho","html_url":"https://github.com/Mytho","followers_url":"https://api.github.com/users/Mytho/followers","following_url":"https://api.github.com/users/Mytho/following{/other_user}","gists_url":"https://api.github.com/users/Mytho/gists{/gist_id}","starred_url":"https://api.github.com/users/Mytho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mytho/subscriptions","organizations_url":"https://api.github.com/users/Mytho/orgs","repos_url":"https://api.github.com/users/Mytho/repos","events_url":"https://api.github.com/users/Mytho/events{/privacy}","received_events_url":"https://api.github.com/users/Mytho/received_events","type":"User","site_admin":false},"repo":{"id":34376729,"name":"nameko","full_name":"Mytho/nameko","owner":{"login":"Mytho","id":539075,"avatar_url":"https://avatars.githubusercontent.com/u/539075?v=3","gravatar_id":"","url":"https://api.github.com/users/Mytho","html_url":"https://github.com/Mytho","followers_url":"https://api.github.com/users/Mytho/followers","following_url":"https://api.github.com/users/Mytho/following{/other_user}","gists_url":"https://api.github.com/users/Mytho/gists{/gist_id}","starred_url":"https://api.github.com/users/Mytho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mytho/subscriptions","organizations_url":"https://api.github.com/users/Mytho/orgs","repos_url":"https://api.github.com/users/Mytho/repos","events_url":"https://api.github.com/users/Mytho/events{/privacy}","received_events_url":"https://api.github.com/users/Mytho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mytho/nameko","description":"Python framework for building microservices","fork":true,"url":"https://api.github.com/repos/Mytho/nameko","forks_url":"https://api.github.com/repos/Mytho/nameko/forks","keys_url":"https://api.github.com/repos/Mytho/nameko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mytho/nameko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mytho/nameko/teams","hooks_url":"https://api.github.com/repos/Mytho/nameko/hooks","issue_events_url":"https://api.github.com/repos/Mytho/nameko/issues/events{/number}","events_url":"https://api.github.com/repos/Mytho/nameko/events","assignees_url":"https://api.github.com/repos/Mytho/nameko/assignees{/user}","branches_url":"https://api.github.com/repos/Mytho/nameko/branches{/branch}","tags_url":"https://api.github.com/repos/Mytho/nameko/tags","blobs_url":"https://api.github.com/repos/Mytho/nameko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mytho/nameko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mytho/nameko/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mytho/nameko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mytho/nameko/statuses/{sha}","languages_url":"https://api.github.com/repos/Mytho/nameko/languages","stargazers_url":"https://api.github.com/repos/Mytho/nameko/stargazers","contributors_url":"https://api.github.com/repos/Mytho/nameko/contributors","subscribers_url":"https://api.github.com/repos/Mytho/nameko/subscribers","subscription_url":"https://api.github.com/repos/Mytho/nameko/subscription","commits_url":"https://api.github.com/repos/Mytho/nameko/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mytho/nameko/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mytho/nameko/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mytho/nameko/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mytho/nameko/contents/{+path}","compare_url":"https://api.github.com/repos/Mytho/nameko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mytho/nameko/merges","archive_url":"https://api.github.com/repos/Mytho/nameko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mytho/nameko/downloads","issues_url":"https://api.github.com/repos/Mytho/nameko/issues{/number}","pulls_url":"https://api.github.com/repos/Mytho/nameko/pulls{/number}","milestones_url":"https://api.github.com/repos/Mytho/nameko/milestones{/number}","notifications_url":"https://api.github.com/repos/Mytho/nameko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mytho/nameko/labels{/name}","releases_url":"https://api.github.com/repos/Mytho/nameko/releases{/id}","created_at":"2015-04-22T07:52:08Z","updated_at":"2015-04-23T14:59:18Z","pushed_at":"2015-04-28T07:33:13Z","git_url":"git://github.com/Mytho/nameko.git","ssh_url":"git@github.com:Mytho/nameko.git","clone_url":"https://github.com/Mytho/nameko.git","svn_url":"https://github.com/Mytho/nameko","homepage":"https://nameko.readthedocs.org","size":2076,"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":"onefinestay:master","ref":"master","sha":"9a3ba6bc0cbb608f156e6f39a659be421e534293","user":{"login":"onefinestay","id":634153,"avatar_url":"https://avatars.githubusercontent.com/u/634153?v=3","gravatar_id":"","url":"https://api.github.com/users/onefinestay","html_url":"https://github.com/onefinestay","followers_url":"https://api.github.com/users/onefinestay/followers","following_url":"https://api.github.com/users/onefinestay/following{/other_user}","gists_url":"https://api.github.com/users/onefinestay/gists{/gist_id}","starred_url":"https://api.github.com/users/onefinestay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onefinestay/subscriptions","organizations_url":"https://api.github.com/users/onefinestay/orgs","repos_url":"https://api.github.com/users/onefinestay/repos","events_url":"https://api.github.com/users/onefinestay/events{/privacy}","received_events_url":"https://api.github.com/users/onefinestay/received_events","type":"Organization","site_admin":false},"repo":{"id":8431589,"name":"nameko","full_name":"onefinestay/nameko","owner":{"login":"onefinestay","id":634153,"avatar_url":"https://avatars.githubusercontent.com/u/634153?v=3","gravatar_id":"","url":"https://api.github.com/users/onefinestay","html_url":"https://github.com/onefinestay","followers_url":"https://api.github.com/users/onefinestay/followers","following_url":"https://api.github.com/users/onefinestay/following{/other_user}","gists_url":"https://api.github.com/users/onefinestay/gists{/gist_id}","starred_url":"https://api.github.com/users/onefinestay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onefinestay/subscriptions","organizations_url":"https://api.github.com/users/onefinestay/orgs","repos_url":"https://api.github.com/users/onefinestay/repos","events_url":"https://api.github.com/users/onefinestay/events{/privacy}","received_events_url":"https://api.github.com/users/onefinestay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onefinestay/nameko","description":"Python framework for building microservices","fork":false,"url":"https://api.github.com/repos/onefinestay/nameko","forks_url":"https://api.github.com/repos/onefinestay/nameko/forks","keys_url":"https://api.github.com/repos/onefinestay/nameko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onefinestay/nameko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onefinestay/nameko/teams","hooks_url":"https://api.github.com/repos/onefinestay/nameko/hooks","issue_events_url":"https://api.github.com/repos/onefinestay/nameko/issues/events{/number}","events_url":"https://api.github.com/repos/onefinestay/nameko/events","assignees_url":"https://api.github.com/repos/onefinestay/nameko/assignees{/user}","branches_url":"https://api.github.com/repos/onefinestay/nameko/branches{/branch}","tags_url":"https://api.github.com/repos/onefinestay/nameko/tags","blobs_url":"https://api.github.com/repos/onefinestay/nameko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onefinestay/nameko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onefinestay/nameko/git/refs{/sha}","trees_url":"https://api.github.com/repos/onefinestay/nameko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onefinestay/nameko/statuses/{sha}","languages_url":"https://api.github.com/repos/onefinestay/nameko/languages","stargazers_url":"https://api.github.com/repos/onefinestay/nameko/stargazers","contributors_url":"https://api.github.com/repos/onefinestay/nameko/contributors","subscribers_url":"https://api.github.com/repos/onefinestay/nameko/subscribers","subscription_url":"https://api.github.com/repos/onefinestay/nameko/subscription","commits_url":"https://api.github.com/repos/onefinestay/nameko/commits{/sha}","git_commits_url":"https://api.github.com/repos/onefinestay/nameko/git/commits{/sha}","comments_url":"https://api.github.com/repos/onefinestay/nameko/comments{/number}","issue_comment_url":"https://api.github.com/repos/onefinestay/nameko/issues/comments{/number}","contents_url":"https://api.github.com/repos/onefinestay/nameko/contents/{+path}","compare_url":"https://api.github.com/repos/onefinestay/nameko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onefinestay/nameko/merges","archive_url":"https://api.github.com/repos/onefinestay/nameko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onefinestay/nameko/downloads","issues_url":"https://api.github.com/repos/onefinestay/nameko/issues{/number}","pulls_url":"https://api.github.com/repos/onefinestay/nameko/pulls{/number}","milestones_url":"https://api.github.com/repos/onefinestay/nameko/milestones{/number}","notifications_url":"https://api.github.com/repos/onefinestay/nameko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onefinestay/nameko/labels{/name}","releases_url":"https://api.github.com/repos/onefinestay/nameko/releases{/id}","created_at":"2013-02-26T11:59:08Z","updated_at":"2015-05-06T13:49:27Z","pushed_at":"2015-05-06T10:21:11Z","git_url":"git://github.com/onefinestay/nameko.git","ssh_url":"git@github.com:onefinestay/nameko.git","clone_url":"https://github.com/onefinestay/nameko.git","svn_url":"https://github.com/onefinestay/nameko","homepage":"https://nameko.readthedocs.org","size":5994,"stargazers_count":445,"watchers_count":445,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":23,"forks":21,"open_issues":23,"watchers":445,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/245"},"html":{"href":"https://github.com/onefinestay/nameko/pull/245"},"issue":{"href":"https://api.github.com/repos/onefinestay/nameko/issues/245"},"comments":{"href":"https://api.github.com/repos/onefinestay/nameko/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onefinestay/nameko/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/onefinestay/nameko/statuses/28932f40f910faaf6b72f7b7b929062e3c523289"}}}}