valid name accepts only str type
authorgwen <gremond@cadoles.com>
Wed, 6 Mar 2013 08:22:56 +0000 (09:22 +0100)
committergwen <gremond@cadoles.com>
Wed, 6 Mar 2013 08:22:56 +0000 (09:22 +0100)
tiramisu/config.py
tiramisu/option.py

index 2a1f9cb..58e9067 100644 (file)
@@ -326,16 +326,7 @@ class Config(object):
             subpath.insert(0, obj._cfgimpl_descr._name)
             obj = obj._cfgimpl_parent
         return ".".join(subpath)
-    # ______________________________________________________________________
-#    def cfgimpl_previous_value(self, path):
-#        "stores the previous value"
-#        home, name = self._cfgimpl_get_home_by_path(path)
-#        # FIXME  fucking name
-#        return home._cfgimpl_context._cfgimpl_values.previous_values[name]
-
-#    def get_previous_value(self, name):
-#        "for the time being, only the previous Option's value is accessible"
-#        return self._cfgimpl_context._cfgimpl_values.previous_values[name]
+
     # ______________________________________________________________________
     def add_warning(self, warning):
         "Config implements its own warning pile. Could be useful"
index 88ce51e..84b434d 100644 (file)
@@ -41,6 +41,10 @@ for act1, act2 in requires_actions:
 name_regexp = re.compile(r'^\d+')
 
 def valid_name(name):
+    try:
+        name = str(name)
+    except:
+        raise ValueError("not a valid string name")
     if re.match(name_regexp, name) is None:
         return True
     else: