def GetModuleForCLSID(clsid):
 clsid_str = str(clsid)
 try:
  (typelibCLSID, lcid, major, minor) = clsidToTypelib[clsid_str]
 except KeyError:
  return None
 try:
  mod = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
 except ImportError:
  mod = None
 if (mod is not None):
  sub_mod = mod.CLSIDToPackageMap.get(clsid_str)
  if (sub_mod is None):
   sub_mod = mod.VTablesToPackageMap.get(clsid_str)
  if (sub_mod is not None):
   sub_mod_name = ((mod.__name__ + '.') + sub_mod)
   try:
    __import__(sub_mod_name)
   except ImportError:
    info = (typelibCLSID, lcid, major, minor)
    if (info in demandGeneratedTypeLibraries):
     info = demandGeneratedTypeLibraries[info]
    import makepy
    makepy.GenerateChildFromTypeLibSpec(sub_mod, info)
   mod = sys.modules[sub_mod_name]
 return mod

def GetModuleForCLSID ( clsid ) : clsid_str = str ( clsid ) try : ( typelibCLSID , lcid , major , minor ) = clsidToTypelib [ clsid_str ] except KeyError : return None try : mod = GetModuleForTypelib ( typelibCLSID , lcid , major , minor ) except ImportError : mod = None if ( mod is not None ) : sub_mod = mod . CLSIDToPackageMap . get ( clsid_str ) if ( sub_mod is None ) : sub_mod = mod . VTablesToPackageMap . get ( clsid_str ) if ( sub_mod is not None ) : sub_mod_name = ( ( mod . __name__ + '.' ) + sub_mod ) try : __import__ ( sub_mod_name ) except ImportError : info = ( typelibCLSID , lcid , major , minor ) if ( info in demandGeneratedTypeLibraries ) : info = demandGeneratedTypeLibraries [ info ] import makepy makepy . GenerateChildFromTypeLibSpec ( sub_mod , info ) mod = sys . modules [ sub_mod_name ] return mod
get a python module for a clsid given a clsid .