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,
18 args=args,
19 description=description,
20 usage="%prog <case>",
21 interspersed=True,
22 changeVersion=False,
23 nr=1)
24
26 self.parser.add_option("--last",
27 action="store_true",
28 dest="last",
29 default=False,
30 help="Also add the last time-step")
31 self.parser.add_option("--pyfoam",
32 action="store_true",
33 dest="pyfoam",
34 default=False,
35 help="Add all files starting with PyFoam to the tarfile")
36 self.parser.add_option("--chemkin",
37 action="store_true",
38 dest="chemkin",
39 default=False,
40 help="Also add the Chemkin-directory")
41 self.parser.add_option("--add",
42 action="append",
43 dest="additional",
44 default=[],
45 help="Add all files and directories in the case directory that fit a glob-pattern to the tar (can be used more than once)")
46 self.parser.add_option("--exclude",
47 action="append",
48 dest="exclude",
49 default=[],
50 help="Exclude all files and directories that fit this glob pattern from being added, no matter at level (can be used more than once)")
51 self.parser.add_option("--tarname",
52 action="store",
53 dest="tarname",
54 default=None,
55 help='Name of the tarfile. If unset the name of the case plus ".tgz" will be used')
56
78