Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2013-10-10 11:55:40 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2013-10-10 11:55:40 (GMT)
commitb5a046dcce410a2f41fa0be8e4a58d5da6d3c2b3 (patch)
tree196290bff692b2925230b36404d0ecf973cfe4c6
parent2fc0aaf625151081feaf382c289d68620a720b61 (diff)
Save config only to files that are accessible for writing
-rw-r--r--TODO1
-rw-r--r--sugar_network/toolkit/options.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/TODO b/TODO
index 0f53069..112665d 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,5 @@
- 0.10
* keep user guids after reflasing XOs
- * F1/F3 will preserve original behaviour to show ~/Activities activities
- (!) Editors' workflows:
- (?) log all (including editros) posters of particular document to minimize conflicts about why somthing was changed
diff --git a/sugar_network/toolkit/options.py b/sugar_network/toolkit/options.py
index 5f10525..04cf1f3 100644
--- a/sugar_network/toolkit/options.py
+++ b/sugar_network/toolkit/options.py
@@ -323,8 +323,10 @@ class Option(object):
Option._parser = ConfigParser()
def load_config(path):
- if Option._config_to_save is None:
+ if Option._config_to_save is None and os.access(path, os.W_OK):
Option._config_to_save = path
+ if not exists(path):
+ return
Option.config_files.append(path)
Option._parser.read(path)
@@ -336,7 +338,7 @@ class Option(object):
if isdir(config_path):
for path in sorted(os.listdir(config_path)):
load_config(join(config_path, path))
- elif exists(config_path):
+ else:
load_config(config_path)
for prop in Option.items.values():