summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/portato.cfg5
-rw-r--r--portato/gui/utils.py12
-rw-r--r--portato/gui/windows/main.py10
-rw-r--r--portato/gui/windows/preference.py42
4 files changed, 31 insertions, 38 deletions
diff --git a/etc/portato.cfg b/etc/portato.cfg
index 10f5445..8e6728d 100644
--- a/etc/portato.cfg
+++ b/etc/portato.cfg
@@ -26,6 +26,11 @@ system = portage
; controls debug output - boolean value
debug = True
+#
+# Backend section
+#
+[BACKEND]
+
; the command used for syncing portage - string value
synccommand = emerge --sync
diff --git a/portato/gui/utils.py b/portato/gui/utils.py
index ce5971e..e3611af 100644
--- a/portato/gui/utils.py
+++ b/portato/gui/utils.py
@@ -73,12 +73,12 @@ class Config (ConfigParser):
@see: L{flags.set_config()}"""
flagCfg = {
- "usefile": self.get("useFile"),
- "usePerVersion" : self.get_boolean("usePerVersion"),
- "maskfile" : self.get("maskFile"),
- "maskPerVersion" : self.get_boolean("maskPerVersion"),
- "testingfile" : self.get("keywordFile"),
- "testingPerVersion" : self.get_boolean("keywordPerVersion")}
+ "usefile": self.get("useFile", "backend"),
+ "usePerVersion" : self.get_boolean("usePerVersion", "backend"),
+ "maskfile" : self.get("maskFile", "backend"),
+ "maskPerVersion" : self.get_boolean("maskPerVersion", "backend"),
+ "testingfile" : self.get("keywordFile", "backend"),
+ "testingPerVersion" : self.get_boolean("keywordPerVersion", "backend")}
flags.set_config(flagCfg)
def modify_debug_config (self):
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 130a71c..8f4b04a 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -1473,7 +1473,7 @@ class MainWindow (Window):
elif self.queueTree.is_in_unmerge(iter):
self.queue.unmerge(force = True)
else:
- self.queue.update_world(sets = self.updateSets, force=True, newuse = self.cfg.get_boolean("newuse"), deep = self.cfg.get_boolean("deep"))
+ self.queue.update_world(sets = self.updateSets, force=True, newuse = self.cfg.get_boolean("newuse", "backend"), deep = self.cfg.get_boolean("deep", "backend"))
return True
@@ -1500,11 +1500,11 @@ class MainWindow (Window):
self.window.window.set_cursor(watch)
try:
if system.has_set_support():
- confsets = [x.strip() for x in self.cfg.get("updatesets").split(",")]
+ confsets = [x.strip() for x in self.cfg.get("updatesets", "backend").split(",")]
self.updateSets = [s for s in confsets if s in system.get_sets()]
- updating = system.update_world(sets = self.updateSets, newuse = self.cfg.get_boolean("newuse"), deep = self.cfg.get_boolean("deep"))
+ updating = system.update_world(sets = self.updateSets, newuse = self.cfg.get_boolean("newuse", "backend"), deep = self.cfg.get_boolean("deep", "backend"))
else:
- updating = system.update_world(newuse = self.cfg.get_boolean("newuse"), deep = self.cfg.get_boolean("deep"))
+ updating = system.update_world(newuse = self.cfg.get_boolean("newuse"), deep = self.cfg.get_boolean("deep", "backend"))
self.updateSets = ("world",)
debug("updating list: %s --> length: %s", [(x.get_cpv(), y.get_cpv()) for x,y in updating], len(updating))
@@ -1547,7 +1547,7 @@ class MainWindow (Window):
def cb_sync_clicked (self, action):
self.sysNotebook.set_current_page(self.CONSOLE_PAGE)
- cmd = self.cfg.get("syncCommand")
+ cmd = self.cfg.get("syncCommand", "backend")
if cmd != "emerge --sync":
cmd = cmd.split()
diff --git a/portato/gui/windows/preference.py b/portato/gui/windows/preference.py
index 021788c..5d1d388 100644
--- a/portato/gui/windows/preference.py
+++ b/portato/gui/windows/preference.py
@@ -30,26 +30,26 @@ class PreferenceWindow (AbstractDialog):
checkboxes = {
"collapseCatCheck" : ("collapseCats", "GUI"),
"consoleUpdateCheck" : ("updateConsole", "GUI"),
- "debugCheck" : "debug",
- "deepCheck" : "deep",
- "newUseCheck" : "newuse",
- "maskPerVersionCheck" : "maskPerVersion",
+ "debugCheck" : ("debug", "MAIN"),
+ "deepCheck" : ("deep", "backend"),
+ "newUseCheck" : ("newuse", "backend"),
+ "maskPerVersionCheck" : ("maskPerVersion", "backend"),
"minimizeCheck" : ("hideOnMinimize", "GUI"),
"searchOnTypeCheck" : ("searchOnType", "GUI"),
"showSlotsCheck" : ("showSlots", "GUI"),
"systrayCheck" : ("showSystray", "GUI"),
- "testPerVersionCheck" : "keywordPerVersion",
+ "testPerVersionCheck" : ("keywordPerVersion", "backend"),
"titleUpdateCheck" : ("updateTitle", "GUI"),
- "usePerVersionCheck" : "usePerVersion"
+ "usePerVersionCheck" : ("usePerVersion", "backend")
}
# all edits in the window
# widget name -> option name
edits = {
- "maskFileEdit" : "maskFile",
- "testFileEdit" : "keywordFile",
- "useFileEdit" : "useFile",
- "syncCommandEdit" : "syncCommand",
+ "maskFileEdit" : ("maskFile", "backend"),
+ "testFileEdit" : ("keywordFile", "backend"),
+ "useFileEdit" : ("useFile", "backend"),
+ "syncCommandEdit" : ("syncCommand", "backend"),
"browserEdit" : ("browserCmd", "GUI")
}
@@ -112,17 +112,11 @@ class PreferenceWindow (AbstractDialog):
# the checkboxes
for box, val in self.checkboxes.iteritems():
- if isinstance(val, tuple):
- self.tree.get_widget(box).set_active(self.cfg.get_boolean(val[0], section = val[1]))
- else:
- self.tree.get_widget(box).set_active(self.cfg.get_boolean(val))
+ self.tree.get_widget(box).set_active(self.cfg.get_boolean(val[0], section = val[1]))
# the edits
for edit, val in self.edits.iteritems():
- if isinstance(val,tuple):
- self.tree.get_widget(edit).set_text(self.cfg.get(val[0], section = val[1]))
- else:
- self.tree.get_widget(edit).set_text(self.cfg.get(val))
+ self.tree.get_widget(edit).set_text(self.cfg.get(val[0], section = val[1]))
# the set list
self.setList = self.tree.get_widget("setList")
@@ -192,16 +186,10 @@ class PreferenceWindow (AbstractDialog):
"""Sets all options in the Config-instance."""
for box, val in self.checkboxes.iteritems():
- if isinstance(val, tuple):
- self.cfg.set(val[0], self.tree.get_widget(box).get_active(), section = val[1])
- else:
- self.cfg.set(val, self.tree.get_widget(box).get_active())
+ self.cfg.set(val[0], self.tree.get_widget(box).get_active(), section = val[1])
for edit, val in self.edits.iteritems():
- if isinstance(val,tuple):
- self.cfg.set(val[0], self.tree.get_widget(edit).get_text(), section = val[1])
- else:
- self.cfg.set(val,self.tree.get_widget(edit).get_text())
+ self.cfg.set(val[0], self.tree.get_widget(edit).get_text(), section = val[1])
if system.has_set_support():
self.cfg.set("updatesets", ", ".join(sorted(name for enabled, markup, descr, name in self.setList.get_model() if enabled)))
@@ -240,7 +228,7 @@ class PreferenceWindow (AbstractDialog):
def fill_setlist (self):
store = gtk.ListStore(bool, str, str, str)
- enabled = [x.strip() for x in self.cfg.get("updatesets").split(",")]
+ enabled = [x.strip() for x in self.cfg.get("updatesets", section = "backend").split(",")]
for set, descr in system.get_sets(description = True):
store.append([set in enabled, "<i>%s</i>" % set, descr, set])