chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
de1afc3
)
make sure config exists before writing to it
author
Marcus Hoffmann
<bubuiic@aol.com>
Thu, 14 Sep 2017 00:13:49 +0000
(
02:13
+0200)
committer
Marcus Hoffmann
<bubuiic@aol.com>
Thu, 14 Sep 2017 00:15:57 +0000
(
02:15
+0200)
fdroidserver/common.py
patch
|
blob
|
history
diff --git
a/fdroidserver/common.py
b/fdroidserver/common.py
index 182949d928ecc8162d29b6e0b385f0b7f451ab97..fe0462c787716973d3a2ca71f0dd916c578e63bc 100644
(file)
--- a/
fdroidserver/common.py
+++ b/
fdroidserver/common.py
@@
-2314,7
+2314,10
@@
def write_to_config(thisconfig, key, value=None, config_file=None):
value = thisconfig[origkey] if origkey in thisconfig else thisconfig[key]
cfg = config_file if config_file else 'config.py'
- # load config file
+ # load config file, create one if it doesn't exist
+ if not os.path.exists(cfg):
+ os.mknod(cfg)
+ logging.info("Creating empty " + cfg)
with open(cfg, 'r', encoding="utf-8") as f:
lines = f.readlines()