Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
xpcom.client._Interface Class Reference
Inheritance diagram for xpcom.client._Interface:
Inheritance graph
[legend]
Collaboration diagram for xpcom.client._Interface:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def __getattr__
def __setattr__
def __repr__
def __cmp__
def __hash__
def __str__
def __int__
def __long__
def __float__

Detailed Description

Definition at line 373 of file __init__.py.


Constructor & Destructor Documentation

def xpcom.client._Interface.__init__ (   self,
  comobj,
  iid,
  method_infos,
  getters,
  setters,
  constants 
)

Definition at line 374 of file __init__.py.

00374 
00375     def __init__(self, comobj, iid, method_infos, getters, setters, constants):
00376         self.__dict__['_comobj_'] = comobj
00377         self.__dict__['_iid_'] = iid
00378         self.__dict__['_property_getters_'] = getters
00379         self.__dict__['_property_setters_'] = setters
00380         self.__dict__['_method_infos_'] = method_infos # method infos waiting to be turned into real methods.
00381         self.__dict__['_methods_'] = {} # unbound methods
00382         self.__dict__['_object_name_'] = iid.name
00383         self.__dict__.update(constants)
00384         # We remember the constant names to prevent the user trying to assign to them!
00385         self.__dict__['_constant_names_'] = constants.keys()


Member Function Documentation

def xpcom.client._XPCOMBase.__cmp__ (   self,
  other 
) [inherited]

Definition at line 169 of file __init__.py.

00169 
00170     def __cmp__(self, other):
00171         try:
00172             other = other._comobj_
00173         except AttributeError:
00174             pass
00175         return cmp(self._comobj_, other)

def xpcom.client._XPCOMBase.__float__ (   self) [inherited]

Definition at line 205 of file __init__.py.

00205 
00206     def __float__(self):
        return self._do_conversion(_float_interfaces, float)

Here is the call graph for this function:

def xpcom.client._Interface.__getattr__ (   self,
  attr 
)

Definition at line 386 of file __init__.py.

00386 
00387     def __getattr__(self, attr):
00388         # Allow the underlying interface to provide a better implementation if desired.
00389         if attr in _special_getattr_names:
00390             raise AttributeError, attr
00391 
00392         ret = getattr(self.__dict__['_comobj_'], attr, None)
00393         if ret is not None:
00394             return ret
00395         # Do the function thing first.
00396         unbound_method = self.__dict__['_methods_'].get(attr, None)
00397         if unbound_method is not None:
00398             return new.instancemethod(unbound_method, self, self.__class__)
00399 
00400         getters = self.__dict__['_property_getters_']
00401         info = getters.get(attr)
00402         if info is not None:
00403             method_index, param_infos = info
00404             if len(param_infos)!=1: # Only expecting a retval
00405                 raise RuntimeError, "Can't get properties with this many args!"
00406             args = ( param_infos, () )
00407             return XPTC_InvokeByIndex(self, method_index, args)
00408 
00409         # See if we have a method info waiting to be turned into a method.
00410         # Do this last as it is a one-off hit.
00411         method_info = self.__dict__['_method_infos_'].get(attr, None)
00412         if method_info is not None:
00413             unbound_method = BuildMethod(method_info, self._iid_)
00414             # Cache it locally
00415             self.__dict__['_methods_'][attr] = unbound_method
00416             return new.instancemethod(unbound_method, self, self.__class__)
00417 
00418         raise AttributeError, "XPCOM component '%s' has no attribute '%s'" % (self._object_name_, attr)

Here is the call graph for this function:

def xpcom.client._XPCOMBase.__hash__ (   self) [inherited]

Definition at line 176 of file __init__.py.

00176 
00177     def __hash__(self):
00178         return hash(self._comobj_)

Here is the call graph for this function:

def xpcom.client._XPCOMBase.__int__ (   self) [inherited]

Definition at line 199 of file __init__.py.

00199 
00200     def __int__(self):
00201         return self._do_conversion(_int_interfaces, int)

Here is the call graph for this function:

def xpcom.client._XPCOMBase.__long__ (   self) [inherited]

Definition at line 202 of file __init__.py.

00202 
00203     def __long__(self):
00204         return self._do_conversion(_long_interfaces, long)

Here is the call graph for this function:

Definition at line 436 of file __init__.py.

00436 
00437     def __repr__(self):
00438         return "<XPCOM interface '%s'>" % (self._object_name_,)
00439 
00440 
00441 # Called by the _xpcom C++ framework to wrap interfaces up just
# before they are returned.

Here is the caller graph for this function:

def xpcom.client._Interface.__setattr__ (   self,
  attr,
  val 
)

Definition at line 419 of file __init__.py.

00419 
00420     def __setattr__(self, attr, val):
00421         # If we already have a __dict__ item of that name, and its not one of
00422         # our constants, we just directly set it, and leave.
00423         if self.__dict__.has_key(attr) and attr not in self.__dict__['_constant_names_']:
00424             self.__dict__[attr] = val
00425             return
00426         # Start sniffing for what sort of attribute this might be?
00427         setters = self.__dict__['_property_setters_']
00428         info = setters.get(attr)
00429         if info is None:
00430             raise AttributeError, "XPCOM component '%s' can not set attribute '%s'" % (self._object_name_, attr)
00431         method_index, param_infos = info
00432         if len(param_infos)!=1: # Only expecting a single input val
00433             raise RuntimeError, "Can't set properties with this many args!"
00434         real_param_infos = ( param_infos, (val,) )
00435         return XPTC_InvokeByIndex(self, method_index, real_param_infos)

Here is the call graph for this function:

def xpcom.client._XPCOMBase.__str__ (   self) [inherited]

Definition at line 180 of file __init__.py.

00180 
00181     def __str__(self):
00182         try:
00183             self._comobj_.QueryInterface(IID_nsISupportsCString, 0)
00184             return str(self._comobj_)
00185         except COMException:
00186             return self.__repr__()

Here is the call graph for this function:


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