summaryrefslogtreecommitdiff
path: root/UpdateManager
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-03-20 11:16:50 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-03-20 11:16:50 +0100
commit78f281065fb9bbd8a36b52b457397b3e886abcc7 (patch)
tree6bee9758f1742be4ce97cec7f4ae605bbe877cc8 /UpdateManager
parent56fa71590be9df25acc234df153412ef68a30ae2 (diff)
parent8cfb54ced335aa488ca3cfad00dad434617fb62a (diff)
downloadpython-apt-78f281065fb9bbd8a36b52b457397b3e886abcc7.tar.gz
* fix the missing toggle buttons in software-properties
Diffstat (limited to 'UpdateManager')
-rw-r--r--UpdateManager/UpdateManager.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
index 07634d87..27e6b7bb 100644
--- a/UpdateManager/UpdateManager.py
+++ b/UpdateManager/UpdateManager.py
@@ -346,14 +346,28 @@ class UpdateManager(SimpleGladeApp):
iter = model.get_iter(path)
# set descr
- long_desc = model.get_value(iter, 5)
+ long_desc = model.get_value(iter, LIST_LONG_DESCR)
if long_desc == None:
return
+ # Skip the first line - it's a duplicate of the summary
+ i = long_desc.find("\n")
+ long_desc = long_desc[i+1:]
+ # do some regular expression magic on the description
+ # Add a newline before each bullet
+ p = re.compile(r'^(\s|\t)*(\*|0|-)',re.MULTILINE)
+ long_desc = p.sub('\n*', long_desc)
+ # replace all newlines by spaces
+ p = re.compile(r'\n', re.MULTILINE)
+ long_desc = p.sub(" ", long_desc)
+ # replace all multiple spaces by newlines
+ p = re.compile(r'\s\s+', re.MULTILINE)
+ long_desc = p.sub("\n", long_desc)
+
desc_buffer = self.textview_descr.get_buffer()
desc_buffer.set_text(utf8(long_desc))
# now do the changelog
- name = model.get_value(iter, 2)
+ name = model.get_value(iter, LIST_NAME)
if name == None:
return
@@ -405,7 +419,7 @@ class UpdateManager(SimpleGladeApp):
self.update_count()
def update_count(self):
- if len(self.packages) == 0:
+ if self.list.num_updates == 0:
text_header= "<big><b>"+_("Your system is up-to-date")+"</b></big>"
text_download = ""
self.expander_details.set_sensitive(False)
@@ -609,7 +623,8 @@ class UpdateManager(SimpleGladeApp):
contents = "<big><b>%s</b></big>\n<small>%s\n\n" % (name, summary)
contents = contents + _("New version: %s (Size: %s)") % (pkg.candidateVersion,apt.SizeToStr(pkg.packageSize)) + "</small>"
- iter = self.store.append([True, contents, pkg.name, pkg.summary, pkg.candidateVersion, pkg.description, pkg])
+ iter = self.store.append([True, contents, pkg.name, pkg.summary,
+ pkg.candidateVersion, pkg.description, pkg])
self.add_update(pkg)
i = i + 1