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

Source Code for Module PyFoam.Applications.ClearCase

 1  """ 
 2  Application-class that implements pyFoamClearCase.py 
 3  """ 
 4   
 5  from PyFoamApplication import PyFoamApplication 
 6   
 7  from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory 
 8   
9 -class ClearCase(PyFoamApplication):
10 - def __init__(self,args=None):
11 description=""" 12 Removes all timesteps but the first from a case-directory. 13 Also removes other data that is generated by sovers/utilities/PyFoam 14 """ 15 PyFoamApplication.__init__(self,args=args,description=description,usage="%prog <caseDirectory>",interspersed=True,nr=1)
16
17 - def addOptions(self):
18 self.parser.add_option("--after", 19 type="float", 20 dest="after", 21 default=None, 22 help="Only remove timesteps after this time") 23 self.parser.add_option("--processor", 24 action="store_true", 25 dest="processor", 26 default=False, 27 help="Keep the processor directories") 28 self.parser.add_option("--no-pyfoam", 29 action="store_false", 30 dest="pyfoam", 31 default=True, 32 help="Keep the PyFoam-specific directories and logfiles")
33
34 - def run(self):
35 cName=self.parser.getArgs()[0] 36 37 sol=SolutionDirectory(cName,archive=None,paraviewLink=False) 38 sol.clear(after=self.parser.getOptions().after, 39 processor=self.parser.getOptions().processor, 40 pyfoam=self.parser.getOptions().pyfoam)
41