[Zope-CVS] CVS: Products/Ape/lib/apelib/config - apeconf.py:1.1.2.5 common.py:1.1.2.3

Shane Hathaway shane@zope.com
Wed, 9 Jul 2003 08:47:29 -0400


Update of /cvs-repository/Products/Ape/lib/apelib/config
In directory cvs.zope.org:/tmp/cvs-serv9330/config

Modified Files:
      Tag: ape-newconf-branch
	apeconf.py common.py 
Log Message:
Renamed variant to variation, a simpler word that makes more sense

=== Products/Ape/lib/apelib/config/apeconf.py 1.1.2.4 => 1.1.2.5 ===
--- Products/Ape/lib/apelib/config/apeconf.py:1.1.2.4	Tue Jul  8 22:10:41 2003
+++ Products/Ape/lib/apelib/config/apeconf.py	Wed Jul  9 08:46:55 2003
@@ -148,14 +148,14 @@
     def handle_configuration(source, vars, attrs):
         assert vars.has_key('directives')
 
-    def handle_variant(source, vars, attrs):
-        variants = vars['variants']
+    def handle_variation(source, vars, attrs):
+        variations = vars['variations']
         name = attrs['name']
-        d = variants.get(name)
+        d = variations.get(name)
         if d is None:
-            # Make a new variant.
+            # Make a new variation.
             d = []
-            variants[name] = d
+            variations[name] = d
         vars['directives'] = d
 
     def handle_mapper(source, vars, attrs):
@@ -254,7 +254,7 @@
 
     handlers = {
         'configuration': handle_configuration,
-        'variant':       handle_variant,
+        'variation':     handle_variation,
         'mapper':        handle_mapper,
         'serializer':    handle_serializer,
         'gateway':       handle_gateway,


=== Products/Ape/lib/apelib/config/common.py 1.1.2.2 => 1.1.2.3 ===
--- Products/Ape/lib/apelib/config/common.py:1.1.2.2	Tue Jul  8 22:10:41 2003
+++ Products/Ape/lib/apelib/config/common.py	Wed Jul  9 08:46:55 2003
@@ -76,10 +76,11 @@
 
     def __init__(self, handlers):
         self.handlers = handlers
-        # Set up a directive list in a default variant.
+        # Set up a directive list in a default variation.
         directives = []
-        self.variants = {'': directives}
-        self.stack = [{'directives': directives, 'variants': self.variants}]
+        self.variations = {'': directives}
+        self.stack = [{'directives': directives,
+                       'variations': self.variations}]
         self.locator = None
 
     def setDocumentLocator(self, locator):
@@ -104,13 +105,13 @@
 class DirectiveReader:
 
     def __init__(self, handlers):
-        self.directives = {}  # { unique key -> variant -> directive }
+        self.directives = {}  # { unique key -> variation -> directive }
         self.handlers = handlers
 
     def read(self, filename):
         reader = XMLConfigReader(self.handlers)
         parse(filename, reader)
-        for vname, directives in reader.variants.items():
+        for vname, directives in reader.variations.items():
             self.add(directives, vname)
 
     def add(self, directives, vname):
@@ -131,9 +132,9 @@
     def getDirectives(self, vname=''):
         res = []
         # Note that although there isn't a way to declare that a
-        # variant extends another variant, all variants should derive
-        # from the default anyway, so we don't need the extension
-        # mechanism yet.
+        # variation extends another variation, all variations should
+        # derive from the default anyway, so we don't need the
+        # extension mechanism yet.
         if not vname:
             vnames = ('',)
         else: