adds an extend API for the settings
[tiramisu.git] / tiramisu / setting.py
index 470ec94..3b4d2f7 100644 (file)
@@ -260,6 +260,11 @@ class Property(object):
         self._properties = prop
 
     def append(self, propname):
+        """Appends a property named propname
+
+        :param propname: a predefined or user defined property name
+        :type propname: string
+        """
         if self._opt is not None and self._opt._calc_properties is not None \
                 and propname in self._opt._calc_properties:
             raise ValueError(_('cannot append {0} property for option {1}: '
@@ -269,12 +274,28 @@ class Property(object):
         self._setting._setproperties(self._properties, self._opt, self._path)
 
     def remove(self, propname):
+        """Removes a property named propname
+
+        :param propname: a predefined or user defined property name
+        :type propname: string
+        """
         if propname in self._properties:
             self._properties.remove(propname)
             self._setting._setproperties(self._properties, self._opt,
                                          self._path)
+    def extend(self, propnames):
+        """Extends properties to the existing properties
+
+        :param propnames: an iterable made of property names
+        :type propnames: iterable of string
+        """
+        for propname in propname:
+            self.append(propname)
 
     def reset(self):
+        """resets the properties (does not **clear** the properties,
+        default properties are still present)
+        """
         self._setting.reset(_path=self._path)
 
     def __contains__(self, propname):