<s> import textwrap <EOL> import subprocess <EOL> import os <EOL> import shutil <EOL> import sys <EOL> from depl import main <EOL> from depl import config <EOL> def main_run ( args ) : <EOL> config . _recursion_paths = [ ] <EOL> old , sys . argv = sys . argv , args <EOL> main ( ) <EOL> sys . argv = old <EOL> def run ( cmd ) : <EOL> p = subprocess . Popen ( cmd , shell = True , stdout = subprocess . PIPE ) <EOL> stdout , stderr = p . communicate ( ) <EOL> if p . returncode != <NUM_LIT:0> : <EOL> raise subprocess . CalledProcessError ( p . returncode , cmd ) <EOL> return stdout <EOL> def config_file ( code , file_name = "<STR_LIT>" ) : <EOL> def decorator ( func ) : <EOL> def wrapper ( tmpdir ) : <EOL> p = tmpdir . join ( file_name ) <EOL> p . write ( textwrap . dedent ( code ) ) <EOL> path = os . getcwd ( ) <EOL> try : <EOL> print str ( tmpdir ) <EOL> os . chdir ( str ( tmpdir ) ) <EOL> return func ( tmpdir ) <EOL> finally : <EOL> os . chdir ( path ) <EOL> return wrapper <EOL> return decorator <EOL> def move_dir_content ( from_path , to_path ) : <EOL> for file in os . listdir ( from_path ) : <EOL> path = os . path . join ( from_path , file ) <EOL> if os . path . isdir ( path ) : <EOL> shutil . copytree ( path , os . path . join ( to_path , file ) ) <EOL> else : <EOL> shutil . copy ( path , to_path ) </s>
