changeset 389:a690fc689f2f treepkg-status

added treepkg_dir andd tracks_dir attributes to PackageGroup
author Bjoern Ricks <bricks@intevation.de>
date Thu, 08 Jul 2010 15:59:52 +0000
parents 1af04bfbb1d0
children 6cab748288f7
files test/test_readconfig.py treepkg/packager.py treepkg/readconfig.py
diffstat 3 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_readconfig.py	Thu Jul 08 13:25:07 2010 +0000
+++ b/test/test_readconfig.py	Thu Jul 08 15:59:52 2010 +0000
@@ -83,7 +83,10 @@
         treepkg_opts, packager_opts = read_config(config_file)
         self.assertEquals(treepkg_opts,
                     dict(instructions_file="/home/builder/mill/instructions",
-                         check_interval=3600, name="testtreepkg"))
+                         check_interval=3600,
+                         name="testtreepkg",
+                         treepkg_dir="/home/builder/mill",
+                         tracks_dir="/home/builder/mill/tracks"))
         self.assertEquals(sorted(packager_opts,
                                  key=operator.itemgetter("name")),
                           [
--- a/treepkg/packager.py	Thu Jul 08 13:25:07 2010 +0000
+++ b/treepkg/packager.py	Thu Jul 08 15:59:52 2010 +0000
@@ -641,7 +641,8 @@
 
     def __init__(self, package_tracks, check_interval, revision=None,
                  instructions_file=None, do_svn_update=True,
-                 stop_on_error=False, name=""):
+                 stop_on_error=False, name="", treepkg_dir=None, 
+                 tracks_dir=None):
         self.package_tracks = package_tracks
         self.check_interval = check_interval
         self.revision = revision
@@ -650,6 +651,8 @@
         self.instructions_file = instructions_file
         self.instructions_file_removed = False
         self.name = name
+        self.treepkg_dir = treepkg_dir
+        self.tracks_dir = tracks_dir
         self.sort_tracks()
 
     def sort_tracks(self):
--- a/treepkg/readconfig.py	Thu Jul 08 13:25:07 2010 +0000
+++ b/treepkg/readconfig.py	Thu Jul 08 15:59:52 2010 +0000
@@ -84,7 +84,9 @@
 treepkg_desc = [
     ("check_interval", int),
     "instructions_file",
-    ("name", str, "")
+    ("name", str, ""),
+    ("treepkg_dir", str, None),
+    ("tracks_dir", str, None)
     ]
 
 
@@ -134,8 +136,8 @@
             packager_class = parser.get(section, "packager_class", vars=vars)
             module = packager.import_packager_module(packager_class)
             desc = packager_desc + module.PackageTrack.extra_config_desc
-            packager_options = (read_config_section(parser, section, desc,
-                                                    defaults=vars))
+            packager_options = read_config_section(parser, section, desc,
+                                                    defaults=vars)
             if not packager_options.get("svn_url") \
             and not packager_options.get('git_url'):
                 print >>sys.stderr, "Missing repository URL in section %r" \
@@ -146,8 +148,7 @@
                 print >>sys.stderr, \
                       "Warning: git_url in section %r will be ignored" \
                        % (section)
-            packagers.append(read_config_section(parser, section, desc,
-                                                 defaults=vars))
+            packagers.append(packager_options)
 
     # main config
     treepkg = read_config_section(parser, "treepkg", treepkg_desc)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)