mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 10:03:08 +02:00
Python init file added
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import os, re, subprocess
|
||||
|
||||
def module(*args):
|
||||
os.environ['PMODULES_MODULEFILES_DIR']='modulefiles'
|
||||
os.environ['PMODULES_CONFIG_DIR']='config'
|
||||
pm_home=os.environ['PMODULES_HOME']
|
||||
os.environ['PMODULES_DIR']=pm_home
|
||||
modulecmd=os.path.join(pm_home, 'bin', 'modulecmd')
|
||||
if type(args[0]) == type([]):
|
||||
args = args[0]
|
||||
else:
|
||||
cmd = [modulecmd, 'python'] + list(args)
|
||||
(output, error) = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
|
||||
exec(output)
|
||||
Reference in New Issue
Block a user