Commit 0f4fabd3 authored by Tom Hartley's avatar Tom Hartley

Move the directory changing wizardry before it reads the config file, so that it still works.

parent 1b21d78e
......@@ -29,6 +29,11 @@ class DataPoint():
def mainUpload(stdscr):
try:
os.chdir(os.path.dirname(sys.argv[0]))
except:
pass
# Load the config file if it exists
if not os.path.isfile('AirPi.cfg'):
print "Unable to access config file : AirPi.cfg"
......@@ -60,12 +65,6 @@ def mainUpload(stdscr):
lcd.clear()
lcd.message("Air Quality and \nWeather Station")
try:
os.chdir(os.path.dirname(sys.argv[0]))
except:
pass
if not DEBUG:
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment