<s> import wx <EOL> import os <EOL> class ImageList ( wx . ImageList ) : <EOL> def __init__ ( self , img_width , img_height ) : <EOL> wx . ImageList . __init__ ( self , img_width , img_height ) <EOL> def add ( self , image ) : <EOL> self . Add ( image ) <EOL> class ImageProvider ( object ) : <EOL> _BASE = os . path . dirname ( __file__ ) <EOL> def __init__ ( self , size = ( <NUM_LIT:16> , <NUM_LIT:16> ) ) : <EOL> self . _size = size <EOL> self . TESTCASEIMG = self . _load_image ( '<STR_LIT>' ) <EOL> self . KEYWORDIMG = self . _load_image ( '<STR_LIT>' ) <EOL> self . DATADIRIMG = self . _img_from_art_provider ( wx . ART_FOLDER ) <EOL> self . DATAFILEIMG = self . _img_from_art_provider ( wx . ART_NORMAL_FILE ) <EOL> self . PROGICONS = self . _load_prog_icons ( ) <EOL> self . REPORTIMG = self . _load_image ( '<STR_LIT>' ) <EOL> self . REFRESH_ALL = self . _load_image ( '<STR_LIT>' ) <EOL> self . KW_SEARCH_ICON = self . _load_image ( '<STR_LIT>' ) <EOL> self . TEST_SEARCH_ICON = self . _load_image ( '<STR_LIT>' ) <EOL> self . TOOLBAR_PLAY = self . _load_image ( '<STR_LIT>' ) <EOL> self . TOOLBAR_STOP = self . _load_image ( '<STR_LIT>' ) <EOL> self . TOOLBAR_PAUSE = self . _load_image ( '<STR_LIT>' ) <EOL> self . TOOLBAR_CONTINUE = self . _load_image ( '<STR_LIT>' ) <EOL> self . TOOLBAR_NEXT = self . _load_image ( '<STR_LIT>' ) <EOL> self . SWITCH_FIELDS_ICON = self . _load_image ( '<STR_LIT>' ) <EOL> self . _build_icons ( ) <EOL> def _build_icons ( self ) : <EOL> self . _icons = { } <EOL> for name in dir ( self ) : <EOL> value = getattr ( self , name ) <EOL> if isinstance ( value , wx . Bitmap ) : <EOL> self . _icons [ name ] = getattr ( self , name ) <EOL> def get_image_by_name ( self , name ) : <EOL> return self . _icons . get ( name , None ) <EOL> def _load_image ( self , name ) : <EOL> path = self . _get_img_path ( name ) <EOL> return wx . Image ( path , wx . BITMAP_TYPE_PNG ) . ConvertToBitmap ( ) <EOL> def _get_img_path ( self , name ) : <EOL> return os . path . join ( self . _BASE , name ) <EOL> def _img_from_art_provider ( self , source ) : <EOL> return wx . ArtProvider_GetBitmap ( source , wx . ART_OTHER , self . _size ) <EOL> def _load_prog_icons ( self ) : <EOL> icons = wx . IconBundle ( ) <EOL> icons . AddIconFromFile ( self . _get_img_path ( '<STR_LIT>' ) , <EOL> wx . BITMAP_TYPE_ANY ) <EOL> return icons </s>
