[Zope-CVS] SVN: zpkgtools/trunk/zpkgtools/ make if possible to specify that an "application" distro should be built

Fred L. Drake, Jr. fdrake at gmail.com
Fri Aug 5 16:58:18 EDT 2005


Log message for revision 37749:
  make if possible to specify that an "application" distro should be built
  in the configuration file
  

Changed:
  U   zpkgtools/trunk/zpkgtools/app.py
  U   zpkgtools/trunk/zpkgtools/config.py
  U   zpkgtools/trunk/zpkgtools/tests/test_config.py

-=-
Modified: zpkgtools/trunk/zpkgtools/app.py
===================================================================
--- zpkgtools/trunk/zpkgtools/app.py	2005-08-05 20:41:05 UTC (rev 37748)
+++ zpkgtools/trunk/zpkgtools/app.py	2005-08-05 20:58:18 UTC (rev 37749)
@@ -80,6 +80,8 @@
         self.locations = cf.locations
         if cf.collect_dependencies:
             self.options.collect = True
+        if cf.application:
+            self.options.application = True
 
         # XXX Hack: This should be part of BuilderApplication
         if options.include_support_code is None:

Modified: zpkgtools/trunk/zpkgtools/config.py
===================================================================
--- zpkgtools/trunk/zpkgtools/config.py	2005-08-05 20:41:05 UTC (rev 37748)
+++ zpkgtools/trunk/zpkgtools/config.py	2005-08-05 20:58:18 UTC (rev 37749)
@@ -52,6 +52,7 @@
     ({"resource-map": non_empty_string,
       "include-support-code": boolean,
       "collect-dependencies": boolean,
+      "build-application": boolean,
       }, [], None),
     )
 
@@ -70,6 +71,7 @@
 
     def __init__(self):
         """Initialize a new `Configuration` object."""
+        self.application = False
         self.collect_dependencies = False
         self.location_maps = []
         self.locations = locationmap.LocationMap()
@@ -124,9 +126,15 @@
         # collect-dependencies
         if len(cf.collect_dependencies) > 1:
             raise cfgparser.ConfigurationError(
-                "include-support-code can be specified at most once")
+                "collect-dependencies can be specified at most once")
         if cf.collect_dependencies:
             self.collect_dependencies = cf.collect_dependencies[0]
+        # build-application
+        if len(cf.build_application) > 1:
+            raise cfgparser.ConfigurationError(
+                "build-application can be specified at most once")
+        if cf.build_application:
+            self.application = cf.build_application[0]
 
 
 def defaultConfigurationPath():

Modified: zpkgtools/trunk/zpkgtools/tests/test_config.py
===================================================================
--- zpkgtools/trunk/zpkgtools/tests/test_config.py	2005-08-05 20:41:05 UTC (rev 37748)
+++ zpkgtools/trunk/zpkgtools/tests/test_config.py	2005-08-05 20:58:18 UTC (rev 37749)
@@ -61,6 +61,11 @@
         self.assertRaises(cfgparser.ConfigurationError,
                           self.load_text, "resource-map \n")
 
+        # application too many times
+        self.assertRaises(cfgparser.ConfigurationError,
+                          self.load_text, ("build-application true\n"
+                                           "build-application true\n"))
+
         # collect-dependencies too many times
         self.assertRaises(cfgparser.ConfigurationError,
                           self.load_text, ("collect-dependencies false\n"



More information about the Zope-CVS mailing list