From 5c6db5193d72cf84da307fe3b777deeb90cb2ab2 Mon Sep 17 00:00:00 2001 From: Pecusx Date: Mon, 31 Oct 2016 18:56:33 +0100 Subject: [PATCH] New place for version number (better update procedure?) --- radio_class.py | 8 ++++++-- version | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 version diff --git a/radio_class.py b/radio_class.py index 6d38dee..5ce1a5b 100755 --- a/radio_class.py +++ b/radio_class.py @@ -51,6 +51,7 @@ TimerFile = RadioLibDir + "/timer" AlarmFile = RadioLibDir + "/alarm" StreamFile = RadioLibDir + "/streaming" BoardRevisionFile = RadioLibDir + "/boardrevision" +VersionFile = "/usr/share/radio/version" log = Log() translate = Translate() @@ -113,6 +114,7 @@ class Radio: ONEDAYSECS = 86400 # Day in seconds ONEDAYMINS = 1440 # Day in minutes + version = "0.0" boardrevision = 2 # Raspberry board version type udphost = 'localhost' # Remote IR listener UDP Host udpport = 5100 # Remote IR listener UDP port number @@ -187,7 +189,6 @@ class Radio: pandora_search_index = 0 loadnew = False # Load new track from search streaming = False # Streaming (Icecast) disabled - VERSION = "5.4c" # Version number ADAFRUIT = 1 # I2C backpack type AdaFruit PCF8574 = 2 # I2C backpack type PCF8574 @@ -220,6 +221,9 @@ class Radio: if not os.path.isfile(CurrentStationFile): self.execCommand ("mkdir -p " + RadioLibDir ) + # Get version from file + self.version = self.readFromFile(VersionFile) # (Pecus) + # Initialise configuration files from ConfigFiles list for file in self.ConfigFiles: value = self.ConfigFiles[file] @@ -2506,7 +2510,7 @@ class Radio: # Version number def getVersion(self): - return self.VERSION + return self.version # Get the the backlight color number (option = bg_color etc) def getBackColor(self,option): diff --git a/version b/version new file mode 100644 index 0000000..c39d9c0 --- /dev/null +++ b/version @@ -0,0 +1 @@ +5.4c