def GetScriptModuleName(handler_path):
 if handler_path.startswith((PYTHON_LIB_VAR + '/')):
  handler_path = handler_path[len(PYTHON_LIB_VAR):]
 handler_path = os.path.normpath(handler_path)
 extension_index = handler_path.rfind('.py')
 if (extension_index != (-1)):
  handler_path = handler_path[:extension_index]
 module_fullname = handler_path.replace(os.sep, '.')
 module_fullname = module_fullname.strip('.')
 module_fullname = re.sub('\\.+', '.', module_fullname)
 if module_fullname.endswith('.__init__'):
  module_fullname = module_fullname[:(- len('.__init__'))]
 return module_fullname

def GetScriptModuleName ( handler_path ) : if handler_path . startswith ( ( PYTHON_LIB_VAR + '/' ) ) : handler_path = handler_path [ len ( PYTHON_LIB_VAR ) : ] handler_path = os . path . normpath ( handler_path ) extension_index = handler_path . rfind ( '.py' ) if ( extension_index != ( - 1 ) ) : handler_path = handler_path [ : extension_index ] module_fullname = handler_path . replace ( os . sep , '.' ) module_fullname = module_fullname . strip ( '.' ) module_fullname = re . sub ( '\\.+' , '.' , module_fullname ) if module_fullname . endswith ( '.__init__' ) : module_fullname = module_fullname [ : ( - len ( '.__init__' ) ) ] return module_fullname
determines the fully-qualified python module name of a script on disk .