Home Download Buy Blog Forum Support

Depending on an extra module in a plugin

Re: Depending on an extra module in a plugin

Postby asmodai on Sun Aug 15, 2010 12:34 pm

Well almost.

Working on Python files it seems to do what it should.

When I try the same on a C++ or CSS file, I am suddenly greeted with:

Code: Select all
IOError: zipimport: can not open file Pygments-1.3.1-py2.6.egg

Whereas doing the same steps with the exact same parameters from the internal interpreter console works.

Call me baffled. :shock:
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Depending on an extra module in a plugin

Postby asmodai on Wed Aug 18, 2010 10:46 am

OK, no idea why it initially worked on the .py files, but it doesn't on this other install I have at work.

The sys.path shows that the egg is after the '.'.
Code: Select all
['python26.zip', u'C:\\Users\\39865jru\\AppData\\Roaming\\Sublime Text\\Packages\\ZenCoding', '.', u'Pygments-1.3.1-py2.6.egg']


But trying to use dirname() on __file__ for my plugin file only gives me back '.'. So not much sense in adding that to sys.path.
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Depending on an extra module in a plugin

Postby asmodai on Mon Aug 23, 2010 9:41 am

Doesn't seem to work. :(

Code: Select all
Reloading plugin C:\Users\39865jru\AppData\Roaming\Sublime Text\Packages\Pygmentize/pygmentize.py
['python26.zip', u'C:\\Users\\39865jru\\AppData\\Roaming\\Sublime Text\\Packages\\Pygmentize\\Pygments-1.3.1-py2.6.egg', u'C:\\Users\\39865jru\\AppData\\Roaming\\Sublime Text\\Packages\\ZenCoding', 'C:\\Users\\39865jru\\AppData\\Roaming\\Sublime Text\\Packages\\AAALoadFirstExtensions\\site-packages', 'C:\\Users\\39865jru\\AppData\\Roaming\\Sublime Text\\Packages\\AAALoadFirstExtensions', '.', u'Pygments-1.3.1-py2.6.egg', 'C:\\Python25\\Lib\\site-packages\\CherryPy-3.1.2-py2.5-win32.egg']
Traceback (most recent call last):
  File ".\sublimeplugin.py", line 119, in execTextCommand
  File ".\pygmentize.py", line 17, in run
    formatter = get_formatter_by_name(formatter)
  File "build\bdist.win32\egg\pygments\formatters\__init__.py", line 51, in get_formatter_by_name
  File "build\bdist.win32\egg\pygments\formatters\html.py", line 341, in __init__
  File "build\bdist.win32\egg\pygments\formatter.py", line 67, in __init__
  File "build\bdist.win32\egg\pygments\formatter.py", line 22, in _lookup_style
  File "build\bdist.win32\egg\pygments\styles\__init__.py", line 52, in get_style_by_name
IOError: zipimport: can not open file Pygments-1.3.1-py2.6.egg


The code is over at http://bitbucket.org/asmodai/pygments-plugin in case someone wants to try with their installation. Maybe it's something on my boxes that's screwing up.

(Curious CherryPy include, must be AAA that's doing that I guess, since I have no C:\Python25.)
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Depending on an extra module in a plugin

Postby asmodai on Tue Aug 24, 2010 8:46 am

sublimator wrote:CherryPy eh ... you probably have WebDevelopment package installed eh?


Yes, I do. Just wonder why it insists on putting that CherryPy on the path though. :)
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

Re: Depending on an extra module in a plugin

Postby asmodai on Fri Aug 27, 2010 10:30 am

sublimator wrote:Maybe try just putting the package on the path ... and just include pygments uncompressed as a subdirectory ..


But that's what I initially had done, unless I am totally misunderstanding what you are stating here.
asmodai
 
Posts: 73
Joined: Mon Mar 01, 2010 10:42 am

PreviousNext

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 8 guests