[Treepkg-commits] r349 - in branches/treepkg-status: test treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 8 17:59:53 CEST 2010


Author: bricks
Date: 2010-07-08 17:59:52 +0200 (Thu, 08 Jul 2010)
New Revision: 349

Modified:
   branches/treepkg-status/test/test_readconfig.py
   branches/treepkg-status/treepkg/packager.py
   branches/treepkg-status/treepkg/readconfig.py
Log:
added treepkg_dir andd tracks_dir attributes to PackageGroup 


Modified: branches/treepkg-status/test/test_readconfig.py
===================================================================
--- branches/treepkg-status/test/test_readconfig.py	2010-07-08 13:25:07 UTC (rev 348)
+++ branches/treepkg-status/test/test_readconfig.py	2010-07-08 15:59:52 UTC (rev 349)
@@ -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")),
                           [

Modified: branches/treepkg-status/treepkg/packager.py
===================================================================
--- branches/treepkg-status/treepkg/packager.py	2010-07-08 13:25:07 UTC (rev 348)
+++ branches/treepkg-status/treepkg/packager.py	2010-07-08 15:59:52 UTC (rev 349)
@@ -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):

Modified: branches/treepkg-status/treepkg/readconfig.py
===================================================================
--- branches/treepkg-status/treepkg/readconfig.py	2010-07-08 13:25:07 UTC (rev 348)
+++ branches/treepkg-status/treepkg/readconfig.py	2010-07-08 15:59:52 UTC (rev 349)
@@ -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)



More information about the Treepkg-commits mailing list