Files
modules/init/python.in
rkowen ec359b9ae7 Removed the acconfig.h file since it's essentially in the configure.ac now.
Reworked all the init,skel,add.* files to handle versioning or no.
Added Makefile.am to ./etc/ and ./ext/ for cleaner installs.
2002-06-14 06:15:21 +00:00

20 lines
978 B
Plaintext

import os, string
@VERSIONING@if not os.environ.has_key('MODULE_VERSION'):
@VERSIONING@ os.environ['MODULE_VERSION_STACK'] = '@VERSION@'
@VERSIONING@ os.environ['MODULE_VERSION'] = '@VERSION@'
@VERSIONING@else:
@VERSIONING@ os.environ['MODULE_VERSION_STACK'] = os.environ['MODULE_VERSION']
@VERSIONING@os.environ['MODULESHOME'] = '@prefix@'
if not os.environ.has_key('MODULEPATH'):
os.environ['MODULEPATH'] = os.popen("""sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'""").readline()
if not os.environ.has_key('LOADEDMODULES'):
os.environ['LOADEDMODULES'] = '';
def module(command, *arguments):
@VERSIONING@ commands = os.popen('@BASEPREFIX@/Modules/%s/bin/modulecmd python %s %s' % (os.environ['MODULE_VERSION'], command, string.join(arguments))).read()
@NOTVERSIONING@ commands = os.popen('@bindir@/modulecmd python %s %s' % (command, string.join(arguments))).read()
exec commands