[TxMt] Run Script (PyMate) Bug in TextMate Version 1.5.4 (1360) [2007-02-13: REVISION 1360]

Alexander Ross alex.j.ross at gmail.com
Sat Feb 17 05:20:35 UTC 2007


Harold,

In the same directory as pymate.rb, there is a file  
"sitecustomize.py".  This is a python module that is loaded for every  
python script that is run with PyMate.  If you poke around in that  
file, you will find two functions,  "tm_raw_input" and "tm_input".   
Try adding some print statements to figure out where exactly it's  
hanging.

- Alex

On Feb 16, 2007, at 8:04 PM, Dr. Harold W. Schranz wrote:

> Hi Alex
>
> On 17/02/2007, at 2:23 PM, Alexander Ross wrote:
>
>> Harold,
>>
>> Did you also check /Library/Application Support/TextMate?  Also,  
>> do you have anything special with your installation of python?   
>> Perhaps a site_customize.py in your
>> home directory?
>
> Sorry I forgot to mention I don't have  /Library/Application  
> Support/TextMate directory.
>
> Aside from the the default Apple install of python in /usr/bin/python,
> I have installed the recommended version of python 2.5 (Framework  
> build) and it is linked to /usr/local/bin:
> /usr/local/bin/python -> ../../../Library/Frameworks/ 
> Python.framework/Versions/2.5/bin/python
> (My default $PATH searches /usr/local/bin ahead of /usr/bin/ )
>
>> Can you use raw_input?  Eg. try:
>>
>> #!/usr/bin/python
>> x = raw_input("Raw Input:")
>> y = eval(x)
>> print y
>
> Using  TextMate Version 1.5.4 (1360):
>
> 1. Only response I get is:
>
> PyMate r6190 running Python 2.3.5 (/usr/bin/python)
> >>> test_raw_input.py
>
> and I have to stop the task before I can close the window.
>
>
> 2. Running using the Run Script (Terminal) command works fine  
> (calls pythonw rather than python):
>
> clear; cd '/Users/harry/Desktop'; 'pythonw' '/Users/harry/Desktop/ 
> test_raw_input.py'; rm -f ''
>
>
> 3. Running the old version (via pymate.py) works fine (though it  
> appears to disregard the /usr/bin/python (2.3) for the /usr/local/ 
> bin/python (2.5) ):
> HIDE STDERR SHOW STDERR
> Python 2.5.0 - PyMate r5848
> For comments contact the author.
> The regular Python interpreter can be invoked using ⌘⇧R.
> >>> test_raw_input.py
> 123
> forcing redraw!!! don't remove
> Script terminated with success.
>
> I noticed that in the pymate.py code there is an explicit function  
> for putting up a CocoaDialog input box (via  raw_input_replacement 
> (prompt='')); is the same Cocoa dialog input box supposed to come  
> up with the Ruby code pymate.rb? This failure may be the kernel of  
> the problem ... is there a simple test whether my ruby install is  
> working?
> /usr/bin/ruby -v
> ruby 1.8.2 (2004-12-25) [universal-darwin8.0]
> file /usr/bin/ruby
> /usr/bin/ruby: Mach-O universal binary with 2 architectures
> /usr/bin/ruby (for architecture i386):  Mach-O executable i386
> /usr/bin/ruby (for architecture ppc):   Mach-O executable ppc
>
>
> Sorry to present such an intractable enigmatic problem ...
>
> Harry.
>
>
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list