<s> from calvin . runtime . south . plugins . async import threads <EOL> from calvin . runtime . south . plugins . io . display import base_display <EOL> import Adafruit_CharLCD as LCD <EOL> class Display ( base_display . DisplayBase ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . lcd = LCD . Adafruit_CharLCDPlate ( ) <EOL> self . defer = None <EOL> def enable ( self , enable ) : <EOL> self . lcd . set_backlight ( enable ) <EOL> self . clear ( ) <EOL> def cb_show_text ( self , * args , ** kwargs ) : <EOL> self . defer = None <EOL> def show_text ( self , text ) : <EOL> if self . defer is None : <EOL> self . clear ( ) <EOL> self . defer = threads . defer_to_thread ( self . lcd . message , text ) <EOL> self . defer . addCallback ( self . cb_show_text ) <EOL> self . defer . addErrback ( self . cb_show_text ) <EOL> def clear ( self ) : <EOL> self . lcd . clear ( ) </s>
