def fullmodname(path):
 comparepath = os.path.normcase(path)
 longest = ''
 for dir in sys.path:
  dir = os.path.normcase(dir)
  if (comparepath.startswith(dir) and (comparepath[len(dir)] == os.sep)):
   if (len(dir) > len(longest)):
    longest = dir
 if longest:
  base = path[(len(longest) + 1):]
 else:
  base = path
 base = base.replace(os.sep, '.')
 if os.altsep:
  base = base.replace(os.altsep, '.')
 (filename, ext) = os.path.splitext(base)
 return filename

def fullmodname ( path ) : comparepath = os . path . normcase ( path ) longest = '' for dir in sys . path : dir = os . path . normcase ( dir ) if ( comparepath . startswith ( dir ) and ( comparepath [ len ( dir ) ] == os . sep ) ) : if ( len ( dir ) > len ( longest ) ) : longest = dir if longest : base = path [ ( len ( longest ) + 1 ) : ] else : base = path base = base . replace ( os . sep , '.' ) if os . altsep : base = base . replace ( os . altsep , '.' ) ( filename , ext ) = os . path . splitext ( base ) return filename
return a plausible module name for the path .