diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-28 20:51:50 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-03 14:12:09 +0200 |
| commit | 6f2126aa28d7715a8b65b4c7e427c72e32a6c28b (patch) | |
| tree | 7ad61de81d2702ef57c28ade3ffaa3c098979f1c /client/populate.py | |
| parent | c263709078c096faef891502e06cc9e9ade65777 (diff) | |
| download | jasper-client-6f2126aa28d7715a8b65b4c7e427c72e32a6c28b.tar.gz jasper-client-6f2126aa28d7715a8b65b4c7e427c72e32a6c28b.zip | |
Use config dir for non-temporary writable files
This is also a (partial) fix for issue jasperproject/jasper-client#119
Diffstat (limited to 'client/populate.py')
| -rw-r--r-- | client/populate.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/populate.py b/client/populate.py index d1cbb80..e871f26 100644 --- a/client/populate.py +++ b/client/populate.py @@ -1,10 +1,11 @@ # -*- coding: utf-8-*- +import os import re from getpass import getpass import yaml from pytz import timezone import feedparser - +import jasperpath def run(): profile = {} @@ -105,7 +106,9 @@ def run(): # write to profile print("Writing to profile...") - outputFile = open("profile.yml", "w") + if not os.path.exists(jasperpath.CONFIG_PATH): + os.makedirs(jasperpath.CONFIG_PATH) + outputFile = open(jasperpath.config("profile.yml"), "w") yaml.dump(profile, outputFile, default_flow_style=False) print("Done.") |
