<s> def init_path ( ) : <EOL> import os <EOL> import dummy <EOL> file = dummy . __file__ <EOL> file = os . path . abspath ( file ) <EOL> while file and not os . path . isdir ( file ) : <EOL> file , ext = os . path . split ( file ) <EOL> os . chdir ( file ) <EOL> def init_logging ( ) : <EOL> import sys <EOL> import logging <EOL> logging . basicConfig ( <EOL> level = logging . DEBUG , <EOL> filename = '<STR_LIT>' , <EOL> filemode = '<STR_LIT:w>' , <EOL> format = '<STR_LIT>' , <EOL> datefmt = '<STR_LIT>' , <EOL> ) <EOL> if not hasattr ( sys , '<STR_LIT>' ) : <EOL> console = logging . StreamHandler ( sys . stdout ) <EOL> console . setLevel ( logging . DEBUG ) <EOL> formatter = logging . Formatter ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) <EOL> console . setFormatter ( formatter ) <EOL> logging . getLogger ( '<STR_LIT>' ) . addHandler ( console ) <EOL> def main ( ) : <EOL> init_path ( ) <EOL> init_logging ( ) <EOL> import wx <EOL> import ipc <EOL> import controller <EOL> container , message = ipc . init ( ) <EOL> if not container : <EOL> return <EOL> app = wx . PySimpleApp ( ) <EOL> wx . Log_SetActiveTarget ( wx . LogStderr ( ) ) <EOL> ctrl = controller . Controller ( ) <EOL> container . callback = ctrl . parse_args <EOL> container ( message ) <EOL> app . MainLoop ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
