<s> import os <EOL> import logging <EOL> import sys <EOL> from os . path import join as pjoin <EOL> import libcloud <EOL> import libcloud . security <EOL> from cliff . app import App <EOL> from raxcli . command_manager import AppCommandManager <EOL> from raxcli . actions import HelpAction <EOL> from raxcli import __version__ <EOL> CA_CERT_PATH = os . path . join ( os . path . abspath ( os . path . dirname ( __file__ ) ) , <EOL> '<STR_LIT>' ) <EOL> APPS_PATH = pjoin ( os . path . abspath ( os . path . dirname ( __file__ ) ) , '<STR_LIT>' ) <EOL> libcloud . security . CA_CERTS_PATH . insert ( <NUM_LIT:0> , CA_CERT_PATH ) <EOL> class RaxCliApp ( App ) : <EOL> log = logging . getLogger ( __name__ ) <EOL> DEFAULT_VERBOSE_LEVEL = <NUM_LIT:0> <EOL> def __init__ ( self ) : <EOL> super ( RaxCliApp , self ) . __init__ ( <EOL> description = '<STR_LIT>' , <EOL> version = __version__ , <EOL> command_manager = AppCommandManager ( '<STR_LIT>' , APPS_PATH ) , <EOL> ) <EOL> def build_option_parser ( self , description , version ) : <EOL> argparse_kwargs = { '<STR_LIT>' : '<STR_LIT>' } <EOL> parser = super ( RaxCliApp , self ) . build_option_parser ( description , <EOL> version , <EOL> argparse_kwargs = argparse_kwargs ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> action = HelpAction , <EOL> nargs = <NUM_LIT:0> , <EOL> default = self , <EOL> help = '<STR_LIT>' , <EOL> ) <EOL> return parser <EOL> def main ( argv = sys . argv [ <NUM_LIT:1> : ] ) : <EOL> if '<STR_LIT>' in argv : <EOL> file_path = '<STR_LIT>' <EOL> file_handle = open ( file_path , '<STR_LIT:a>' ) <EOL> libcloud . enable_debug ( file_handle ) <EOL> logging . basicConfig ( filename = file_path , <EOL> filemode = '<STR_LIT:w>' , <EOL> level = logging . DEBUG ) <EOL> myapp = RaxCliApp ( ) <EOL> return myapp . run ( argv ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( main ( sys . argv [ <NUM_LIT:1> : ] ) ) </s>
