diff options
| author | glatzor@ubuntu.com <> | 2006-06-29 13:48:14 +0200 |
|---|---|---|
| committer | glatzor@ubuntu.com <> | 2006-06-29 13:48:14 +0200 |
| commit | 972a8ca2f1ff4466096505262305260bbd507caf (patch) | |
| tree | 7545972c67ccfafda3bfcaa698ead0bcaf998aca | |
| parent | 71424532c392df4612e170fb6a4737db3622c0b1 (diff) | |
| download | python-apt-972a8ca2f1ff4466096505262305260bbd507caf.tar.gz | |
* add long descriptions for components
* fix some boolean stuff (hide distru sources)
* also rename the menu entry of the app
| -rw-r--r-- | SoftwareProperties/SoftwareProperties.py | 20 | ||||
| -rw-r--r-- | UpdateManager/Common/DistInfo.py | 21 | ||||
| -rw-r--r-- | channels/Ubuntu.info.in | 14 | ||||
| -rw-r--r-- | data/software-properties.desktop.in | 6 |
4 files changed, 37 insertions, 24 deletions
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py index 0f4f5f66..da52b272 100644 --- a/SoftwareProperties/SoftwareProperties.py +++ b/SoftwareProperties/SoftwareProperties.py @@ -31,6 +31,7 @@ import tempfile from gettext import gettext as _ import os import string +import re #sys.path.append("@prefix/share/update-manager/python") @@ -120,6 +121,7 @@ class Distribution: break if self.source_template == None: print "Error: could not find a distribution template" + # FIXME: will go away - only for debugging issues sys.exit(1) # find main and child sources @@ -141,9 +143,6 @@ class Distribution: print "yeah! child found: %s" % source.template.name if source.type == "deb": self.child_sources.append(source) - media.append(source.uri) - elif source.type == "deb-src": - self.source_code_sources.append(source) self.enabled_comps = set(comps) self.used_media = set(media) @@ -174,8 +173,8 @@ class Distribution: else: # seems to be a network source self.use_internet = True - if medium != self.main_server or \ - medium != self.nearest_server: + if not re.match(medium, self.main_server) and \ + not re.match(medium, self.nearest_server): self.other_servers.append(medium) @@ -338,7 +337,7 @@ class SoftwareProperties(SimpleGladeApp): for checkbutton in self.vbox_dist_comps.get_children(): self.vbox_dist_comps.remove(checkbutton) for comp in self.distribution.source_template.components.keys(): - checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][0]) + checkbox = gtk.CheckButton(label=self.distribution.source_template.components[comp][2]) # check if the comp is enabled # FIXME: use inconsistence if there are main sources with not all comps if comp in self.distribution.enabled_comps: @@ -395,6 +394,8 @@ class SoftwareProperties(SimpleGladeApp): cell = gtk.CellRendererText() self.combobox_server.pack_start(cell, True) self.combobox_server.add_attribute(cell, 'text', 0) + # load the mirror list in to the combo and select the one of the first + # main source server_store.append([_("%s (default)") % self.distribution.main_server, self.distribution.main_server]) server_store.append([_("%s (nearest)") % self.distribution.nearest_server, @@ -557,7 +558,8 @@ class SoftwareProperties(SimpleGladeApp): if source.template.child == False: for comp in source.comps: if source.template.components.has_key(comp): - (desc, enabled) = source.template.components[comp] + print source.template.components[comp] + (desc, enabled, desc_long) = source.template.components[comp] contents += "\n%s" % desc else: contents += "\n%s" % comp @@ -591,8 +593,8 @@ class SoftwareProperties(SimpleGladeApp): self.sourceslist_visible=[] self.distribution.get_sources(self.sourceslist) for source in self.sourceslist.list: - if not source.invalid or\ - source not in self.distribution.main_sources or\ + if not source.invalid and\ + source not in self.distribution.main_sources and\ source not in self.distribution.child_sources: self.sourceslist_visible.append(source) diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py index ebf83516..7d2d37ad 100644 --- a/UpdateManager/Common/DistInfo.py +++ b/UpdateManager/Common/DistInfo.py @@ -43,8 +43,9 @@ class Suite: class Component: def __init__(self): - self.name = None - self.description = None + self.name = "" + self.description = "" + self.description_long = "" self.enabled = None class DistInfo: @@ -82,7 +83,8 @@ class DistInfo: if suite: if component: suite.components["%s" % component.name] = \ - (component.description, component.enabled) + (component.description, component.enabled, + component.description_long) component = None self.suites.append (suite) suite = Suite () @@ -110,17 +112,21 @@ class DistInfo: elif field == 'Component': if component: suite.components["%s" % component.name] = \ - (component.description, component.enabled) + (component.description, component.enabled, + component.description_long) component = Component () component.name = value elif field == 'Enabled': component.enabled = bool(int(value)) elif field == 'CompDescription': component.description = _(value) + elif field == 'CompDescriptionLong': + component.description_long = _(value) if suite: if component: suite.components["%s" % component.name] = \ - (component.description, component.enabled) + (component.description, component.enabled, + component.description_long) component = None self.suites.append (suite) suite = None @@ -135,8 +141,9 @@ if __name__ == "__main__": print "BaseURI: %s" % suite.base_uri print "MatchURI: %s" % suite.match_uri for component in suite.components: - print " %s - %s - %s " % (component, + print " %s - %s - %s - %s" % (component, suite.components[component][0], - suite.components[component][1]) + suite.components[component][1], + suite.components[component][2]) for child in suite.children: print " %s" % child.description diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in index eb88ceb9..f92d8b8b 100644 --- a/channels/Ubuntu.info.in +++ b/channels/Ubuntu.info.in @@ -8,15 +8,19 @@ _Description: Ubuntu 6.04 'Dapper Drake' Component: main Enabled: 1 _CompDescription: Officially supported -Component: restricted -Enabled: 1 -_CompDescription: Restricted copyright +_CompDescriptionLong: Free software that is officially supported by Canonical Ltd. (main) Component: universe Enabled: 0 -_CompDescription: Community maintained (Universe) +_CompDescription: Community maintained (universe) +_CompDescriptionLong: Free software that is maintained by the community (universe) +Component: restricted +Enabled: 1 +_CompDescription: Non-free drivers +_CompDescriptionLong: Non-free drivers for devices (restricted) Component: multiverse Enabled: 0 -_CompDescription: Non-free (Multiverse) +_CompDescription: Restricted software (Multiverse) +_CompDescriptionLong: Software that is restricted by copyright or legal issues (multiverse) Suite: dapper MatchName: .* diff --git a/data/software-properties.desktop.in b/data/software-properties.desktop.in index c125b4f7..330fc8bc 100644 --- a/data/software-properties.desktop.in +++ b/data/software-properties.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] -_Name=Software Properties -_GenericName=Software Properties -_Comment=Configure software channels and internet updates +_Name=Software Sources +_GenericName=Software Sources +_Comment=Configure the sources for installable software and updates Exec=gksu /usr/bin/software-properties Icon=software-properties Terminal=false |
