Mercurial > treepkg
annotate runtreepkg.py @ 8:574506a022f6
Rename AssemblyLine to PackageLine
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 09 Mar 2007 14:48:58 +0100 |
parents | 96f4f58c62b5 |
children | 2bfb84bc4350 |
rev | line source |
---|---|
0 | 1 #! /usr/bin/python2.4 |
2 # Copyright (C) 2007 by Intevation GmbH | |
3 # Authors: | |
4 # Bernhard Herzog <bh@intevation.de> | |
5 # | |
6 # This program is free software under the GPL (>=v2) | |
7 # Read the file COPYING coming with the software for details. | |
8 | |
9 """Starts the tree packager""" | |
10 | |
11 import os | |
12 import logging | |
13 from optparse import OptionParser | |
14 | |
8
574506a022f6
Rename AssemblyLine to PackageLine
Bernhard Herzog <bh@intevation.de>
parents:
7
diff
changeset
|
15 from treepkg.packager import create_package_line, PackagerGroup |
0 | 16 from treepkg.readconfig import read_config |
17 | |
18 def initialize_logging(): | |
19 """Initializes the logging system""" | |
20 root = logging.getLogger() | |
21 root.setLevel(logging.DEBUG) | |
22 hdlr = logging.StreamHandler() | |
23 fmt = logging.Formatter("%(asctime)s %(levelname)s %(message)s") | |
24 hdlr.setFormatter(fmt) | |
25 root.addHandler(hdlr) | |
26 | |
27 def parse_commandline(): | |
28 parser = OptionParser() | |
29 parser.set_defaults(config_file=os.path.join(os.path.dirname(__file__), | |
30 "treepkg.cfg")) | |
31 parser.add_option("--config-file") | |
32 return parser.parse_args() | |
33 | |
34 def main(): | |
35 options, args = parse_commandline() | |
36 | |
37 initialize_logging() | |
38 | |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
0
diff
changeset
|
39 treepkg_opts, packager_opts = read_config(options.config_file) |
8
574506a022f6
Rename AssemblyLine to PackageLine
Bernhard Herzog <bh@intevation.de>
parents:
7
diff
changeset
|
40 group = PackagerGroup([create_package_line(**opts) |
574506a022f6
Rename AssemblyLine to PackageLine
Bernhard Herzog <bh@intevation.de>
parents:
7
diff
changeset
|
41 for opts in packager_opts], |
7
96f4f58c62b5
Rename the Packager class to PackagerGroup
Bernhard Herzog <bh@intevation.de>
parents:
4
diff
changeset
|
42 **treepkg_opts) |
96f4f58c62b5
Rename the Packager class to PackagerGroup
Bernhard Herzog <bh@intevation.de>
parents:
4
diff
changeset
|
43 group.run() |
0 | 44 |
45 main() |