Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
xpcom.server.loader Namespace Reference

Classes

class  PythonComponentLoader

Functions

def _has_good_attr
def FindCOMComponents
def register_self
def MakePythonComponentLoaderModule

Variables

int When_Startup = 0
int When_Component = 1
int When_Timer = 2

Function Documentation

def xpcom.server.loader._has_good_attr (   object,
  attr 
) [private]

Definition at line 53 of file loader.py.

00053 
00054 def _has_good_attr(object, attr):
00055     # Actually allows "None" to be specified to disable inherited attributes.
00056     return getattr(object, attr, None) is not None

Here is the caller graph for this function:

Definition at line 57 of file loader.py.

00057 
00058 def FindCOMComponents(py_module):
00059     # For now, just run over all classes looking for likely candidates.
00060     comps = []
00061     for name, object in py_module.__dict__.items():
00062         if type(object)==types.ClassType and \
00063            _has_good_attr(object, "_com_interfaces_") and \
00064            _has_good_attr(object, "_reg_clsid_") and \
00065            _has_good_attr(object, "_reg_contractid_"):
00066             comps.append(object)
00067     return comps

Here is the call graph for this function:

Here is the caller graph for this function:

def xpcom.server.loader.MakePythonComponentLoaderModule (   serviceManager,
  nsIFile 
)

Definition at line 223 of file loader.py.

00223 
00224 def MakePythonComponentLoaderModule(serviceManager, nsIFile):
00225     import module
00226     return module.Module( [PythonComponentLoader] )
def xpcom.server.loader.register_self (   klass,
  compMgr,
  location,
  registryLocation,
  componentType 
)

Definition at line 68 of file loader.py.

00068 
00069 def register_self(klass, compMgr, location, registryLocation, componentType):
00070     pcl = PythonComponentLoader
00071     from xpcom import _xpcom
00072     svc = _xpcom.GetServiceManager().getServiceByContractID("@mozilla.org/categorymanager;1", components.interfaces.nsICategoryManager)
00073     svc.addCategoryEntry("component-loader", pcl._reg_component_type_, pcl._reg_contractid_, 1, 1)


Variable Documentation

Definition at line 50 of file loader.py.

Definition at line 49 of file loader.py.

Definition at line 51 of file loader.py.