#NEWLINE# def main( args = None ) : #NEWLINE# #INDENT# '\n    The main entry point of Pylease utility. Called when Pylease is launched from command line. May also be called from another python\n    package by just supplying command line arguments as a list.\n\n    :param args: List of command line arguments\n    :return: Error code indicating completion status\n    ' #NEWLINE# parser = ArgumentParser ( ) #NEWLINE# parser . add_argument ( '--version' , action = 'version' , version = version_info ( ) ) #NEWLINE# parser . add_argument ( '--verbose' , '-v' , action = 'store_true' , dest = 'verbose' , default = False , help = 'Make Pylease verbose, i.e. show more execution information' ) #NEWLINE# sub_parsers = parser . add_subparsers ( help = 'Pylease commands' , dest = 'command' ) #NEWLINE# info = InfoContainer ( ) #NEWLINE# if os . path . exists ( os . path . join ( os . getcwd ( ) , 'setup.py' ) ) : #NEWLINE# #INDENT# sys . path = ( [ os . getcwd ( ) ] + sys . path ) #NEWLINE# with ReplacedSetup ( info . set_info ) : #NEWLINE# #INDENT# __import__ ( 'setup' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# info . is_empty = True #NEWLINE# #UNINDENT# lizy = pylease . Pylease ( parser , sub_parsers , info ) #NEWLINE# Command . init_all ( lizy ) #NEWLINE# Extension . init_all ( lizy ) #NEWLINE# args = parser . parse_args ( args ) #NEWLINE# if args . verbose : #NEWLINE# #INDENT# logger . add_verbose_handler ( ) #NEWLINE# #UNINDENT# command_name = args . command #NEWLINE# return lizy . execute_command ( command_name , args )