def FindMissingInitFiles(cgi_path, module_fullname, isfile=os.path.isfile):
 missing_init_files = []
 if cgi_path.endswith('.py'):
  module_base = os.path.dirname(cgi_path)
 else:
  module_base = cgi_path
 depth_count = module_fullname.count('.')
 if (cgi_path.endswith('__init__.py') or (not cgi_path.endswith('.py'))):
  depth_count += 1
 for index in xrange(depth_count):
  current_init_file = os.path.abspath(os.path.join(module_base, '__init__.py'))
  if (not isfile(current_init_file)):
   missing_init_files.append(current_init_file)
  module_base = os.path.abspath(os.path.join(module_base, os.pardir))
 return missing_init_files

def FindMissingInitFiles ( cgi_path , module_fullname , isfile = os . path . isfile ) : missing_init_files = [ ] if cgi_path . endswith ( '.py' ) : module_base = os . path . dirname ( cgi_path ) else : module_base = cgi_path depth_count = module_fullname . count ( '.' ) if ( cgi_path . endswith ( '__init__.py' ) or ( not cgi_path . endswith ( '.py' ) ) ) : depth_count += 1 for index in xrange ( depth_count ) : current_init_file = os . path . abspath ( os . path . join ( module_base , '__init__.py' ) ) if ( not isfile ( current_init_file ) ) : missing_init_files . append ( current_init_file ) module_base = os . path . abspath ( os . path . join ( module_base , os . pardir ) ) return missing_init_files
determines which __init__ .