def setPropertyValue(self, name, value): properties = self._getPropertySetInfo() if name in properties and hasattr(self, name): setattr(self, name, value) else: message = 'Cant setPropertyValue, UnknownProperty: %s - %s' % (name, value) raise UnknownPropertyException(message, self)
def get_view_state(self, name): if name.startswith("Show"): try: return self.imple.column_state[name[4:]] except: pass raise UnknownPropertyException(name, self)
def checkExistence( self, name ): found = 0 for x in g_attribs: if x == name: found = 1 break if not found: raise UnknownPropertyException( "Property "+name+" is unknown", self )
def getPropertyValue(self, name): if name == self.NAME_DATA_URL or \ name == self.NAME_BACKUP_DIRECTORY: config = self.get_controller_config() if config: return config.getPropertyValue(name) from com.sun.star.beans import UnknownPropertyException raise UnknownPropertyException(name, self)
def set_view_state(self, name, state): if name.startswith("Show"): if name == "ShowName": raise PropertyVetoException(name, self) if state != self.imple.column_state[name[4:]]: self.imple.column_state[name[4:]] = state self.imple.column_state_changed() return raise UnknownPropertyException(name, self)
def setPropertiesValues(ctx, source, context, properties): results = [] for property in properties: if all((hasattr(property, 'Name'), hasattr(property, 'Value'), property.Name in source._propertySetInfo)): result, level, msg = _setPropertyValue(source, context, property) else: msg = "ERROR: Requested property: %s is not available" % property.Name level = SEVERE error = UnknownPropertyException(msg, source) result = uno.Any('com.sun.star.beans.UnknownPropertyException', error) logMessage(ctx, level, msg, source.__class__.__name__, 'setPropertiesValues()') results.append(result) return tuple(results)
def readFromRegistry(self, group, key): rootView = PropertyManager.getRegistryProperties(group) if rootView is None: logging.error("PropertyManager.readFromRegistry: failed to obtain rootView " + group) raise UnknownPropertyException() return rootView.getHierarchicalPropertyValue(key)
def getPropertyValue(self, name): if name in self._getPropertySetInfo() and hasattr(self, name): return getattr(self, name) else: message = 'Cant getPropertyValue, UnknownProperty: %s' % name raise UnknownPropertyException(message, self)
def getPropertyByName(self, name): if name in self.properties: return self.properties[name] raise UnknownPropertyException("UnknownPropertyException", None)
def getPropertyByName(self, name): i = self.get_index(name) if i is None: raise UnknownPropertyException(name, self) p = self.props[i] return Property(*p)
def getPropertyValue(self, name): raise UnknownPropertyException(name, self)