Il giorno lun, 11/10/2010 alle 14.18 -0700, Tim Hatch ha scritto:
> > Let's say that my plugin, called lily, has the following tree:
> > 
> > 
> > lily
> > ├── ext
> > │   └── pygmentplugin.py
> > └── setup.py
> 
> You need setup.py one level higher, then create an empty file called
> __init__.py in the lily and ext directories.  At that point you should
> be able to say 'python -c "from lily.ext.pygmentplugin import
> LilyLexer"' (the same as you specified for the entry point) from the
> directory above lily.  Then a 'python setup.py develop' should allow you
> to run that from any directory (keep in mind that you need to activate
> the virtualenv before the setup.py develop, and still have it active
> when you try to import from another dir).
> 
> Once you get that working, you should be able to run pygmentize and have
> it find your plugin.  When you write a plugin, that means it no longer
> has to be anywhere near your pygments source dir.
> 

Yes, it works.
Now 'pygmentize -L' shows LilyLexer.
Thank you so much!

I have another problem, though.
I've created a lilypond test file called test.ly
If I run pygmentize on it (inside virtualenv, of course), I get the
following error:


(virtualpygments)f...@debian:~/LilyLexer$ pygmentize test.ly 

*** Error while highlighting:
KeyError: 'root'
   (file "/home/fede/pygments/pygments/lexer.py", line 476, in
get_tokens_unprocessed)


Maybe it's something about how I have installed Pygments in the
virtualenv?
I cloned the mercurial repo and installed it from source in my home dir.
Again, inside virtualenv. In fact, in site-packages/ dir of my
virtualenv I have a file called Pygments.egg-link which points to the
dir of pygments source.
Should have I used easy_install (inside virtualenv) instead?

I'm getting closer :)
Thanks, cheers

Federico

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to