예제 #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
예제 #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
예제 #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)
예제 #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)
예제 #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)
예제 #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)