Logo Search packages:      
Sourcecode: qa-assistant version File versions  Download package

def properties::Properties::__setitem__ (   self,
  key,
  value 
)

Set a property to a value.

Override the default method so that we create new values when
passed an entire PropEntry.  If we are only passed a value for the
PropEntry, set the indicated Property's value if it exists.
If it doesn't exist, and you want to be able to set it, you need to
first add it by passing in a complete PropEntry struct.

Definition at line 72 of file properties.py.

00072                                      :
        '''Set a property to a value.

        Override the default method so that we create new values when
        passed an entire PropEntry.  If we are only passed a value for the
        PropEntry, set the indicated Property's value if it exists.
        If it doesn't exist, and you want to be able to set it, you need to
        first add it by passing in a complete PropEntry struct.
        '''
        if isinstance(value, PropEntry):
            self.storage[key] = value
            self._sortedKeys.append(key)
        else:
            try:
                attrib = self[key]
            except KeyError:
                raise KeyError, (
                        'This checklist has no %s Property' % (key))
            attrib.value = value
        self.emit('changed', key)
        if self._requirementsMet and self[key].propType == 'onload' and not (
                self[key].value or self[key].value == 0):
            self._requirementsMet = False

    def keys(self):


Generated by  Doxygen 1.6.0   Back to index