I have developed a command line python application to save a source file with syntax highlight (pygments) as a evernote note; well this work fine. Now i would like to integrate this application in a sublime text 2 plugin, but my application needs some python modules to work (like evernote sdk, pygments library). Project's structure is following:

Package
   |
   ---My_Plugin
          |
          -----evernote/
          |
          -----pygments/
          |
          myplugin_main.py

I'm tring to include modules as following:

import sys, os
sys.path.append(os.path.abspath(os.path.dirname(__file__))+"/evernote")
sys.path.append(os.path.abspath(os.path.dirname(__file__))+"/pygments")
from evernote.api.client import EvernoteClient
import evernote.edam.type.ttypes as Types
import evernote.edam.notestore.NoteStore as NoteStore
import evernote.edam.userstore.UserStore as UserStore

I'm having a lot of problems to work this external modules; i don't understand why it seems that the application don't see modules.

From the sublime console, when i try to save i receive something like this:

Reloading plugin /home/sergioska/.config/sublime-text-2/Packages/evernote-sublime-plugin/ever.py
Traceback (most recent call last):
File "./sublime_plugin.py", line 62, in reload_plugin
File "./ever.py", line 3, in <module>
    from evercode import EverCode
File "./evercode.py", line 7, in <module>
    from evernote.api.client import EvernoteClient
File "/home/sergioska/.config/sublime-text-2/Packages/evernote-sublime-plugin/evernote/evernote/api/client.py", line 5, in <module>
    import oauth2 as oauth
File "./oauth2/__init__.py", line 32, in <module>
    import httplib2
File "./httplib2/__init__.py", line 915, in <module>
    class HTTPSConnectionWithTimeout(httplib.HTTPSConnection):
AttributeError: 'module' object has no attribute 'HTTPSConnection'

of course I tried to add also oauth2 and httplib2 like i say above, but nothing. How can i do to solve this problem?

有帮助吗?

解决方案

As for the error you got, could it be similar issue to this? HTTPSConnection module missing in Python 2.6 on CentOS 5.2

For the sublime 2 plugin, this is what I found on github: https://github.com/jamiesun/SublimeEvernote

and I forked it and updated as non OAuth version with Evernote SDK: https://github.com/rekotan/SublimeEvernote

Those above might help you to build your own.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top