[spe.pycs.net] welcome

Rasjid Wilcox rasjidw at openminddev.net
Sat Dec 13 13:37:04 CET 2003


On Saturday 13 December 2003 21:32, www.stani.be wrote:
> > What are you trying to do here?  Just run or open
> > and Xterm?
>
> Well xterm or any other terminal emulator. I would
> like to choose by default the terminal emulator which
> is automatically installed on all Linux distributions,
> because xterm doesn't appear to be.

Hmm... I believe xterm should should exist whenever X exists.  

> The code is in menuToolsConsole and so on in
> wxMDIParentFrame.py  See also the paths tab in the
> preferences window.

Okay.  Eterm does not exist on all Linux installations.  I'm not even sure 
what it is, but I'm guessing it is the emacs terminal emulator?

But I'm about 99% certain that /usr/X11R6/bin/xterm is part of the standard X 
distribution, and so will exists whereever someone is using Spe.

Based on what I think you are trying to do, I think you want the following:

def menuToolsConsole(self,event):
...
    if terminal==DEFAULT:
        if sys.platfrom='win32':
            os.system(... win32 stuff)
        else:
            os.system("cd \"%s\"; /usr/X11R6/bin/xterm &"%(path,))
    else:
        os.system("cd \"%s\"; %s &"%(path,terminal)   ## Problem here!

You do however, have a slight problem, which is the use of the -e flag in your 
default options.  The use of the -e paramater is not compatible with having a 
terminal that hangs around for user input.  With the -e flag, the terminal 
will terminal gets created, runs the command, and then exits and closes 
immediately.  So "xterm -e 'cd /some/path/'" will display an xterm for under 
a second (while it changes to /some/path) and then it will close the said 
xterm.  I would either move the '-e' flag either into the code, or if people 
need the ability to change it from the GUI, then have a second box for the 
'execute' flag.  (I'm not completely sure on this, but I think that the use 
of -e may be standard across all terminal emulators.  I can check on this if 
you like.)

The
def menuToolsRunExternal(self,event):
...

routine it is basically okay, but you should probably use /usr/X11R6/bin/xterm 
as the default, and if you don't want Spe to block util the xterm is 
finished, then you should add the '&' at the end of the command (with a space 
before it) as per above.

> > Also, there is still the line ending problem on
> > Linux in spe.
>
> Chu-Ching Huang (check out his livezope, see
> http://spe.pycs.net!) send me a good spe file. So I
> hope that one will work fine.

Well the problem is still there in Spe v0.4.2.c.  The issue is that there are 
two 'spe' files.  One at the top level (ie, in the same directory as 
README.txt) - this file is good.  But there is another in build/scripts-2.2, 
and this has incorrect line endings.  Unfotunately, it is also the one that 
'python setup.py install' uses.  It would be really great if you copied the 
good one over the bad one.

Alternately, you could get dos2unix (http://www.bastet.com/software/UDDU.ZIP) 
and that way be sure that any shell scripts meant to run on Unix/Linux have 
the correct line endings.

Anyway, thanks again for your work on Spe Stani.

Cheers,

Rasjid.

-- 
Rasjid Wilcox
Canberra, Australia (UTC +10 hrs)
http://www.openminddev.net



More information about the Spe-user mailing list