<s> from os . path import join as pjoin <EOL> from fabric . contrib . files import exists <EOL> from fabric . colors import yellow , green <EOL> from fabric . api import hide , settings , prefix , run <EOL> from utils import show , dir_exists , cget , remote_files_dir <EOL> def update_virtualenv ( ) : <EOL> """<STR_LIT>""" <EOL> ve_dir = cget ( "<STR_LIT>" ) <EOL> activate = pjoin ( ve_dir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> cache = cget ( "<STR_LIT>" ) <EOL> show ( yellow ( "<STR_LIT>" ) ) <EOL> show ( green ( "<STR_LIT>" ) ) <EOL> for req in cget ( '<STR_LIT>' ) : <EOL> requirements = pjoin ( remote_files_dir ( '<STR_LIT>' ) , req ) <EOL> show ( yellow ( "<STR_LIT>" % requirements ) ) <EOL> with settings ( warn_only = True ) : <EOL> with prefix ( "<STR_LIT>" % activate ) : <EOL> run ( "<STR_LIT>" <EOL> "<STR_LIT>" % <EOL> ( cache , requirements ) ) <EOL> def create_virtualenv ( ) : <EOL> """<STR_LIT>""" <EOL> ve_dir = cget ( "<STR_LIT>" ) <EOL> bin_path = pjoin ( ve_dir , "<STR_LIT>" ) <EOL> if not dir_exists ( bin_path ) or not exists ( pjoin ( bin_path , "<STR_LIT>" ) ) : <EOL> show ( yellow ( "<STR_LIT>" ) , ve_dir ) <EOL> with settings ( hide ( "<STR_LIT>" , "<STR_LIT>" ) ) : <EOL> run ( "<STR_LIT>" % ve_dir ) </s>
