Mercurial > treepkg
annotate runtreepkg.py @ 5:5ea8e9b67395
Add a packager for the enterprise branch localizations
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 09 Mar 2007 12:28:59 +0100 |
parents | fee641fec94e |
children | 96f4f58c62b5 |
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 | |
4
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
0
diff
changeset
|
15 from treepkg.packager import create_packager, Packager |
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) |
fee641fec94e
Separate the kolab specific parts.
Bernhard Herzog <bh@intevation.de>
parents:
0
diff
changeset
|
40 packager = Packager([create_packager(**opts) for opts in packager_opts], |
0 | 41 **treepkg_opts) |
42 packager.run() | |
43 | |
44 main() |