<s> """<STR_LIT>""" <EOL> import os <EOL> from fabric . api import cd <EOL> def finalize ( genomes , env ) : <EOL> """<STR_LIT>""" <EOL> genome_dir = os . path . join ( env . data_files , "<STR_LIT>" ) <EOL> for ( orgname , gid , manager ) in genomes : <EOL> org_dir = os . path . join ( genome_dir , orgname ) <EOL> for aligner in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> aligner_dir = os . path . join ( org_dir , gid , aligner ) <EOL> if env . safe_exists ( aligner_dir ) : <EOL> with cd ( aligner_dir ) : <EOL> for ext in [ "<STR_LIT>" , "<STR_LIT>" ] : <EOL> orig_seq = os . path . join ( os . pardir , "<STR_LIT>" , "<STR_LIT>" % ( gid , ext ) ) <EOL> if env . safe_exists ( orig_seq ) and not env . safe_exists ( os . path . basename ( orig_seq ) ) : <EOL> env . safe_run ( "<STR_LIT>" % orig_seq ) <EOL> def cleanup ( genomes , env ) : <EOL> """<STR_LIT>""" <EOL> folder_name = "<STR_LIT>" <EOL> genome_dir = os . path . join ( env . data_files , "<STR_LIT>" ) <EOL> for ( orgname , gid , manager ) in genomes : <EOL> org_dir = os . path . join ( genome_dir , orgname ) <EOL> target_dir = os . path . join ( org_dir , gid , folder_name ) <EOL> if env . hosts == [ "<STR_LIT:localhost>" ] : <EOL> if os . path . lexists ( target_dir ) and os . path . islink ( target_dir ) : <EOL> os . remove ( target_dir ) </s>
