Mercurial > treepkg
comparison bin/inittreepkg.py @ 106:66cbfc772f84
Add bin/inittreepkg.py, a script to automate some of the installation
and some support code for in in the packager classes.
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 04 Mar 2008 14:31:28 +0000 |
parents | |
children | 1fcdffbeb9de |
comparison
equal
deleted
inserted
replaced
105:b4226070371f | 106:66cbfc772f84 |
---|---|
1 #! /usr/bin/python2.4 | |
2 # Copyright (C) 2007, 2008 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 """Script to partially initialize the tree packager | |
10 | |
11 The script assumes that the config file for the tree packager already | |
12 contains the settings for the individual packagers. This script will at | |
13 least create the base directory for all packagers configured in the | |
14 configuration file and perhaps do other checks and initializations | |
15 depending on the packager classes used. The output indicates what has | |
16 been done and what still needs to be done manually. | |
17 """ | |
18 | |
19 | |
20 import treepkgcmd | |
21 from treepkg.options import create_parser | |
22 from treepkg.packager import create_package_track, PackagerGroup | |
23 from treepkg.readconfig import read_config | |
24 | |
25 | |
26 def init_treepkg(config_file): | |
27 treepkg_opts, packager_opts = read_config(config_file) | |
28 group = PackagerGroup([create_package_track(**opts) | |
29 for opts in packager_opts], | |
30 **treepkg_opts) | |
31 for track in group.get_package_tracks(): | |
32 track.init_treepkg() | |
33 | |
34 | |
35 def parse_commandline(): | |
36 parser = create_parser() | |
37 return parser.parse_args() | |
38 | |
39 | |
40 def main(): | |
41 options, args = parse_commandline() | |
42 init_treepkg(options.config_file) | |
43 | |
44 main() |