[TxMt] Python Bundle: Bug/Feature in Run Script (PyMate)

Alex Ross ajross at cs.pdx.edu
Wed Feb 6 06:45:59 UTC 2008


> * I'm currently experimenting with TextMate as an alternative to  
> xemacs and have encountered a problem in the python bundle.
> * The problem is that PyMate is providing its own sitecustomize.py  
> to hook various functions.
> * This conflicts with our company's production/testing platforms.   
> They also uses sitecustomize to make site-specific customizations  
> (such as hooking the logging module handlers etc).
> * I'm sure our approach isn't unusual.  Unfortunately TextMate's  
> usage of it for *application* specific reasons prevents our own site  
> customisations from loading.
> * Is a possible alternative for TextMate to use a launcher script  
> approach? eg something that
>  - hooks the desired functions as currently
>  - hacks sys.argv and execfiles into the target file, such as
>
>        # remove us from the argument list, set __file__ to be the  
> script to run then exec it
>        del sys.argv[0]
>        __file__ = sys.argv[0]
>        execfile(sys.argv[0])
>
> This should have the same effect and ensure that a platforms  
> sitecustomize is loaded.  I'm happy to work on and submit a patch to  
> the appropriate people if desired (not sure who that would be)

Derek.

I have implemented what you've suggested here in svn.  You can either  
update the Python bundle yourself, or wait until the next Cutting-Edge  
Textmate.

If the new implementation of PyMate causes any problems for anyone,  
I'd like to hear about it!

– Alex


More information about the textmate mailing list