From e4b06af1ace3bbb4281a9c762113f8a2699116c3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 9 Sep 2006 10:53:25 +0200 Subject: * merged with the latest upload (fix popcon participate value) --- SoftwareProperties/SoftwareProperties.py | 24 ++++++++++++++++++++---- debian/changelog | 7 +++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index a3dfdd06..a18fec20 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -79,6 +79,7 @@ class SoftwareProperties(SimpleGladeApp): def __init__(self, datadir=None, options=None, parent=None, file=None): gtk.window_set_default_icon_name("software-properties") + self.popconfile = "/etc/popularity-contest.conf" # FIXME: some saner way is needed here if datadir == None: @@ -223,6 +224,22 @@ class SoftwareProperties(SimpleGladeApp): self.treeview_sources.connect("drag_data_received",\ self.on_sources_drag_data_received) + # popcon + if os.path.exists(self.popconfile): + # read it + lines = open(self.popconfile).read().split("\n") + active = False + for line in lines: + try: + (key,value) = line.split("=") + if key == "PARTICIPATE": + if value.strip('"').lower() == "yes": + active = True + except ValueError: + continue + self.checkbutton_popcon.set_active(active) + + # call the add sources.list dialog if we got a file from the cli if self.file != None: self.open_file(file) @@ -505,14 +522,13 @@ class SoftwareProperties(SimpleGladeApp): def on_checkbutton_popcon_toggled(self, widget): """ The user clicked on the popcon paritipcation button """ - popcon = "/etc/popularity-contest.conf" if widget.get_active(): new_value = "yes" else: new_value = "no" - if os.path.exists(popcon): + if os.path.exists(self.popconfile): # read it - lines = open(popcon).read().split("\n") + lines = open(self.popconfile).read().split("\n") for line in lines: try: (key,value) = line.split("=") @@ -521,7 +537,7 @@ class SoftwareProperties(SimpleGladeApp): except ValueError: continue # write it - open(popcon,"w").write("\n".join(lines)) + open(self.popconfile,"w").write("\n".join(lines)) def open_file(self, file): diff --git a/debian/changelog b/debian/changelog index 48c59ad8..230fd67f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +update-manager (0.44.9) edgy; urgency=low + + * SoftwareProperties/SoftwareProperties.py: + - bugfix in the popcon enable code (lp: #59540) + + -- Michael Vogt Sat, 9 Sep 2006 02:13:40 +0200 + update-manager (0.44.8) edgy; urgency=low * fix missing /var/log/dist-upgrade -- cgit v1.2.3