from radio_class import Radio from log_class import Log from rss_class import Rss UP = 0 DOWN = 1 CurrentStationFile = "/var/lib/radiod/current_station" CurrentTrackFile = "/var/lib/radiod/current_track" CurrentFile = CurrentStationFile # Instantiate classes log = Log() radio = Radio() rss = Rss() lcd = Adafruit_lcd() # Register exit routine def finish(): lcd.clear() radio.execCommand("umount /media > /dev/null 2>&1") radio.execCommand("umount /share > /dev/null 2>&1") lcd.line1("Radio stopped") atexit.register(finish) # Daemon class class MyDaemon(Daemon):
#!/usr/bin/env python # -*- coding: latin-1 -*- # Test program for the Adafruit Plate # $Id: test_ada_lcd.py,v 1.6 2016/03/13 14:20:50 bob Exp $ # # License: GNU V3, See https://www.gnu.org/copyleft/gpl.html # # Disclaimer: Software is provided as is and absolutly no warranties are implied or given. # The authors shall not be liable for any loss or damage however caused. # import atexit from time import sleep from ada_lcd_class import Adafruit_lcd lcd = Adafruit_lcd() def interrupt(): return False def finish(): lcd.clear() lcd.line1("Finished") atexit.register(finish) lcd.setWidth(16) color = False print "AdaFruit LCD display test"
#!/usr/bin/env python # -*- coding: latin-1 -*- # Test program for the Adafruit Plate # $Id: test_ada_lcd.py,v 1.6 2016/03/13 14:20:50 bob Exp $ # # License: GNU V3, See https://www.gnu.org/copyleft/gpl.html # # Disclaimer: Software is provided as is and absolutly no warranties are implied or given. # The authors shall not be liable for any loss or damage however caused. # import atexit from time import sleep from ada_lcd_class import Adafruit_lcd lcd = Adafruit_lcd() def interrupt(): return False def finish(): lcd.clear() lcd.line1("Finished") atexit.register(finish) lcd.setWidth(16) color = False