From 138d22e035a25bce1c11388c3aa820a761748c65 Mon Sep 17 00:00:00 2001 From: Vinothan Shankar Date: Tue, 6 Jan 2015 14:17:42 +0000 Subject: [PATCH] Factor out thumbdrive name for slightly easier reuse --- tobabp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 tobabp.py diff --git a/tobabp.py b/tobabp.py old mode 100644 new mode 100755 index cf53bc6..107a871 --- a/tobabp.py +++ b/tobabp.py @@ -34,6 +34,9 @@ GPIO.setmode(GPIO.BCM) GPIO.setup(BUTTON, GPIO.IN) GPIO.setup(LED, GPIO.OUT) +# USB key FS label +USBNAME = "1GB" # 1GB is the name of my thumb drive + ## Some functions def mpdConnect(client, con_id): """ @@ -93,7 +96,7 @@ def main(): updateLED(client) while True: - device = checkForUSBDevice("1GB") # 1GB is the name of my thumb drive + device = checkForUSBDevice(USBNAME) if device != "": # USB thumb drive has been inserted, new music will be copied flashLED(0.1, 5) @@ -103,7 +106,7 @@ def main(): print client.status() flashLED(0.1, 5) # wait until thumb drive is umplugged again - while checkForUSBDevice("1GB") == device: + while checkForUSBDevice(USBNAME) == device: sleep(1.0) flashLED(0.1, 5) if GPIO.input(BUTTON) == True: