 __author__ = '<STR_LIT>' <EOL> from django . utils . translation import ugettext as _ <EOL> def find_project_root ( contents ) : <EOL> MANIFEST = '<STR_LIT>' <EOL> SRC_DIR = '<STR_LIT>' <EOL> for base_dir in contents : <EOL> print base_dir <EOL> try : <EOL> dir_end = base_dir . index ( MANIFEST ) <EOL> print dir_end <EOL> except ValueError : <EOL> continue <EOL> else : <EOL> if dir_end + len ( MANIFEST ) != len ( base_dir ) : <EOL> print '<STR_LIT>' <EOL> continue <EOL> base_dir = base_dir [ : dir_end ] <EOL> print base_dir <EOL> for source_dir in contents : <EOL> if source_dir [ : dir_end ] != base_dir : <EOL> continue <EOL> if not source_dir . endswith ( '<STR_LIT>' ) and not source_dir . endswith ( '<STR_LIT>' ) : <EOL> continue <EOL> if source_dir [ dir_end : dir_end + len ( SRC_DIR ) ] != SRC_DIR : <EOL> continue <EOL> break <EOL> else : 
 continue 
 __author__ = '<STR_LIT>' <EOL> from django . utils . translation import ugettext as _ <EOL> def find_project_root ( contents ) : <EOL> MANIFEST = '<STR_LIT>' <EOL> SRC_DIR = '<STR_LIT>' <EOL> for base_dir in contents : <EOL> print base_dir <EOL> try : <EOL> dir_end = base_dir . index ( MANIFEST ) <EOL> print dir_end <EOL> except ValueError : <EOL> continue <EOL> else : <EOL> if dir_end + len ( MANIFEST ) != len ( base_dir ) : <EOL> print '<STR_LIT>' <EOL> continue <EOL> base_dir = base_dir [ : dir_end ] <EOL> print base_dir <EOL> for source_dir in contents : <EOL> if source_dir [ : dir_end ] != base_dir : <EOL> continue <EOL> if not source_dir . endswith ( '<STR_LIT>' ) and not source_dir . endswith ( '<STR_LIT>' ) : <EOL> continue <EOL> if source_dir [ dir_end : dir_end + len ( SRC_DIR ) ] != SRC_DIR : <EOL> continue <EOL> break <EOL> else : <EOL> continue <EOL> break <EOL> else : <EOL> raise Exception ( _ ( "<STR_LIT>" ) ) <EOL> return base_dir </s>
