Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
xpcom.components._Interface Class Reference

List of all members.

Public Member Functions

def __init__
def __cmp__
def __hash__
def __str__
def __getitem__
def __setitem__
def __setattr__
def __getattr__

Detailed Description

Definition at line 111 of file components.py.


Constructor & Destructor Documentation

def xpcom.components._Interface.__init__ (   self,
  name,
  iid 
)

Definition at line 113 of file components.py.

00113 
00114     def __init__(self, name, iid):
00115         # Bypass self.__setattr__ when initializing attributes.
00116         d = self.__dict__
00117         d['_iidobj_'] = iid # Allows the C++ framework to treat this as a native IID.
        d['name'] = name

Member Function Documentation

def xpcom.components._Interface.__cmp__ (   self,
  other 
)

Definition at line 118 of file components.py.

00118 
00119     def __cmp__(self, other):
00120         this_iid = self._iidobj_
00121         other_iid = getattr(other, "_iidobj_", other)
        return cmp(this_iid, other_iid)
def xpcom.components._Interface.__getattr__ (   self,
  attr 
)

Definition at line 132 of file components.py.

00132 
00133     def __getattr__(self, attr):
00134         # Support constants as attributes.
00135         c = _constants_by_iid_map.get(self._iidobj_)
00136         if c is None:
00137             c = {}
00138             i = xpt.Interface(self._iidobj_)
00139             for c_ob in i.constants:
00140                 c[c_ob.name] = c_ob.value
00141             _constants_by_iid_map[self._iidobj_] = c
00142         if c.has_key(attr):
00143             return c[attr]
00144         raise AttributeError, "'%s' interfaces do not define a constant '%s'" % (self.name, attr)
00145 

def xpcom.components._Interface.__getitem__ (   self,
  item 
)

Definition at line 126 of file components.py.

00126 
00127     def __getitem__(self, item):
        raise TypeError, "components.interface objects are not subscriptable"

Definition at line 122 of file components.py.

00122 
00123     def __hash__(self):
        return hash(self._iidobj_)

Here is the call graph for this function:

def xpcom.components._Interface.__setattr__ (   self,
  attr,
  value 
)

Definition at line 130 of file components.py.

00130 
00131     def __setattr__(self, attr, value):
        raise AttributeError, "Can not set attributes on components.Interface objects"
def xpcom.components._Interface.__setitem__ (   self,
  item,
  value 
)

Definition at line 128 of file components.py.

00128 
00129     def __setitem__(self, item, value):
        raise TypeError, "components.interface objects are not subscriptable"

Definition at line 124 of file components.py.

00124 
00125     def __str__(self):
        return str(self._iidobj_)

The documentation for this class was generated from the following file: