diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-04 13:05:09 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-10-04 13:05:09 +0200 |
| commit | 3966d2f86a251f372a7a17f39108925ab9459974 (patch) | |
| tree | 6b8c45a01ceb00f12faa21d02ad07977894813df /client/populate.py | |
| parent | 4c22cd55978cd6d3b2abe51a12447f75992d9f1f (diff) | |
| parent | 5ce3b07d0bc52c06dc1b184a144e87bab22c1d5d (diff) | |
| download | jasper-client-3966d2f86a251f372a7a17f39108925ab9459974.tar.gz jasper-client-3966d2f86a251f372a7a17f39108925ab9459974.zip | |
Merge pull request #203 from Holzhaus/good-riddance-dear-writable-app-dir
Use config dir for non-temporary writable files
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.") |
