def fix_paths(app_path, python_lib_path):
 if os.path.isfile(os.path.join(app_path, AUTO_IMPORT_FIXER_FILE)):
  return
 for (module_name, module) in sys.modules.items():
  if (getattr(module, '__path__', None) is None):
   continue
  module_app_path = os.path.join(app_path, *module_name.split('.'))
  module_init_file = os.path.join(module_app_path, '__init__.py')
  if (not os.path.isfile(module_init_file)):
   continue
  found_python_lib_path = False
  found_app_path = False
  for path in module.__path__:
   if path.startswith(python_lib_path):
    found_python_lib_path = True
   if path.startswith(app_path):
    found_app_path = True
  if (found_python_lib_path and (not found_app_path)):
   module.__path__.append(module_app_path)

def fix_paths ( app_path , python_lib_path ) : if os . path . isfile ( os . path . join ( app_path , AUTO_IMPORT_FIXER_FILE ) ) : return for ( module_name , module ) in sys . modules . items ( ) : if ( getattr ( module , '__path__' , None ) is None ) : continue module_app_path = os . path . join ( app_path , * module_name . split ( '.' ) ) module_init_file = os . path . join ( module_app_path , '__init__.py' ) if ( not os . path . isfile ( module_init_file ) ) : continue found_python_lib_path = False found_app_path = False for path in module . __path__ : if path . startswith ( python_lib_path ) : found_python_lib_path = True if path . startswith ( app_path ) : found_app_path = True if ( found_python_lib_path and ( not found_app_path ) ) : module . __path__ . append ( module_app_path )
coerce input arguments to use temporary files when used for output .