generic owners shall live in settings
[tiramisu.git] / tiramisu / setting.py
index dedf27a..431589d 100644 (file)
@@ -114,7 +114,10 @@ class Setting():
     frozen = True
     # enables validation function for options if set
     validator = False
-    # ____________________________________________________________
+   # generic owner
+    owner = owners.user
+
+    #____________________________________________________________
     # properties methods
     def has_properties(self):
         "has properties means the Config's properties attribute is not empty"
@@ -134,7 +137,7 @@ class Setting():
         "deletes property propname in the Config's properties attribute"
         if self.has_property(propname):
             self.properties.remove(propname)
-
+    #____________________________________________________________
     def set_permissive(self, permissive):
         if not isinstance(permissive, list):
             raise TypeError('permissive must be a list')
@@ -183,7 +186,12 @@ class Setting():
 
     def set_owner(self, owner):
         ":param owner: sets the default value for owner at the Config level"
+        if not isinstance(owner, owners.Owner):
+            raise TypeError("invalid generic owner {0}".format(str(owner)))
         self.owner = owner
 
+    def get_owner(self):
+        return self.owner
+
 # Setting is actually a singleton
 settings = Setting()