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, 13 args=None, 14 **kwargs):
15 description="""\ 16 Runs a command, but first switches the environment to a specific 17 OpenFOAM-version. Is of use for using wmake for a specific version 18 """ 19 20 PyFoamApplication.__init__(self, 21 nr=1, 22 exactNr=False, 23 args=args, 24 usage="%prog [options] <command> [arguments]", 25 description=description, 26 **kwargs)
27
28 - def addOptions(self):
29 pass
30
31 - def run(self):
32 result=call(self.parser.getArgs()) 33 if result!=0: 34 print_("\nError result:",result)
35 36 # Should work with Python3 and Python2 37