This thread has some info about the problem you are trying to solve: http://groups.google.com/group/ply-hack/browse_thread/thread/848eeedab7152f5b/8294806bafe22a57
If I recall correctly, the solution I ended up with (which is different from the one described in the thread above) requires that lex.py and yacc.py from the PLY distribution be bundled with my module. I also rigged my setup.py to generate the lextab and parsetab files, so that they can be compiled and the corresponding .pyc files are installed by setup.py. You're free to examine my code: http://pywbem.svn.sourceforge.net/viewvc/pywbem/pywbem/trunk/mof_compiler.py?view=markup http://pywbem.svn.sourceforge.net/viewvc/pywbem/pywbem/trunk/setup.py?view=markup On Fri, Oct 17, 2008 at 9:10 AM, eliben <[EMAIL PROTECTED]> wrote: > > Hello, > > I'm packaging a library that uses PLY for distribution. The setup > script is placing the library directory "mylib/" into the user's site- > packages. Inside, there's a parser file that uses PLY > (mylib_parser.py), and I've also placed a fresh parsetab.py into it. > > In user's code, when he imports: > > from mylib import mylib_parser > > And creates the parser, PLY starts generating the parser table and > places it into the user's current directory. > > How can I hide this implementation detail from the user ? I don't even > want him to know that any parser is used internally. > > Thanks > Eli > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ply-hack" 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/ply-hack?hl=en -~----------~----~----~----~------~----~------~--~---
