]> ToastFreeware Gitweb - chrisu/seepark.git/blobdiff - owm.py
wrap csv filenames in os.path.expanduser()
[chrisu/seepark.git] / owm.py
diff --git a/owm.py b/owm.py
index d42ebed28136758fbee389fd5ae73bba603156cf..878e3eba8c1dac4b37072189fcbd5f5b87b5ecea 100755 (executable)
--- a/owm.py
+++ b/owm.py
@@ -94,6 +94,7 @@ def main(configfile):
     config.read(configfile)
     apikey = config.get('openweathermap', 'apikey')
     cityid = config.get('openweathermap', 'cityid')
     config.read(configfile)
     apikey = config.get('openweathermap', 'apikey')
     cityid = config.get('openweathermap', 'cityid')
+    csvfile = config.get("openweathermap", 'csvfilename')
 
     weather_raw = getweather(apikey, cityid)
     if debug:
 
     weather_raw = getweather(apikey, cityid)
     if debug:
@@ -106,7 +107,7 @@ def main(configfile):
     # write to db
 
     # write to csv
     # write to db
 
     # write to csv
-    write_csv(config.get("openweathermap", 'csvfilename'), weather)
+    write_csv(os.path.expanduser(csvfile), weather)
 
 
 if __name__ == '__main__':
 
 
 if __name__ == '__main__':