Exemple #1
0
 def __setattr__(self, name, value):
     # Names starting with an underscore are not preferences but normal
     # instance attributes
     if name.startswith('_'):
         MutableMapping.__setattr__(self, name, value)
     else:
         self._all_prefs[self._basename + '.' + name] = value
Exemple #2
0
 def __setattr__(self, name, value):
     # Names starting with an underscore are not preferences but normal
     # instance attributes
     if name.startswith('_'):
         MutableMapping.__setattr__(self, name, value)
     else:
         self._all_prefs[self._basename + '.' + name] = value
Exemple #3
0
 def __delattr__(self, name):
     if 'pref_register' in self.__dict__ and name in self.pref_register:
         raise PreferenceError('Cannot delete a preference category.')
     else:
         MutableMapping.__setattr__(self, name, value)
Exemple #4
0
 def __setattr__(self, name, value):
     # Do not allow to set a category name to something else
     if 'pref_register' in self.__dict__ and name in self.pref_register:
         raise PreferenceError('Cannot set a preference category.')
     else:
         MutableMapping.__setattr__(self, name, value)
Exemple #5
0
 def __delattr__(self, name):
     if 'pref_register' in self.__dict__ and name in self.pref_register:
         raise PreferenceError('Cannot delete a preference category.')
     else:
         MutableMapping.__setattr__(self, name, value)
Exemple #6
0
 def __setattr__(self, name, value):  
     # Do not allow to set a category name to something else
     if 'pref_register' in self.__dict__ and name in self.pref_register:
         raise PreferenceError('Cannot set a preference category.')
     else:
         MutableMapping.__setattr__(self, name, value)