<s> import json <EOL> from value_controller import ValueController <EOL> class RTValController ( ValueController ) : <EOL> def __init__ ( self , name , dataType , value , editable = True , ** kwargs ) : <EOL> super ( RTValController , self ) . __init__ ( name , dataType = dataType , editable = editable , ** kwargs ) <EOL> self . rtval = value <EOL> def _setValue_NoUndo ( self , value ) : <EOL> self . rtval = value <EOL> self . valueChanged . emit ( self . getValue ( ) ) <EOL> def getValue ( self ) : <EOL> return self . _extractSimpleTypes ( self . rtval ) <EOL> def setRTVal ( self , rtval ) : <EOL> self . rtval = rtval <EOL> self . valueChanged . emit ( self . getValue ( ) ) <EOL> class RTValGetterSetterController ( ValueController ) : <EOL> def __init__ ( self , name , dataType , getter = None , setter = None , ** kwargs ) : <EOL> super ( RTValGetterSetterController , self ) . __init__ ( name , dataType = dataType , editable = ( getter is not None and setter is not None ) , ** kwargs ) <EOL> self . getter = getter <EOL> self . setter = setter <EOL> self . rtval = None <EOL> if self . getter is None : <EOL> self . rtval = FE . getInstance ( ) . rtVal ( dataType ) <EOL> def _setValue_NoUndo ( self , value ) : <EOL> if self . setter is None : <EOL> self . rtval = value <EOL> else : <EOL> self . setter ( '<STR_LIT>' , value ) <EOL> self . valueChanged . emit ( self . getValue ( ) ) <EOL> def getValue ( self ) : <EOL> if self . getter is None : <EOL> return self . _extractSimpleTypes ( self . rtval ) <EOL> else : <EOL> return self . _extractSimpleTypes ( self . getter ( self . getDataType ( ) ) ) <EOL> def setGetter ( self , getter ) : <EOL> self . getter = getter <EOL> self . rtval = self . getter ( self . getDataType ( ) ) <EOL> self . valueChanged . emit ( self . getValue ( ) ) <EOL> def setGetterSetter ( self , getter , setter ) : <EOL> self . getter = getter <EOL> self . setter = setter <EOL> self . rtval = getter ( self . getDataType ( ) ) <EOL> self . setEditable ( self . setter is not None ) <EOL> self . valueChanged . emit ( self . getValue ( ) ) </s>
