{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/361","labels_url":"https://api.github.com/repos/nengo/nengo_gui/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo_gui/issues/361/comments","events_url":"https://api.github.com/repos/nengo/nengo_gui/issues/361/events","html_url":"https://github.com/nengo/nengo_gui/issues/361","id":86346312,"number":361,"title":"__file__ is not defined","user":{"login":"drasmuss","id":1952220,"avatar_url":"https://avatars.githubusercontent.com/u/1952220?v=3","gravatar_id":"","url":"https://api.github.com/users/drasmuss","html_url":"https://github.com/drasmuss","followers_url":"https://api.github.com/users/drasmuss/followers","following_url":"https://api.github.com/users/drasmuss/following{/other_user}","gists_url":"https://api.github.com/users/drasmuss/gists{/gist_id}","starred_url":"https://api.github.com/users/drasmuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drasmuss/subscriptions","organizations_url":"https://api.github.com/users/drasmuss/orgs","repos_url":"https://api.github.com/users/drasmuss/repos","events_url":"https://api.github.com/users/drasmuss/events{/privacy}","received_events_url":"https://api.github.com/users/drasmuss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nengo/nengo_gui/labels/bug","name":"bug","color":"000000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-08T21:54:52Z","updated_at":"2015-06-09T02:00:11Z","closed_at":null,"body":"When I open `nengo_gui` via\r\n```python\r\nimport nengo_gui\r\nnengo_gui.Viz(__file__).start()\r\n```\r\nit opens up the GUI fine, and the model loads properly.  But then if I trigger a reload (e.g. by changing the file), I get this error:\r\n```\r\nTraceback (most recent call last):\r\n  File \"...\\nengo_gui\\nengo_gui\\components\\netgraph.py\", line 64, in _reload\r\n    exec(code, locals)\r\n  File \"<string>\", line 77, in <module>\r\nNameError: name '__file__' is not defined\r\n```\r\nSo it seems like the global `__file__` doesn't exist when you `exec` the code like that.  This is probably something specific to my setup (it seems like it would have been noticed before if it wasn't).\r\n\r\nEdit: to be clear, line 77 is the `nengo_gui.Viz(__file__).start()` line"},"comment":{"url":"https://api.github.com/repos/nengo/nengo_gui/issues/comments/110196696","html_url":"https://github.com/nengo/nengo_gui/issues/361#issuecomment-110196696","issue_url":"https://api.github.com/repos/nengo/nengo_gui/issues/361","id":110196696,"user":{"login":"tcstewar","id":2380772,"avatar_url":"https://avatars.githubusercontent.com/u/2380772?v=3","gravatar_id":"","url":"https://api.github.com/users/tcstewar","html_url":"https://github.com/tcstewar","followers_url":"https://api.github.com/users/tcstewar/followers","following_url":"https://api.github.com/users/tcstewar/following{/other_user}","gists_url":"https://api.github.com/users/tcstewar/gists{/gist_id}","starred_url":"https://api.github.com/users/tcstewar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcstewar/subscriptions","organizations_url":"https://api.github.com/users/tcstewar/orgs","repos_url":"https://api.github.com/users/tcstewar/repos","events_url":"https://api.github.com/users/tcstewar/events{/privacy}","received_events_url":"https://api.github.com/users/tcstewar/received_events","type":"User","site_admin":false},"created_at":"2015-06-09T02:00:11Z","updated_at":"2015-06-09T02:00:11Z","body":"Weird...  it's supposed to be filling in ```__file__``` automatically for exactly this reason:\r\n\r\nhttps://github.com/nengo/nengo_gui/blob/master/nengo_gui/viz.py#L203\r\n\r\nOh, oops, I see...  it's not doing that in the ```netgraph.py``` reload case.  That same line should be added there."}}