On Sat, Nov 8, 2008 at 1:17 AM, eliben <[EMAIL PROTECTED]> wrote:
>
>> This thread has some info about the problem you are trying to 
>> solve:http://groups.google.com/group/ply-hack/browse_thread/thread/848eeeda...
>>
>> 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_comp...http://pywbem.svn.sourceforge.net/viewvc/pywbem/pywbem/trunk/setup.py...
>>
>
> I've looked at your code, and there's something I don't understand.
> The _build function creates the tables and is called by setup.py, I
> see.
> But if a user imports your module, how does it find the tab files in
> the path and doesn't regenerate them ?
> Did you modify PLY for that ?

No.  As I recall now, it works simply because I pulled lex.py and
yacc.py from ply and included them in the same directory as my code.
When the code within lex.py and yacc.py tries to import the parsetab
and lextab modules, it first looks in the same directory where lex.py
and yacc.py reside.   It finds the modules there. so it doesn't
regenerate them.

If you don't want to do that, you'll have to do something like what is
discussed in this email thread, mentioned previously:
http://groups.google.com/group/ply-hack/browse_thread/thread/848eeedab7152f5b/8294806bafe22a57?pli=1

Sorry for the confusion.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to