Package flumotion :: Package wizard :: Module models :: Class Properties
[hide private]

Class Properties

source code

object --+    
         |    
      dict --+
             |
            Properties

I am a special dictionary which you also can treat as an instance. Setting and getting an attribute works. This is suitable for using in a kiwi proxy. >>> p = Properties() >>> p.attr = 'value' >>> p <Properties {'attr': 'value'}>

Note that you cannot insert the attributes which has the same name as dictionary methods, such as 'keys', 'values', 'items', 'update'.

Underscores are converted to dashes when setting attributes, eg:

>>> p.this_is_outrageous = True
>>> p
<Properties {'this-is-outrageous': True}>
Instance Methods [hide private]
 
__setitem__(self, attr, value)
x[i]=y
source code
 
__setattr__(self, attr, value)
x.__setattr__('name', value) <==> x.name = value
source code
 
__getattr__(self, attr) source code
 
__delattr__(self, attr)
x.__delattr__('name') <==> del x.name
source code
True if D has a key k, else False
__contains__(self, value) source code
 
__repr__(self)
repr(x)
source code

Inherited from dict: __cmp__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __init__, __iter__, __le__, __len__, __lt__, __ne__, __new__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __reduce__, __reduce_ex__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__setitem__(self, attr, value)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

__setattr__(self, attr, value)

source code 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__
(inherited documentation)

__delattr__(self, attr)

source code 

x.__delattr__('name') <==> del x.name

Overrides: object.__delattr__
(inherited documentation)

__contains__(self, value)
(In operator)

source code 
Returns: True if D has a key k, else False
Overrides: dict.__contains__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)