mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
25 lines
683 B
Plaintext
25 lines
683 B
Plaintext
import os, string
|
|
|
|
os.environ['MODULESHOME'] = '$MODULESHOME'
|
|
|
|
if os.environ.has_key('TCLSH'):
|
|
TCLSH=os.environ['TCLSH']
|
|
else:
|
|
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
|