(path)
Get the module name, suffix, mode, and module type for a given file.
Get the module name, suffix, mode, and module type for a given file.
Get the module name suffix mode and module type for a given file .
def getmoduleinfo(path):
    """Get the module name, suffix, mode, and module type for a given file."""
    filename = os.path.basename(path)
    suffixes = [(-len(suffix), suffix, mode, mtype)
                    for suffix, mode, mtype in imp.get_suffixes()]
    suffixes.sort() # try longest suffixes first, in case they overlap
    for neglen, suffix, mode, mtype in suffixes:
        if filename[neglen:] == suffix:
            return ModuleInfo(filename[:neglen], suffix, mode, mtype)
def getmoduleinfo ( path ) : filename = os . path . basename ( path ) suffixes = [ ( - len ( suffix ) , suffix , mode , mtype ) for suffix , mode , mtype in imp . get_suffixes ( ) ] suffixes . sort ( ) # try longest suffixes first, in case they overlap for neglen , suffix , mode , mtype in suffixes : if filename [ neglen : ] == suffix : return ModuleInfo ( filename [ : neglen ] , suffix , mode , mtype )