<s> from ajenti . api import plugin <EOL> from ajenti . plugins . dashboard . api import ConfigurableWidget <EOL> from api import RAIDManager <EOL> @ plugin <EOL> class LSIWidget ( ConfigurableWidget ) : <EOL> name = '<STR_LIT>' <EOL> icon = '<STR_LIT>' <EOL> def on_prepare ( self ) : <EOL> self . mgr = RAIDManager . get ( ) <EOL> self . append ( self . ui . inflate ( '<STR_LIT>' ) ) <EOL> def on_start ( self ) : <EOL> self . mgr . refresh ( ) <EOL> self . find ( '<STR_LIT>' ) . text = self . config [ '<STR_LIT>' ] <EOL> arr = self . mgr . find_array ( self . config [ '<STR_LIT>' ] ) <EOL> if arr : <EOL> self . find ( '<STR_LIT:value>' ) . text = arr . state <EOL> def create_config ( self ) : <EOL> return { '<STR_LIT>' : '<STR_LIT>' } <EOL> def on_config_start ( self ) : <EOL> self . mgr . refresh ( ) <EOL> lst = list ( self . mgr . list_arrays ( ) ) <EOL> v_list = self . dialog . find ( '<STR_LIT>' ) <EOL> v_list . labels = lst <EOL> v_list . values = lst <EOL> v_list . value = self . config [ '<STR_LIT>' ] <EOL> def on_config_save ( self ) : <EOL> self . config [ '<STR_LIT>' ] = self . dialog . find ( '<STR_LIT>' ) . value </s>
