<s> import sys <EOL> from argparse import RawDescriptionHelpFormatter , ArgumentParser <EOL> from stoq . core import Stoq <EOL> from stoq . shell import StoqShell <EOL> from stoq . logo import print_logo <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> stoq = Stoq ( argv = sys . argv ) <EOL> parser = ArgumentParser ( formatter_class = RawDescriptionHelpFormatter , <EOL> description = print_logo ( ) , <EOL> usage = '''<STR_LIT>''' , <EOL> epilog = '''<STR_LIT>''' ) <EOL> parser . add_argument ( "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> options = parser . parse_args ( stoq . argv [ <NUM_LIT:1> : <NUM_LIT:2> ] ) <EOL> if not options . command or options . command == '<STR_LIT>' : <EOL> parser . print_help ( ) <EOL> elif options . command == "<STR_LIT:list>" : <EOL> stoq . list_plugins ( ) <EOL> elif options . command == "<STR_LIT>" : <EOL> from stoq . plugins import StoqPluginInstaller <EOL> installer = StoqPluginInstaller ( stoq ) <EOL> installer . install ( ) <EOL> elif options . command == "<STR_LIT>" : <EOL> StoqShell ( stoq ) . cmdloop ( ) <EOL> else : <EOL> worker = stoq . load_plugin ( options . command , '<STR_LIT>' ) <EOL> if not worker : <EOL> exit ( - <NUM_LIT:1> ) <EOL> worker . run ( ) <EOL> exit ( <NUM_LIT:0> ) </s>
