Back to index

salome-kernel  6.5.0
Functions | Variables
KERNEL_PY.omnipatch Namespace Reference

Functions

def openModule
def newModule
def updateModule

Variables

dictionary _partialModules = {}
dictionary shared_imported = {}

Function Documentation

Definition at line 88 of file omnipatch.py.

00088 
00089 def newModule(mname):
00090     # Salome modification start
00091     # Be sure to use the right module dictionnary
00092     import sys
00093     # Salome modification end
00094 
00095     mlist   = string.split(mname, ".")
00096     current = ""
00097     mod     = None
00098 
00099     for name in mlist:
00100         current = current + name
00101 
00102         if sys.modules.has_key(current):
00103             mod = sys.modules[current]
00104 
00105         elif _partialModules.has_key(current):
00106             mod = _partialModules[current]
00107 
00108         else:
00109             newmod = imp.new_module(current)
00110             if mod: setattr(mod, name, newmod)
00111             _partialModules[current] = mod = newmod
00112 
00113         current = current + "."
00114 
00115     return mod
00116 
00117 # Function to update a module with the partial module store in the
# partial module map

Here is the caller graph for this function:

def KERNEL_PY.omnipatch.openModule (   mname,
  fname = None 
)

Definition at line 42 of file omnipatch.py.

00042 
00043 def openModule(mname, fname=None):
00044     # Salome modification start
00045     # Be sure to use the right module dictionnary
00046     import sys
00047     # Salome modification end
00048 
00049     if mname == "CORBA":
00050         mod = sys.modules["omniORB.CORBA"]
00051         # Salome modification start
00052         shared_imported[mname]=mod
00053         # Salome modification end
00054 
00055     elif sys.modules.has_key(mname):
00056         mod = sys.modules[mname]
00057 
00058         if _partialModules.has_key(mname):
00059             pmod = _partialModules[mname]
00060             mod.__dict__.update(pmod.__dict__)
00061             del _partialModules[mname]
00062         # Salome modification start
00063         shared_imported[mname]=mod
00064         # Salome modification end
00065 
00066     elif _partialModules.has_key(mname):
00067         mod = _partialModules[mname]
00068 
00069     # Salome modification start
00070     elif shared_imported.get(mname) :
00071         mod = shared_imported[mname]
00072     # Salome modification end
00073 
00074     else:
00075         mod = newModule(mname)
00076 
00077 
00078     if not hasattr(mod, "__doc__") or mod.__doc__ is None:
00079         mod.__doc__ = "omniORB IDL module " + mname + "\n\n" + \
00080                       "Generated from:\n\n"
00081 
00082     if fname is not None:
00083         mod.__doc__ = mod.__doc__ + "  " + fname + "\n"
00084 
00085     return mod
00086 
00087 # Function to create a new module, and any parent modules which do not
# already exist

Here is the call graph for this function:

Definition at line 118 of file omnipatch.py.

00118 
00119 def updateModule(mname):
00120     # Salome modification start
00121     # Be sure to use the right module dictionnary
00122     import sys
00123     # Salome modification end
00124     if _partialModules.has_key(mname):
00125         pmod = _partialModules[mname]
00126         mod  = sys.modules[mname]
00127         mod.__dict__.update(pmod.__dict__)
00128         del _partialModules[mname]
00129 
00130     # Salome modification start
00131     shared_imported[mname]=sys.modules[mname]
00132     # Salome modification end
00133 
00134 omniORB.updateModule=updateModule
00135 omniORB.newModule=newModule
00136 omniORB.openModule=openModule
00137 

Variable Documentation

Definition at line 37 of file omnipatch.py.

Definition at line 39 of file omnipatch.py.