Files
modules/tcl/init/python.in
sirdude 394034ddca Modified the tcl init files so that they try to find tclsh, this
should make them quite a bit faster assuming they find it.
(This way it locates the shell just once instead of for every single
command.)

Kent
2004-01-15 15:53:00 +00:00

21 lines
594 B
Plaintext

import os, string
os.environ['MODULESHOME'] = '$MODULESHOME'
if os.path.exists('/usr/bin/tclsh'):
TCLSH="/usr/bin/tclsh"
else:
if os.path.exists('/bin/tclsh') :
TCLSH="/bin/tclsh"
else:
TCLSH=""
if not os.environ.has_key('MODULEPATH'):
os.environ['MODULEPATH'] = '/mips/tools/freeware/modulefiles'
if not os.environ.has_key('LOADEDMODULES'):
os.environ['LOADEDMODULES'] = '';
def module(command, *arguments):
commands = os.popen('$TCLSH $MODULESHOME/modulecmd.tcl python %s %s' % (command, string.join(arguments))).read()
exec commands