<s> import sys <EOL> import os <EOL> import getopt <EOL> import shutil <EOL> import play . commands . precompile <EOL> from play . utils import * <EOL> COMMANDS = [ "<STR_LIT>" ] <EOL> HELP = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> def execute ( ** kargs ) : <EOL> command = kargs . get ( "<STR_LIT>" ) <EOL> app = kargs . get ( "<STR_LIT>" ) <EOL> args = kargs . get ( "<STR_LIT:args>" ) <EOL> env = kargs . get ( "<STR_LIT>" ) <EOL> war_path = None <EOL> war_zip_path = None <EOL> war_exclusion_list = [ ] <EOL> try : <EOL> optlist , args = getopt . getopt ( args , '<STR_LIT>' , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> for o , a in optlist : <EOL> if o in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> war_path = os . path . normpath ( os . path . abspath ( a ) ) <EOL> for o , a in optlist : <EOL> if o in ( '<STR_LIT>' ) : <EOL> war_zip_path = war_path + '<STR_LIT>' <EOL> if o in ( '<STR_LIT>' ) : <EOL> war_exclusion_list = a . split ( '<STR_LIT::>' ) <EOL> print "<STR_LIT>" <EOL> for excluded in war_exclusion_list : <EOL> print "<STR_LIT>" % excluded <EOL> except getopt . GetoptError , err : <EOL> print "<STR_LIT>" % str ( err ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> if not war_path : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> if os . path . exists ( war_path ) and not os . path . exists ( os . path . join ( war_path , '<STR_LIT>' ) ) : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> if isParentOf ( app . path , war_path ) and not isExcluded ( war_path , war_exclusion_list ) : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> precompilation_result = play . commands . precompile . execute ( command = command , app = app , args = args , env = env ) <EOL> if precompilation_result != <NUM_LIT:0> : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> sys . exit ( precompilation_result ) <EOL> package_as_war ( app , env , war_path , war_zip_path , war_exclusion_list ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % ( os . path . normpath ( war_path ) ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" </s>
