{"action":"created","issue":{"url":"https://api.github.com/repos/pyblish/pyblish/issues/229","labels_url":"https://api.github.com/repos/pyblish/pyblish/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/pyblish/pyblish/issues/229/comments","events_url":"https://api.github.com/repos/pyblish/pyblish/issues/229/events","html_url":"https://github.com/pyblish/pyblish/issues/229","id":113548448,"number":229,"title":"Plug-in filepath can't be retrieved","user":{"login":"BigRoy","id":2439881,"avatar_url":"https://avatars.githubusercontent.com/u/2439881?v=3","gravatar_id":"","url":"https://api.github.com/users/BigRoy","html_url":"https://github.com/BigRoy","followers_url":"https://api.github.com/users/BigRoy/followers","following_url":"https://api.github.com/users/BigRoy/following{/other_user}","gists_url":"https://api.github.com/users/BigRoy/gists{/gist_id}","starred_url":"https://api.github.com/users/BigRoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BigRoy/subscriptions","organizations_url":"https://api.github.com/users/BigRoy/orgs","repos_url":"https://api.github.com/users/BigRoy/repos","events_url":"https://api.github.com/users/BigRoy/events{/privacy}","received_events_url":"https://api.github.com/users/BigRoy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pyblish/pyblish/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-27T10:08:26Z","updated_at":"2015-10-27T10:25:36Z","closed_at":null,"body":"Plug-ins are currently loaded using `execfile()` making it (close to?) impossible to retrieve the original source file of the plug-in. More information: http://stackoverflow.com/questions/17470193/python-metaclass-execfile-inspect-globals-namespace\r\n\r\nI'd opt to store it on the plug-in. \r\nBriefly chatted with Marcus and thinking about using `__path__`.\r\n\r\nThat way the plug-in source path can be retrieved for all loaded plug-ins like:\r\n\r\n```python\r\nimport pyblish.api\r\n\r\nfor plugin in pyblish.api.discover():\r\n    path = plugin.__path__\r\n```"},"comment":{"url":"https://api.github.com/repos/pyblish/pyblish/issues/comments/151445695","html_url":"https://github.com/pyblish/pyblish/issues/229#issuecomment-151445695","issue_url":"https://api.github.com/repos/pyblish/pyblish/issues/229","id":151445695,"user":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars.githubusercontent.com/u/2152766?v=3","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T10:25:36Z","updated_at":"2015-10-27T10:25:36Z","body":"> Could be done in `__new__()` maybe?\r\n\r\nPlug-ins aren't instantiated, but you could get the same affect via the metaplugin. It's triggered as soon as the file is read.\r\n\r\n> Another issue putting it in discover() might be handling the memory registered plug-ins and whether we set the `__path__` attribute there.\r\n\r\nA `__path__` of `None` for in memory plug-ins sounds logical to me. What do you think?"}}