{"action":"created","issue":{"url":"https://api.github.com/repos/10gen-labs/mongo-connector/issues/208","labels_url":"https://api.github.com/repos/10gen-labs/mongo-connector/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/10gen-labs/mongo-connector/issues/208/comments","events_url":"https://api.github.com/repos/10gen-labs/mongo-connector/issues/208/events","html_url":"https://github.com/10gen-labs/mongo-connector/issues/208","id":56982279,"number":208,"title":"Problem launching My DocManager","user":{"login":"rescommunes","id":1028224,"avatar_url":"https://avatars.githubusercontent.com/u/1028224?v=3","gravatar_id":"","url":"https://api.github.com/users/rescommunes","html_url":"https://github.com/rescommunes","followers_url":"https://api.github.com/users/rescommunes/followers","following_url":"https://api.github.com/users/rescommunes/following{/other_user}","gists_url":"https://api.github.com/users/rescommunes/gists{/gist_id}","starred_url":"https://api.github.com/users/rescommunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rescommunes/subscriptions","organizations_url":"https://api.github.com/users/rescommunes/orgs","repos_url":"https://api.github.com/users/rescommunes/repos","events_url":"https://api.github.com/users/rescommunes/events{/privacy}","received_events_url":"https://api.github.com/users/rescommunes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-09T02:41:08Z","updated_at":"2015-02-10T17:51:23Z","closed_at":"2015-02-10T04:02:50Z","body":"Following the instructions for Writing Your Own DocManager i've created a package with the following structure. \r\n\r\n```\r\nsrc/__init__.py\r\nsrc/mongo_connector/__init__.py\r\nsrc/mongo_connector/doc_managers/__init__.py\r\nsrc/mongo_connector/doc_managers/whoosh_doc_manager.py\r\n```\r\n\r\nAll the \\_\\_init\\_\\_ files are empty except `src/mongo_connector/doc_managers/__init__.py` which contains\r\n\r\n```python\r\nfrom pkgutil import extend_path\r\n__path__ = extend_path(__path__, __name__)\r\n```\r\n\r\n`whoosh_doc_manager.py` contains `class DocManager(DocManagerBase)` and works fine when I load it up from a file called `whoosh_connector.py` inside my package.  `python whoosh_connector.py -d whoosh_doc_manager`. \r\n\r\n\r\n**whoosh_connector.py**\r\n\r\n```python\r\nimport logging\r\nfrom mongo_connector.connector import main\r\n\r\nif __name__ == '__main__':\r\n    logging.basicConfig(level=logging.DEBUG)\r\n    main()\r\n```\r\n\r\nBut, I would like to use the suggested method of loading my custom module. When run  `$ mongo-connector -d whoosh_doc_manager` my DocManager is not found.\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"/Users/abox/Documents/mongo-connector-whoosh/env-mac/bin/mongo-connector\", line 11, in <module>\r\n    sys.exit(main())\r\n  File \"/Users/abox/Documents/mongo-connector-whoosh/env-mac/lib/python2.6/site-packages/mongo_connector/util.py\", line 85, in wrapped\r\n    func(*args, **kwargs)\r\n  File \"/Users/abox/Documents/mongo-connector-whoosh/env-mac/lib/python2.6/site-packages/mongo_connector/connector.py\", line 950, in main\r\n    conf.parse_args()\r\n  File \"/Users/abox/Documents/mongo-connector-whoosh/env-mac/lib/python2.6/site-packages/mongo_connector/config.py\", line 114, in parse_args\r\n    option, dict((k, values.get(k)) for k in option.cli_names))\r\n  File \"/Users/abox/Documents/mongo-connector-whoosh/env-mac/lib/python2.6/site-packages/mongo_connector/connector.py\", line 778, in apply_doc_managers\r\n    module = import_dm_by_name(dm['docManager'])\r\n  File \"/Users/abox/Documents/mongo-connector-whoosh/env-mac/lib/python2.6/site-packages/mongo_connector/connector.py\", line 768, in import_dm_by_name\r\n    \"Could not import %s.\" % full_name)\r\nmongo_connector.errors.InvalidConfiguration: Could not import mongo_connector.doc_managers.whoosh_doc_manager.\r\n```\r\n\r\nI'm not sure what i'm doing wrong and honestly I don't get how `extend_path` is being used to make this work. \r\n\r\nThanks for your attention\r\nNoel\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/10gen-labs/mongo-connector/issues/comments/73747433","html_url":"https://github.com/10gen-labs/mongo-connector/issues/208#issuecomment-73747433","issue_url":"https://api.github.com/repos/10gen-labs/mongo-connector/issues/208","id":73747433,"user":{"login":"lovett89","id":5168837,"avatar_url":"https://avatars.githubusercontent.com/u/5168837?v=3","gravatar_id":"","url":"https://api.github.com/users/lovett89","html_url":"https://github.com/lovett89","followers_url":"https://api.github.com/users/lovett89/followers","following_url":"https://api.github.com/users/lovett89/following{/other_user}","gists_url":"https://api.github.com/users/lovett89/gists{/gist_id}","starred_url":"https://api.github.com/users/lovett89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lovett89/subscriptions","organizations_url":"https://api.github.com/users/lovett89/orgs","repos_url":"https://api.github.com/users/lovett89/repos","events_url":"https://api.github.com/users/lovett89/events{/privacy}","received_events_url":"https://api.github.com/users/lovett89/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T17:51:23Z","updated_at":"2015-02-10T17:51:23Z","body":"Great! I updated the documentation. Thanks for your patience."}}