summaryrefslogtreecommitdiff
path: root/SoftwareProperties/SoftwareProperties.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-07-27 17:20:33 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-07-27 17:20:33 +0200
commit54d5696fa964d3cc7a79a1ba0ed4083d9701de1e (patch)
treea5d02e44e51b843b11390a2fc7ae6f0e42da0efd /SoftwareProperties/SoftwareProperties.py
parentc2a2f69a9a9ee1f45290b15e76f6098c4b28bd98 (diff)
downloadpython-apt-54d5696fa964d3cc7a79a1ba0ed4083d9701de1e.tar.gz
* data/glade/SoftwareProperties.glade:
- changed the text for Popcon participation * SoftwareProperties/SoftwareProperties.py: - support popcon pariticipation
Diffstat (limited to 'SoftwareProperties/SoftwareProperties.py')
-rw-r--r--SoftwareProperties/SoftwareProperties.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index f7a40821..07170fa6 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -440,6 +440,27 @@ class SoftwareProperties(SimpleGladeApp):
source.file)
self.modified_sourceslist()
+ 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):
+ # read it
+ lines = open(popcon).read().split("\n")
+ for line in lines:
+ try:
+ (key,value) = line.split("=")
+ if key == "PARTICIPATE":
+ lines[lines.index(line)] = 'PARTICIPATE=\"%s"' % new_value
+ except ValueError:
+ continue
+ # write it
+ open(popcon,"w").write("\n".join(lines))
+
+
def open_file(self, file):
"""Show an confirmation for adding the channels of the specified file"""
dialog = dialog_add_sources_list.AddSourcesList(self.window_main,
@@ -1003,3 +1024,4 @@ class GtkCdromProgress(apt.progress.CdromProgress, SimpleGladeApp):
return True
return False
+