Package PyFoam :: Package Applications :: Module Execute
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.Applications.Execute

 1  #  ICE Revision: $Id$  
 2  """ 
 3  Application class that implements pyFoamExecute 
 4  """ 
 5   
 6  from PyFoam.Applications.PyFoamApplication import PyFoamApplication 
 7  from PyFoam.ThirdParty.six import print_ 
 8   
 9  from subprocess import call 
10   
11 -class Execute(PyFoamApplication):
12 - def __init__(self,args=None):
13 description="""\ 14 Runs a command, but first switches the environment to a specific 15 OpenFOAM-version. Is of use for using wmake for a specific version 16 """ 17 18 PyFoamApplication.__init__(self, 19 nr=1, 20 exactNr=False, 21 args=args, 22 usage="%prog [options] <command> [arguments]", 23 description=description)
24
25 - def addOptions(self):
26 pass
27
28 - def run(self):
29 result=call(self.parser.getArgs()) 30 if result!=0: 31 print_("\nError result:",result)
32 33 # Should work with Python3 and Python2 34