<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> import glob <EOL> import Options <EOL> import Common <EOL> import Analyzer <EOL> from common import Project <EOL> from common import Log <EOL> from common import Resource <EOL> from common import Console <EOL> def getAvailableProjectFiles ( ) : <EOL> projectFiles = sorted ( glob . glob ( os . path . join ( Resource . getPath ( "<STR_LIT>" ) , "<STR_LIT>" ) ) ) <EOL> projectNames = [ os . path . basename ( p ) for p in projectFiles ] <EOL> projectNames = [ p . split ( "<STR_LIT:.>" ) [ <NUM_LIT:0> ] for p in projectNames ] <EOL> return zip ( projectFiles , projectNames ) <EOL> def main ( args ) : <EOL> options , args = Options . parseCommandLine ( args ) <EOL> if options . verbose : <EOL> Log . quiet = False <EOL> if options . quiet : <EOL> Log . quiet = True <EOL> if not options . project : <EOL> projectFiles = getAvailableProjectFiles ( ) <EOL> try : <EOL> projectFile = projectFiles [ Console . chooseIndex ( "<STR_LIT>" , [ f [ <NUM_LIT:1> ] for f in projectFiles ] ) ] [ <NUM_LIT:0> ] <EOL> except TypeError : <EOL> return <EOL> else : <EOL> projectFile = options . project <EOL> project = Project . Project ( options = options , fileName = projectFile ) <EOL> analyzer = Analyzer . InteractiveAnalyzer ( project , options ) <EOL> if options . execute : <EOL> for command in options . execute : <EOL> try : <EOL> analyzer . execute ( command ) <EOL> except Analyzer . ExecutionError : <EOL> return <NUM_LIT:1> <EOL> analyzer . run ( ) <EOL> return <NUM_LIT:0> <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> sys . exit ( main ( sys . argv [ <NUM_LIT:1> : ] ) ) </s>
