summaryrefslogtreecommitdiffstats
path: root/config.py
diff options
context:
space:
mode:
authorGravatar ryuslash2010-02-09 02:10:17 +0100
committerGravatar ryuslash2010-02-09 02:10:17 +0100
commit1b09267876e51c0456c062e10ab70c0f7eba6c34 (patch)
tree8afb37f35b3563165aa7a41d32f2120620b5b811 /config.py
parent91e0b5dc665679e30cfd2114a68adce9af04a3e9 (diff)
download4grab-1b09267876e51c0456c062e10ab70c0f7eba6c34.tar.gz
4grab-1b09267876e51c0456c062e10ab70c0f7eba6c34.zip
configuration settings and startfile
Configuration Settings can now be changed with the -e command line argument execution of 4grab has been moved to 4grab.py, but should also still work with download.py
Diffstat (limited to 'config.py')
-rw-r--r--config.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/config.py b/config.py
index 06cf0dc..7f448b8 100644
--- a/config.py
+++ b/config.py
@@ -40,11 +40,25 @@ class _Configuration(object):
self.configparser.set("settings", "category", value)
def option_exists(self, option):
- for section in self.configparser.sections():
+ sections = self.configparser.sections()
+ for section in sections:
if self.configparser.has_option(section, option):
return True
return False
+ def set_option(self, option, value):
+ sec = None
+ sections = self.configparser.sections()
+ for section in sections:
+ if self.configparser.has_option(section, option):
+ sec = section
+
+ if not sec is None:
+ self.configparser.set(sec, option, value)
+ return True
+ else:
+ return False
+
def save(self):
dirname = os.path.dirname(self.filename)
if not os.path.exists(dirname):