summaryrefslogtreecommitdiff
path: root/geneticone
diff options
context:
space:
mode:
Diffstat (limited to 'geneticone')
-rw-r--r--geneticone/flags.py19
-rw-r--r--geneticone/gui/gui_helper.py4
-rw-r--r--geneticone/gui/windows.py10
3 files changed, 18 insertions, 15 deletions
diff --git a/geneticone/flags.py b/geneticone/flags.py
index 3005518..8899fc5 100644
--- a/geneticone/flags.py
+++ b/geneticone/flags.py
@@ -14,6 +14,7 @@ import os.path
from subprocess import Popen, PIPE # needed for grep
import geneticone
+from helper import *
import portage
from portage_util import unique_array
@@ -115,7 +116,7 @@ def set_use_flag (pkg, flag):
if not cpv in newUseFlags:
newUseFlags[cpv] = []
- print "data: "+str(data)
+ debug("data: "+str(data))
# add a useflag / delete one
added = False
for file, line, crit, flags in data:
@@ -155,7 +156,7 @@ def set_use_flag (pkg, flag):
newUseFlags[cpv].append((path, -1, flag, False))
newUseFlags[cpv] = unique_array(newUseFlags[cpv])
- print "newUseFlags: "+str(newUseFlags)
+ debug("newUseFlags: "+str(newUseFlags))
def remove_new_use_flags (cpv):
"""Removes all new use-flags for a specific package.
@@ -306,7 +307,7 @@ def set_masked (pkg):
return
unmasked = get_data(pkg, UNMASK_PATH)
- print "data (unmasked): "+str(unmasked)
+ debug("data (unmasked): "+str(unmasked))
done = False
for file, line, crit, flags in unmasked:
if pkg.matches(crit):
@@ -322,7 +323,7 @@ def set_masked (pkg):
new_masked[cpv].append((file, "-1"))
new_masked[cpv] = unique_array(new_masked[cpv])
- print "new_masked: "+str(new_masked)
+ debug("new_masked: "+str(new_masked))
def set_unmasked (pkg):
global new_masked, new_unmasked
@@ -350,7 +351,7 @@ def set_unmasked (pkg):
return
masked = get_data(pkg, MASK_PATH)
- print "data (masked): "+str(masked)
+ debug("data (masked): "+str(masked))
done = False
for file, line, crit, fl in masked:
if pkg.matches(crit):
@@ -366,7 +367,7 @@ def set_unmasked (pkg):
new_unmasked[cpv].append((file, "-1"))
new_unmasked[cpv] = unique_array(new_unmasked[cpv])
- print "new_unmasked: "+str(new_unmasked)
+ debug("new_unmasked: "+str(new_unmasked))
def write_masked_unmasked ():
global new_unmasked, new_masked
@@ -449,7 +450,7 @@ def set_testing (pkg, enable):
if not cpv in newTesting:
newTesting[cpv] = []
- print "arch: "+arch
+ debug("arch: "+arch)
for file, line in newTesting[cpv]:
if (enable and line != "-1") or (not enable and line == "-1"):
newTesting[cpv].remove((file, line))
@@ -459,7 +460,7 @@ def set_testing (pkg, enable):
if not enable:
test = get_data(pkg, TESTING_PATH)
- print "data (test): "+str(test)
+ debug("data (test): "+str(test))
for file, line, crit, flags in test:
if pkg.matches(crit) and flags[0] == "~"+arch:
newTesting[cpv].append((file, line))
@@ -471,7 +472,7 @@ def set_testing (pkg, enable):
newTesting[cpv].append((file, "-1"))
newTesting[cpv] = unique_array(newTesting[cpv])
- print "newTesting: "+str(newTesting)
+ debug("newTesting: "+str(newTesting))
def write_testing ():
global arch, newTesting
diff --git a/geneticone/gui/gui_helper.py b/geneticone/gui/gui_helper.py
index 5801d1a..7b5094e 100644
--- a/geneticone/gui/gui_helper.py
+++ b/geneticone/gui/gui_helper.py
@@ -11,6 +11,7 @@
import geneticone
from geneticone import flags
+from geneticone.helper import *
from subprocess import *
from threading import Thread
@@ -130,9 +131,8 @@ class EmergeQueue:
cat = geneticone.split_package_name(p)[0] # get category
while cat[0] in ["=",">","<","!"]:
cat = cat[1:]
- print "Category: "+cat ,
del self.packages[cat]
- print "marked for refreshing"
+ debug("Category %s marked for refreshing" % cat)
except KeyError: # not in self.packages - ignore
pass
diff --git a/geneticone/gui/windows.py b/geneticone/gui/windows.py
index 02613db..3add5da 100644
--- a/geneticone/gui/windows.py
+++ b/geneticone/gui/windows.py
@@ -23,6 +23,7 @@ import gobject
import geneticone
from geneticone import flags
+from geneticone.helper import *
from gui_helper import *
# for the terminal
@@ -229,8 +230,9 @@ class PackageWindow:
return True
def cb_cancel_clicked (self, button, data = None):
- if self.delOnClose: self.actual_package().remove_new_use_flags()
- if self.flagChanged:
+ if self.delOnClose:
+ self.actual_package().remove_new_use_flags()
+ elif self.flagChanged:
if self.queue:
self.queue.append(self.actual_package().get_cpv(), update = True)
self.window.destroy()
@@ -238,7 +240,7 @@ class PackageWindow:
def cb_emerge_clicked (self, button, data = None):
"""Adds the package to the EmergeQueue."""
- if not geneticone.am_i_root():
+ if not am_i_root():
errorMB = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "You cannot (un)merge without being root.")
errorMB.run()
errorMB.destroy()
@@ -583,7 +585,7 @@ class MainWindow:
def cb_emerge_clicked (self, button, data = None):
"""Do emerge or unemerge."""
- print button
+ debug(button)
if button == self.emergeBtn or button == MENU_EMERGE:
if len(flags.newUseFlags) > 0:
hintMB = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK,