1 """
2 Application-class that implements pyFoamPackCase.py
3 """
4
5 from PyFoamApplication import PyFoamApplication
6
7 from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
8
9 from os import path
10
13 description="""
14 Packs a case into a tar-file copying the system, constant and 0-directories.
15 Excludes all .svn-direcotries and all files ending with ~
16 """
17 PyFoamApplication.__init__(self,args=args,description=description,usage="%prog <case>",interspersed=True,nr=1)
18
20 self.parser.add_option("--last",
21 action="store_true",
22 dest="last",
23 default=False,
24 help="Also add the last time-step")
25 self.parser.add_option("--pyfoam",
26 action="store_true",
27 dest="pyfoam",
28 default=False,
29 help="Add all files starting with PyFoam to the tarfile")
30 self.parser.add_option("--chemkin",
31 action="store_true",
32 dest="chemkin",
33 default=False,
34 help="Also add the Chemkin-directory")
35 self.parser.add_option("--add",
36 action="append",
37 dest="additional",
38 default=[],
39 help="Add all files and directories in the case directory that fit a glob-pattern to the tar (can be used more than once)")
40 self.parser.add_option("--exclude",
41 action="append",
42 dest="exclude",
43 default=[],
44 help="Exclude all files and directories that fit this glob pattern from being added, no matter at level (can be used more than once)")
45 self.parser.add_option("--tarname",
46 action="store",
47 dest="tarname",
48 default=None,
49 help='Name of the tarfile. If unset the name of the case plus ".tgz" will be used')
50
72