1
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
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
30
32 result=call(self.parser.getArgs())
33 if result!=0:
34 print_("\nError result:",result)
35
36
37