def GetPackageModuleName(fileName):
 (path, fname) = os.path.split(fileName)
 path = origPath = win32ui.FullPath(path)
 fname = os.path.splitext(fname)[0]
 modBits = []
 newPathReturn = None
 if (not IsOnPythonPath(path)):
  while (len(path) > 3):
   (path, modBit) = os.path.split(path)
   modBits.append(modBit)
   if (IsOnPythonPath(path) and (modBit in sys.modules) and (os.path.exists(os.path.join(path, '__init__.py')) or os.path.exists(os.path.join(path, '__init__.pyc')) or os.path.exists(os.path.join(path, '__init__.pyo')))):
    modBits.reverse()
    return ((('.'.join(modBits) + '.') + fname), newPathReturn)
  else:
   newPathReturn = origPath
 return (fname, newPathReturn)

def GetPackageModuleName ( fileName ) : ( path , fname ) = os . path . split ( fileName ) path = origPath = win32ui . FullPath ( path ) fname = os . path . splitext ( fname ) [ 0 ] modBits = [ ] newPathReturn = None if ( not IsOnPythonPath ( path ) ) : while ( len ( path ) > 3 ) : ( path , modBit ) = os . path . split ( path ) modBits . append ( modBit ) if ( IsOnPythonPath ( path ) and ( modBit in sys . modules ) and ( os . path . exists ( os . path . join ( path , '__init__.py' ) ) or os . path . exists ( os . path . join ( path , '__init__.pyc' ) ) or os . path . exists ( os . path . join ( path , '__init__.pyo' ) ) ) ) : modBits . reverse ( ) return ( ( ( '.' . join ( modBits ) + '.' ) + fname ) , newPathReturn ) else : newPathReturn = origPath return ( fname , newPathReturn )
given a filename .