From f100900ea0709a71ebceae238f0b60fe28aa9232 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Wed, 28 Jun 2006 21:12:04 +0200
Subject: * more merging
---
SoftwareProperties/SoftwareProperties.py | 238 ++++++++++++++++++++++++-------
1 file changed, 189 insertions(+), 49 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 65b72cda..037f01fb 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -30,6 +30,7 @@ import gettext
import tempfile
from gettext import gettext as _
import os
+import string
#sys.path.append("@prefix/share/update-manager/python")
@@ -39,6 +40,8 @@ import aptsources
import dialog_add
import dialog_edit
import dialog_cache_outdated
+#import dialog_edit_predefined
+#import dialog_sources_list
from dialog_apt_key import apt_key
from utils import *
@@ -54,11 +57,19 @@ CONF_MAP = {
}
+# columns of the source_store
+(SORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4)
+
class SoftwareProperties(SimpleGladeApp):
- def __init__(self, datadir=None, options=None, parent=None):
+ def __init__(self, datadir=None, options=None, parent=None, file=None):
gtk.window_set_default_icon_name("software-properties")
+ # get the current LSB distribution name
+ pipe = os.popen("lsb_release -i | cut -d : -f 2-")
+ self.distribution = pipe.read().strip()
+ del pipe
+
# FIXME: some saner way is needed here
if datadir == None:
datadir = "/usr/share/update-manager/"
@@ -184,30 +195,92 @@ class SoftwareProperties(SimpleGladeApp):
self.init_keyslist()
self.reload_keyslist()
+ # drag and drop support for sources.list
+ self.treeview_sources.drag_dest_set(gtk.DEST_DEFAULT_ALL, \
+ [('text/uri-list',0, 0)], \
+ gtk.gdk.ACTION_COPY)
+ self.treeview_sources.connect("drag_data_received",\
+ self.on_sources_drag_data_received)
+
+ # call the add sources.list dialog if we got a file from the cli
+ if self.file != None:
+ self.open_file(file)
+
+ def open_file(self, file):
+ """Show an confirmation for adding the channels of the specified file"""
+ #dialog = dialog_sources_list.AddSourcesList(self.window_main,
+ # self.sourceslist,
+ # self.render_source,
+ # self.get_comparable,
+ # self.datadir,
+ # file)
+ #res = dialog.run()
+ #if res == gtk.RESPONSE_OK:
+ # self.modified_sourceslist()
+ print "droped a sources.list"
+
+ def on_sources_drag_data_received(self, widget, context, x, y,
+ selection, target_type, timestamp):
+ """Extract the dropped file pathes and open the first file, only"""
+ uri = selection.data.strip()
+ uri_splitted = uri.split()
+ if len(uri_splitted)>0:
+ self.open_file(uri_splitted[0])
+
def hide(self):
self.window_main.hide()
def init_sourceslist(self):
- self.source_store = gtk.ListStore(str, bool, gobject.TYPE_PYOBJECT)
+ self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
+ gobject.TYPE_STRING,
+ gobject.TYPE_PYOBJECT,
+ gobject.TYPE_BOOLEAN)
self.treeview_sources.set_model(self.source_store)
-
- tr = gtk.CellRendererText()
- tr.set_property("xpad", 10)
- tr.set_property("ypad", 10)
-
- source_col = gtk.TreeViewColumn("Description", tr, markup=LIST_MARKUP)
- #source_col.set_max_width(500)
-
- toggle = gtk.CellRendererToggle()
- toggle.connect("toggled", self.on_channel_toggled)
- toggle_col = gtk.TreeViewColumn("Active", toggle, active=LIST_ENABLED)
+ self.treeview_sources.set_row_separator_func(self.is_separator,
+ STORE_SEPARATOR)
+ #self.treeview_sources.set_rules_hint(False)
+
+ cell_desc = gtk.CellRendererText()
+ cell_desc.set_property("xpad", 2)
+ cell_desc.set_property("ypad", 2)
+ col_desc = gtk.TreeViewColumn(_("Software Channel"), cell_desc,
+ markup=COLUMN_DESC)
+ col_desc.set_max_width(1000)
+
+ cell_toggle = gtk.CellRendererToggle()
+ cell_toggle.set_property("xpad", 2)
+ cell_toggle.set_property("ypad", 2)
+ cell_toggle.connect('toggled', self.on_channel_toggled)
+ col_active = gtk.TreeViewColumn(_("Active"), cell_toggle,
+ active=COLUMN_ACTIVE)
+
+ self.treeview_sources.append_column(col_active)
+ self.treeview_sources.append_column(col_desc)
- self.treeview_sources.append_column(toggle_col)
- self.treeview_sources.append_column(source_col)
-
self.sourceslist = aptsources.SourcesList()
- self.matcher = aptsources.SourceEntryMatcher()
-
+
+ def on_channel_activate(self, treeview, path, column):
+ """Open the edit dialog if a channel was double clicked"""
+ self.on_edit_clicked(treeview)
+
+ def on_treeview_sources_cursor_changed(self, treeview):
+ """Enable the buttons remove and edit if a channel is selected"""
+ sel = self.treeview_sources.get_selection()
+ (model, iter) = sel.get_selected()
+ if iter:
+ self.button_edit.set_sensitive(True)
+ self.button_remove.set_sensitive(True)
+ else:
+ self.button_edit.set_sensitive(False)
+ self.button_remove.set_sensitive(False)
+
+ def on_channel_toggled(self, cell_toggle, path):
+ """Enable or disable the selected channel"""
+ iter = self.source_store.get_iter((int(path),))
+ source_entry = self.source_store.get_value(iter, STORE_SOURCE)
+ source_entry.disabled = not source_entry.disabled
+ self.modified_sourceslist()
+
def init_keyslist(self):
self.keys_store = gtk.ListStore(str)
self.treeview2.set_model(self.keys_store)
@@ -217,29 +290,100 @@ class SoftwareProperties(SimpleGladeApp):
keys_col = gtk.TreeViewColumn("Key", tr, text=0)
self.treeview2.append_column(keys_col)
+ def on_button_revert_clicked(self, button):
+ """Restore the source list from the startup of the dialog"""
+ self.sourceslist.restoreBackup(".save")
+ self.sourceslist.clearBackup(".save")
+ self.sourceslist.backup(".save")
+ self.sourceslist.refresh()
+ self.reload_sourceslist()
+ self.button_revert.set_sensitive(False)
+ self.modified = False
+
+ def modified_sourceslist(self):
+ """The sources list was changed and now needs to be saved and reloaded"""
+ self.button_revert.set_sensitive(True)
+ self.sourceslist.check_for_endangered_dists()
+ self.save_sourceslist()
+ self.reload_sourceslist()
+ self.modified = True
+
+ def render_source(self, source):
+ """Render a nice output to show the source in a treeview"""
+
+ if source.template == None:
+ if source.comment:
+ contents = "%s" % source.comment
+ # Only show the components if there are more than one
+ if len(source.comps) > 1:
+ for c in source.comps:
+ contents += " %s" % c
+ else:
+ contents = "%s %s" % (source.uri, source.dist)
+ for c in source.comps:
+ contents += " %s" % c
+ if source.type in ("deb-src", "rpm-src"):
+ contents += " %s" % _("(Source Code)")
+ return contents
+ else:
+ # try to make use of an corresponding template
+ contents = "%s" % source.template.description
+ if source.type in ("deb-src", "rpm-src"):
+ contents += " (%s)" % _("Source Code")
+ if source.comment:
+ contents +=" %s" % source.comment
+ if source.template.child == False:
+ for comp in source.comps:
+ if source.template.components.has_key(comp):
+ (desc, enabled) = source.template.components[comp]
+ contents += "\n%s" % desc
+ else:
+ contents += "\n%s" % comp
+ return contents
+
+ def get_comparable(self, source):
+ """extract attributes to sort the sources"""
+ cur_sys = 1
+ has_template = 1
+ has_comment = 1
+ is_source = 1
+ revert_numbers = string.maketrans("0123456789", "9876543210")
+ if source.template:
+ has_template = 0
+ desc = source.template.description
+ if source.template.distribution == self.distribution:
+ cur_sys = 0
+ else:
+ desc = "%s %s %s" % (source.uri, source.dist, source.comps)
+ if source.comment:
+ has_comment = 0
+ if source.type.find("src"):
+ is_source = 0
+ return (cur_sys, has_template, has_comment, is_source,
+ desc.translate(revert_numbers))
+
def reload_sourceslist(self):
(path_x, path_y) = self.treeview_sources.get_cursor()
self.source_store.clear()
+ self.sourceslist.refresh()
+ self.sourceslist_visible=[]
for source in self.sourceslist.list:
- if source.invalid:
- continue
- (a_type, dist, comps) = self.matcher.match(source)
-
- contents = ""
- if source.comment != "":
- contents += "%s\n\n" % (source.comment)
- contents +="%s (%s) \n%s" % (dist,a_type, comps)
-
- self.source_store.append([contents, not source.disabled, source])
- # try to reselect the latest selected channel or if it fails the first
- # one
- if len(self.source_store) > 0 and \
- (path_x == None or self.treeview_sources.set_cursor(path_x)):
- self.treeview_sources.set_cursor(0)
- else:
- # call the cursor_changed signal if no channel is selected
- self.treeview_sources.emit("cursor_changed")
+ if not source.invalid:
+ self.sourceslist_visible.append(source)
+
+ # Sort the sources list
+ self.sourceslist_visible.sort(key=self.get_comparable)
+ dist_first = False
+ for source in self.sourceslist_visible:
+ contents = self.render_source(source)
+
+ self.source_store.append([not source.disabled, contents,
+ source, False])
+
+ def is_separator(self, model, iter, column):
+ return model.get_value(iter, column)
+
def reload_keyslist(self):
self.keys_store.clear()
for key in self.apt_key.list():
@@ -378,28 +522,24 @@ class SoftwareProperties(SimpleGladeApp):
if not iter:
return
source_entry = model.get_value(iter, LIST_ENTRY_OBJ)
- # see if we know what this thing should look like
- found_matcher = False
- for item in aptsources.SourceEntryTemplates(self.datadir).templates:
- if item.matches(source_entry):
- found_matcher = True
- break
- if found_matcher:
- dialog = dialog_add.dialog_add(self.window_main, self.sourceslist,
- self.datadir, source_entry)
+ if source_entry.template == None:
+ dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist,
+ source_entry, self.datadir)
else:
- dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist,
- source_entry, self.datadir)
+ dialog = dialog_edit_predefined.dialog_edit_predefined(self.window_main,
+ self.sourceslist,
+ source_entry, self.datadir)
if dialog.run() == gtk.RESPONSE_OK:
- self.reload_sourceslist()
- self.modified = True
+ self.modified_sourceslist()
+ # FIXME:outstanding from merge
def on_channel_activated(self, treeview, path, column):
"""Open the edit dialog if a channel was double clicked"""
# check if the channel can be edited
if self.button_edit.get_property("sensitive") == True:
self.on_edit_clicked(treeview)
+ # FIXME:outstanding from merge
def on_treeview_sources_cursor_changed(self, treeview):
"""set the sensitiveness of the edit and remove button
corresponding to the selected channel"""
--
cgit v1.2.3
From 34bb7b2d05692dbaab36dbad43d4b4305e0ff905 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 29 Jun 2006 00:52:16 +0200
Subject: * fixed test output of DistInfo and channels desc for Ubuntu
---
SoftwareProperties/SoftwareProperties.py | 5 +++++
UpdateManager/Common/DistInfo.py | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 037f01fb..e0d5f524 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -56,6 +56,11 @@ CONF_MAP = {
"max_age" : "APT::Archives::MaxAge"
}
+(
+COLUMN_ACTIVE,
+COLUMN_DESC
+) = range(2)
+
# columns of the source_store
(SORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4)
diff --git a/UpdateManager/Common/DistInfo.py b/UpdateManager/Common/DistInfo.py
index 873d7132..ebf83516 100644
--- a/UpdateManager/Common/DistInfo.py
+++ b/UpdateManager/Common/DistInfo.py
@@ -135,8 +135,8 @@ 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.name,
- component.description,
- component.enabled)
+ print " %s - %s - %s " % (component,
+ suite.components[component][0],
+ suite.components[component][1])
for child in suite.children:
print " %s" % child.description
--
cgit v1.2.3
From 7c0fdd7a719a1127a838a33bc9415fa4800c453b Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 29 Jun 2006 01:20:02 +0200
Subject: * self.file got lost during merging * import UI changes from UDS
Paris * fix Ubuntu channel template
---
SoftwareProperties/SoftwareProperties.py | 2 +
channels/Ubuntu.info.in | 1 +
data/SoftwareProperties.glade | 985 +++++++++++++++++++------------
3 files changed, 608 insertions(+), 380 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index e0d5f524..a5c9ba61 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -83,6 +83,8 @@ class SoftwareProperties(SimpleGladeApp):
None, domain="update-manager")
self.modified = False
+ self.file = file
+
#self.gnome_program = gnome.init("Software Properties", "0.41")
#self.gconfclient = gconf.client_get_default()
diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in
index 4bda6077..eb88ceb9 100644
--- a/channels/Ubuntu.info.in
+++ b/channels/Ubuntu.info.in
@@ -56,6 +56,7 @@ RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu/
_Description: Ubuntu 5.10 'Breezy Badger'
+Component: main
Enabled: 1
_CompDescription: Officially supported
Component: restricted
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index 085a3a57..cbc87183 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -7,7 +7,7 @@
6
620
400
- Software Preferences
+ Software Sources
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_CENTER
False
@@ -40,21 +40,88 @@
False
-
+
12
True
False
- 12
+ 18
+
+
+
+ True
+ 0
+ 0.5
+ GTK_SHADOW_NONE
+
+
+
+ True
+ 0.5
+ 0.5
+ 1
+ 1
+ 6
+ 0
+ 12
+ 0
+
+
+
+ True
+ False
+ 6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+
+ False
+ True
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ label_item
+
+
+
+
+ 0
+ False
+ True
+
+
-
+
True
0
0.5
GTK_SHADOW_NONE
-
+
True
0.5
0.5
@@ -66,167 +133,72 @@
0
-
+
True
False
6
-
+
True
True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- False
- True
- False
- True
- False
- False
- False
-
-
-
-
+ CD-ROM/DVD
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
0
- True
- True
+ False
+ False
-
+
True
- GTK_BUTTONBOX_START
- 6
-
-
-
- True
- True
- True
- gtk-add
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
-
-
- True
- True
- True
- gtk-remove
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
+ False
+ 12
-
+
True
- True
True
- gtk-edit
- True
+ Internet:
+ True
GTK_RELIEF_NORMAL
True
-
+ False
+ False
+ True
+
+ 0
+ False
+ False
+
-
+
True
- True
- True
- GTK_RELIEF_NORMAL
+ False
True
-
-
-
-
- True
- 0.5
- 0.5
- 0
- 0
- 0
- 0
- 0
- 0
-
-
-
- True
- False
- 2
-
-
-
- True
- gtk-cdrom
- 4
- 0.5
- 0.5
- 0
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- Add _Cdrom
- True
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
-
+
+ 0
+ True
+ True
+
0
False
- True
+ False
@@ -235,9 +207,9 @@
-
+
True
- <b>Channels</b>
+ <b>Location</b>
False
True
GTK_JUSTIFY_LEFT
@@ -259,7 +231,7 @@
0
- True
+ False
True
@@ -271,9 +243,9 @@
-
+
True
- Installation Media
+
False
False
GTK_JUSTIFY_LEFT
@@ -294,191 +266,326 @@
-
+
12
True
- 0
- 0.5
- GTK_SHADOW_NONE
+ False
+ 18
-
+
True
- 0.5
- 0.5
- 1
- 1
- 6
- 0
- 12
- 0
+ 0
+ 0.5
+ GTK_SHADOW_NONE
-
+
True
- False
- 6
+ 0.5
+ 0.5
+ 1
+ 1
+ 6
+ 0
+ 12
+ 0
-
+
True
False
6
-
- True
- True
- _Check for updates automatically:
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
-
- 0
- False
- True
-
+
-
- True
-
- False
- True
-
-
-
- 0
- True
- True
-
+
-
-
- 0
- False
- False
-
-
-
-
- True
- True
- _Download updates in the background, but do not install them
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
+
+
+
-
- 0
- False
- False
-
+
+
-
-
- True
- Only security updates from the official Ubuntu servers will be installed automatically
- True
- _Install security updates without confirmation
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
-
- 0
- False
- False
-
-
+
+
+ True
+ <b>Internet Updates</b>
+ False
+ True
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ label_item
+
+
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+ 0
+ 0.5
+ GTK_SHADOW_NONE
+
+
+
+ True
+ 0.5
+ 0.5
+ 1
+ 1
+ 6
+ 0
+ 12
+ 0
-
+
+ True
False
6
-
+
True
- True
- D_elete downloaded software files:
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
+ False
+ 6
+
+
+
+ True
+ True
+ _Check for updates automatically:
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+
+ False
+ True
+
+
+
+ 0
+ True
+ True
+
+
0
False
- True
+ False
-
+
True
-
- False
- True
-
+ False
+ 0
+
+
+
+ True
+
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 6
+
+
+
+ True
+ True
+ _Download updates automatically, but do not install them
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Only security updates from the official Ubuntu servers will be installed automatically
+ True
+ _Install security updates without confirmation
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+
+ 0
+ False
+ False
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ False
+ 6
+
+
+
+ True
+ True
+ D_elete downloaded software files:
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+
+ False
+ True
+
+
+
+ 0
+ True
+ True
+
+
0
- True
+ False
True
-
- 0
- False
- True
-
-
-
-
-
- True
- <b>Internet updates</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
+
+
+ True
+ <b>Automatic Updates</b>
+ False
+ True
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ label_item
+
+
- label_item
+ 0
+ False
+ True
@@ -489,9 +596,9 @@
-
+
True
- Internet Updates
+
False
False
GTK_JUSTIFY_LEFT
@@ -512,121 +619,102 @@
-
+
12
True
- 0
- 0.5
- GTK_SHADOW_NONE
+ False
+ 6
+
+
+
+ True
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+ GTK_SHADOW_IN
+ GTK_CORNER_TOP_LEFT
+
+
+
+ True
+ True
+ False
+ True
+ False
+ True
+ False
+ False
+ False
+
+
+
+
+
+
+ 0
+ True
+ True
+
+
-
+
True
- 0.5
- 0.5
- 1
- 1
- 6
- 0
- 12
- 0
+ False
+ 18
-
+
True
False
6
-
+
True
+ True
True
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
- GTK_SHADOW_IN
- GTK_CORNER_TOP_LEFT
-
-
-
- True
- True
- False
- True
- False
- True
- False
- False
- False
-
-
+ gtk-add
+ True
+ GTK_RELIEF_NORMAL
+ True
+
0
- True
+ False
True
-
+
True
- False
- 6
-
-
-
- True
- Restore the default keys of your distribution
- True
- Restore _Defaults
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- 0
- False
- False
-
-
-
-
-
- True
- True
- gtk-remove
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- 0
- False
- False
- GTK_PACK_END
-
-
+ True
+ True
+ gtk-edit
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+ 0
+ False
+ True
+
+
-
-
- True
- Import the public key from a trusted software provider
- True
- _Import Key File
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
- 0
- False
- False
- GTK_PACK_END
-
-
+
+
+ True
+ True
+ True
+ gtk-remove
+ True
+ GTK_RELIEF_NORMAL
+ True
+
0
@@ -635,30 +723,167 @@
+
+ 0
+ True
+ True
+
+
+
+
+
+ True
+ True
+ gtk-revert-to-saved
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+ 0
+ False
+ False
+
+
+
+
+ 0
+ False
+ True
+
+
+
+
+ False
+ True
+
+
+
+
+
+ True
+ Additional Software
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ tab
+
+
+
+
+
+ 12
+ True
+ False
+ 6
+
+
+
+ True
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+ GTK_SHADOW_IN
+ GTK_CORNER_TOP_LEFT
+
+
+
+ True
+ True
+ False
+ True
+ False
+ True
+ False
+ False
+ False
+
+
+ 0
+ True
+ True
+
-
+
True
- <b>Keys</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
+ False
+ 6
+
+
+
+ True
+ Restore the default keys of your distribution
+ True
+ Restore _Defaults
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ True
+ gtk-remove
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+ 0
+ False
+ False
+ GTK_PACK_END
+
+
+
+
+
+ True
+ Import the public key from a trusted software provider
+ True
+ _Import Key File
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+ 0
+ False
+ False
+ GTK_PACK_END
+
+
- label_item
+ 0
+ False
+ True
--
cgit v1.2.3
From 9d01fe4b4e6c370f76e83f500554cd7dd0512093 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 29 Jun 2006 02:47:36 +0200
Subject: * Extract the components and the child repos (updates) of the
currently used distribution from the templates
---
SoftwareProperties/SoftwareProperties.py | 60 ++++++++++++++++++++++++++++++--
data/SoftwareProperties.glade | 19 ++++++++--
2 files changed, 74 insertions(+), 5 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index a5c9ba61..70c6f5dc 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -63,7 +63,7 @@ COLUMN_DESC
# columns of the source_store
-(SORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4)
+(STORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4)
class SoftwareProperties(SimpleGladeApp):
@@ -75,6 +75,16 @@ class SoftwareProperties(SimpleGladeApp):
self.distribution = pipe.read().strip()
del pipe
+ # get the current LSB distribution description
+ pipe = os.popen("lsb_release -d | cut -d : -f 2-")
+ self.dist_desc = pipe.read().strip()
+ del pipe
+
+ # get the current LSB distribution codename
+ pipe = os.popen("lsb_release -c | cut -d : -f 2-")
+ self.dist_codename = pipe.read().strip()
+ del pipe
+
# FIXME: some saner way is needed here
if datadir == None:
datadir = "/usr/share/update-manager/"
@@ -101,11 +111,48 @@ class SoftwareProperties(SimpleGladeApp):
toplevel = gtk.gdk.window_foreign_new(int(options.toplevel))
self.window_main.window.set_transient_for(toplevel)
- self.window_main.show()
-
self.init_sourceslist()
self.reload_sourceslist()
+ # Set up options in the user interface
+ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
+ self.label_updates.set_label(_("%s Updates") % self.distribution)
+ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
+ self.label_dist_software.set_label(_("%s Software") % self.distribution)
+ self.label_dist_name.set_label("%s" % self.dist_desc)
+
+ # find the source entry for your current distribution
+ for template in self.sourceslist.matcher.templates:
+ if template.name == self.dist_codename and\
+ template.distribution == template.distribution:
+ print "yeah! found source for %s" % self.dist_desc
+ print template.description, template.base_uri, template.components
+ self.dist_template = template
+ break
+ # FIXME: Make this configurable for reuse in Debian
+ #components = [("main", _("Free software that is supported by Canonical"
+ # " Ltd. (main)")),
+ # ("universe", _("Free software that is maintained by "
+ # "the community (universe)")),
+ # ("restricted", _("Non-free drivers (restricted)")),
+ # ("multiverse", _("Software that is restricted by copyright "
+ # "or legal issues (multiverse)"))]
+
+ # Setup the checkbuttons for the components
+ print self.dist_template.components.keys()
+ for comp in self.dist_template.components.keys():
+ checkbox = gtk.CheckButton(label=self.dist_template.components[comp][0])
+ self.vbox_dist_comps.add(checkbox)
+ checkbox.show()
+
+ # Setup the checkbuttons for the child repos / updates
+ for template in self.dist_template.children:
+ checkbox = gtk.CheckButton(label=template.description)
+ self.vbox_updates.add(checkbox)
+ checkbox.show()
+
+ self.window_main.show()
+
# internet update setings
# this maps the key (combo-box-index) to the auto-update-interval value
@@ -238,6 +285,13 @@ class SoftwareProperties(SimpleGladeApp):
self.window_main.hide()
def init_sourceslist(self):
+ """
+ Read all valid sources into our ListStore
+ """
+ # STORE_ACTIVE - is the source enabled or disabled
+ # STORE_DESCRIPTION - description of the source entry
+ # STORE_SOURCE - the source entry object
+ # STORE_SEPARATOR - if the entry is a separator
self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
gobject.TYPE_STRING,
gobject.TYPE_PYOBJECT,
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index cbc87183..ac81bd1b 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -7,7 +7,7 @@
6
620
400
- Software Sources
+ Software Repositories
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_CENTER
False
@@ -76,7 +76,22 @@
-
+
+ True
+ True
+ Source code
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
--
cgit v1.2.3
From 71424532c392df4612e170fb6a4737db3622c0b1 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 29 Jun 2006 12:58:59 +0200
Subject: * use a Distribution class to store distribution related information
* main work on identifing the distribution repositories * show enabled comps
and enabled updates * rename dialog to "software sources" * a lot of smaller
stuff
---
SoftwareProperties/SoftwareProperties.py | 279 ++++++++++++++++++++++++-------
SoftwareProperties/aptsources.py | 1 +
data/SoftwareProperties.glade | 23 ++-
3 files changed, 243 insertions(+), 60 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 70c6f5dc..0f4f5f66 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -57,34 +57,133 @@ CONF_MAP = {
}
(
-COLUMN_ACTIVE,
-COLUMN_DESC
+ COLUMN_ACTIVE,
+ COLUMN_DESC
) = range(2)
# columns of the source_store
-(STORE_ACTIVE, STORE_DESCRIPTION, STORE_SOURCE, STORE_SEPARATOR) = range(4)
+(
+ STORE_ACTIVE,
+ STORE_DESCRIPTION,
+ STORE_SOURCE,
+ STORE_SEPARATOR,
+ STORE_VISIBLE
+) = range(5)
+
+class Distribution:
+ def __init__(self):
+ """"
+ Container for distribution specific informations
+ """
+ # LSB information
+ self.id = ""
+ self.codename = ""
+ self.description = ""
+ self.release = ""
+
+ # corresponding sources
+ self.source_template = None
+ self.child_sources = []
+ self.main_sources = []
+ self.enabled_comps = []
+ self.used_media = []
+ self.source_code_sources = []
+
+ # location of the sources
+ self.cdrom_available = False
+ self.use_internet = False
+ self.main_server = ""
+ self.nearest_server = ""
+ self.other_servers = []
+
+ # get the LSB information
+ lsb_info = []
+ for lsb_option in ["-i", "-c", "-d", "-r"]:
+ pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
+ lsb_info.append(pipe.read().strip())
+ del pipe
+ (self.id, self.codename, self.description, self.release) = lsb_info
+
+ def get_sources(self, sources_list):
+ """
+ Find the corresponding template, main and child sources
+ for the distribution
+ """
+ # find the distro template
+ for template in sources_list.matcher.templates:
+ if template.name == self.codename and\
+ template.distribution == self.id:
+ print "yeah! found a template for %s" % self.description
+ print template.description, template.base_uri, template.components
+ self.source_template = template
+ break
+ if self.source_template == None:
+ print "Error: could not find a distribution template"
+ sys.exit(1)
+
+ # find main and child sources
+ media = []
+ comps = []
+ source_code = []
+ for source in sources_list.list:
+ if source.disabled == False and source.invalid == False and\
+ source.dist == self.codename and\
+ source.template.name == self.codename:
+ print "yeah! found a distro repo: %s" % source.line
+ if source.type == "deb":
+ self.main_sources.append(source)
+ comps.extend(source.comps)
+ media.append(source.uri)
+ elif source.type == "deb-src":
+ self.source_code_sources.append(source)
+ if source.template in self.source_template.children:
+ 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)
+
+ self.get_mirrors()
+
+ def get_mirrors(self):
+ """
+ Provide a set of mirrors where you can get the distribution from
+ """
+ # the main server is stored in the template
+ self.main_server = self.source_template.base_uri
+
+ # try to guess the nearest mirror from the locale
+ # FIXME: for debian we need something different
+ if self.id == "Ubuntu":
+ locale = os.getenv("LANG", default="en.UK")
+ a = locale.find("_")
+ z = locale.find(".")
+ if z == -1:
+ z = len(locale)
+ country = locale[a+1:z].lower()
+ self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % country
+
+ # other used servers
+ for medium in self.used_media:
+ if medium.startswith("cdrom:"):
+ self.cdrom_available = True
+ else:
+ # seems to be a network source
+ self.use_internet = True
+ if medium != self.main_server or \
+ medium != self.nearest_server:
+ self.other_servers.append(medium)
+
class SoftwareProperties(SimpleGladeApp):
def __init__(self, datadir=None, options=None, parent=None, file=None):
gtk.window_set_default_icon_name("software-properties")
- # get the current LSB distribution name
- pipe = os.popen("lsb_release -i | cut -d : -f 2-")
- self.distribution = pipe.read().strip()
- del pipe
-
- # get the current LSB distribution description
- pipe = os.popen("lsb_release -d | cut -d : -f 2-")
- self.dist_desc = pipe.read().strip()
- del pipe
-
- # get the current LSB distribution codename
- pipe = os.popen("lsb_release -c | cut -d : -f 2-")
- self.dist_codename = pipe.read().strip()
- del pipe
-
# FIXME: some saner way is needed here
if datadir == None:
datadir = "/usr/share/update-manager/"
@@ -95,6 +194,8 @@ class SoftwareProperties(SimpleGladeApp):
self.file = file
+ self.distribution = Distribution()
+
#self.gnome_program = gnome.init("Software Properties", "0.41")
#self.gconfclient = gconf.client_get_default()
@@ -114,43 +215,6 @@ class SoftwareProperties(SimpleGladeApp):
self.init_sourceslist()
self.reload_sourceslist()
- # Set up options in the user interface
- # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
- self.label_updates.set_label(_("%s Updates") % self.distribution)
- # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
- self.label_dist_software.set_label(_("%s Software") % self.distribution)
- self.label_dist_name.set_label("%s" % self.dist_desc)
-
- # find the source entry for your current distribution
- for template in self.sourceslist.matcher.templates:
- if template.name == self.dist_codename and\
- template.distribution == template.distribution:
- print "yeah! found source for %s" % self.dist_desc
- print template.description, template.base_uri, template.components
- self.dist_template = template
- break
- # FIXME: Make this configurable for reuse in Debian
- #components = [("main", _("Free software that is supported by Canonical"
- # " Ltd. (main)")),
- # ("universe", _("Free software that is maintained by "
- # "the community (universe)")),
- # ("restricted", _("Non-free drivers (restricted)")),
- # ("multiverse", _("Software that is restricted by copyright "
- # "or legal issues (multiverse)"))]
-
- # Setup the checkbuttons for the components
- print self.dist_template.components.keys()
- for comp in self.dist_template.components.keys():
- checkbox = gtk.CheckButton(label=self.dist_template.components[comp][0])
- self.vbox_dist_comps.add(checkbox)
- checkbox.show()
-
- # Setup the checkbuttons for the child repos / updates
- for template in self.dist_template.children:
- checkbox = gtk.CheckButton(label=template.description)
- self.vbox_updates.add(checkbox)
- checkbox.show()
-
self.window_main.show()
# internet update setings
@@ -260,6 +324,101 @@ class SoftwareProperties(SimpleGladeApp):
if self.file != None:
self.open_file(file)
+ def distro_to_widgets(self):
+ """
+ Represent the distro information in the user interface
+ """
+ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
+ self.label_updates.set_label(_("%s Updates") % self.distribution.id)
+ # TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
+ self.label_dist_software.set_label(_("%s Software") % self.distribution.id)
+ self.label_dist_name.set_label("%s" % self.distribution.description)
+
+ # Setup the checkbuttons for the components
+ 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])
+ # 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:
+ checkbox.set_active(True)
+ # do not allow to disable an enabled main component
+ if comp == "main":
+ checkbox.set_property("sensitive", False)
+ # setup the callback and show the checkbutton
+ checkbox.connect("toggled", self.on_checkbutton_comp_toggled, comp)
+ self.vbox_dist_comps.add(checkbox)
+ checkbox.show()
+
+ # Setup the checkbuttons for the child repos / updates
+ for checkbutton in self.vbox_updates.get_children():
+ self.vbox_updates.remove(checkbutton)
+ for template in self.distribution.source_template.children:
+ checkbox = gtk.CheckButton(label=template.description)
+ for child in self.distribution.child_sources:
+ if child.template == template:
+ # check if all comps of the main source are also enabled
+ # for the child source
+ if len(set(child.comps) - self.distribution.enabled_comps) == 0:
+ checkbox.set_active(True)
+ elif len(set(child.comps) - self.distribution.enabled_comps) ==\
+ len(self.distribution.enabled_comps):
+ checkbox.set_active(False)
+ else:
+ checkbox.set_inconsistent(True)
+ #FIXME: currently we don't handle multiple sources of the same
+ # child source - the required effort would be questionable
+ break
+ # setup the callback and show the checkbutton
+ checkbox.connect("toggled", self.on_checkbutton_child_toggled,
+ template.name)
+ self.vbox_updates.add(checkbox)
+ checkbox.show()
+
+ # setup the location
+ # FIXME: how to handle uncommented cdroms?
+ if self.distribution.cdrom_available == True:
+ self.checkbutton_cdrom.set_active(True)
+ else:
+ self.checkbutton_cdrom.set_active(False)
+
+ # FIXME: needs inconsistence
+ if self.distribution.use_internet == True:
+ self.checkbutton_internet.set_active(True)
+ self.combobox_server.set_property("sensitive", True)
+ else:
+ self.checkbutton_internet.set_active(False)
+ self.combobox_server.set_property("sensitive", False)
+ server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
+ self.combobox_server.set_model(server_store)
+ cell = gtk.CellRendererText()
+ self.combobox_server.pack_start(cell, True)
+ self.combobox_server.add_attribute(cell, 'text', 0)
+ server_store.append([_("%s (default)") % self.distribution.main_server,
+ self.distribution.main_server])
+ server_store.append([_("%s (nearest)") % self.distribution.nearest_server,
+ self.distribution.main_server])
+ for server in self.distribution.other_servers:
+ server_store.append(["%s" % server, server])
+ # FIXME: which one to choose?
+ self.combobox_server.set_active(0)
+
+
+ def on_checkbutton_comp_toggled(self, checkbutton, comp):
+ """
+ Enable or disable a component for the distribution main repository
+ and its children
+ """
+ print "Set %s to %s" % (checkbutton.get_active(), comp)
+ state = checkbutton.get_active()
+
+ def on_checkbutton_child_toggled(self, checkbutton, child):
+ """
+ Enable or disable a child repo of the distribution main repository
+ """
+ print "Set %s to %s" % (checkbutton.get_active(), child)
+
def open_file(self, file):
"""Show an confirmation for adding the channels of the specified file"""
#dialog = dialog_sources_list.AddSourcesList(self.window_main,
@@ -292,9 +451,11 @@ class SoftwareProperties(SimpleGladeApp):
# STORE_DESCRIPTION - description of the source entry
# STORE_SOURCE - the source entry object
# STORE_SEPARATOR - if the entry is a separator
+ # STORE_VISIBLE - if the entry is shown or hidden
self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
gobject.TYPE_STRING,
gobject.TYPE_PYOBJECT,
+ gobject.TYPE_BOOLEAN,
gobject.TYPE_BOOLEAN)
self.treeview_sources.set_model(self.source_store)
self.treeview_sources.set_row_separator_func(self.is_separator,
@@ -428,8 +589,11 @@ class SoftwareProperties(SimpleGladeApp):
self.source_store.clear()
self.sourceslist.refresh()
self.sourceslist_visible=[]
+ self.distribution.get_sources(self.sourceslist)
for source in self.sourceslist.list:
- if not source.invalid:
+ if not source.invalid or\
+ source not in self.distribution.main_sources or\
+ source not in self.distribution.child_sources:
self.sourceslist_visible.append(source)
# Sort the sources list
@@ -440,7 +604,8 @@ class SoftwareProperties(SimpleGladeApp):
contents = self.render_source(source)
self.source_store.append([not source.disabled, contents,
- source, False])
+ source, False, True])
+ self.distro_to_widgets()
def is_separator(self, model, iter, column):
return model.get_value(iter, column)
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 5735960b..fc08fb12 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -90,6 +90,7 @@ class SourceEntry:
self.file = file
self.parse(line)
self.template = None
+ self.children = []
# works mostely like split but takes [] into account
def mysplit(self, line):
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index ac81bd1b..8f747689 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -7,7 +7,7 @@
6
620
400
- Software Repositories
+ Software Sources
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_CENTER
False
@@ -66,13 +66,30 @@
0
-
+
True
False
6
-
+
+ True
+ False
+ 6
+
+
+
+
+
+
+
+
+
+
+ 0
+ True
+ True
+
--
cgit v1.2.3
From 972a8ca2f1ff4466096505262305260bbd507caf Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 29 Jun 2006 13:48:14 +0200
Subject: * add long descriptions for components * fix some boolean stuff (hide
distru sources) * also rename the menu entry of the app
---
SoftwareProperties/SoftwareProperties.py | 20 +++++++++++---------
UpdateManager/Common/DistInfo.py | 21 ++++++++++++++-------
channels/Ubuntu.info.in | 14 +++++++++-----
data/software-properties.desktop.in | 6 +++---
4 files changed, 37 insertions(+), 24 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
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
--
cgit v1.2.3
From 2016b797e5796fa7c0f911e040616a7f9ccddebc Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 30 Jun 2006 14:04:54 +0200
Subject: * do not show disabled sources in the additional software list * also
collect all child sources
---
SoftwareProperties/SoftwareProperties.py | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index da52b272..7c0e11f6 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -87,6 +87,7 @@ class Distribution:
self.source_template = None
self.child_sources = []
self.main_sources = []
+ self.cdrom_sources = []
self.enabled_comps = []
self.used_media = []
self.source_code_sources = []
@@ -129,20 +130,28 @@ class Distribution:
comps = []
source_code = []
for source in sources_list.list:
- if source.disabled == False and source.invalid == False and\
+ if source.invalid == False and\
source.dist == self.codename and\
source.template.name == self.codename:
print "yeah! found a distro repo: %s" % source.line
+ # cdroms need do be handled differently
+ if source.uri.startswith("cdrom:"):
+ self.cdrom_sources.append(source)
if source.type == "deb":
self.main_sources.append(source)
- comps.extend(source.comps)
- media.append(source.uri)
+ if source.disabled == False:
+ comps.extend(source.comps)
+ media.append(source.uri)
elif source.type == "deb-src":
self.source_code_sources.append(source)
+ print source.type
+ print len(self.source_code_sources)
if source.template in self.source_template.children:
print "yeah! child found: %s" % source.template.name
if source.type == "deb":
self.child_sources.append(source)
+ elif source.type == "deb-src":
+ self.source_code_sources.append(source)
self.enabled_comps = set(comps)
self.used_media = set(media)
@@ -342,9 +351,6 @@ class SoftwareProperties(SimpleGladeApp):
# FIXME: use inconsistence if there are main sources with not all comps
if comp in self.distribution.enabled_comps:
checkbox.set_active(True)
- # do not allow to disable an enabled main component
- if comp == "main":
- checkbox.set_property("sensitive", False)
# setup the callback and show the checkbutton
checkbox.connect("toggled", self.on_checkbutton_comp_toggled, comp)
self.vbox_dist_comps.add(checkbox)
@@ -405,6 +411,7 @@ class SoftwareProperties(SimpleGladeApp):
# FIXME: which one to choose?
self.combobox_server.set_active(0)
+ # Check for source code sources
def on_checkbutton_comp_toggled(self, checkbutton, comp):
"""
@@ -592,10 +599,14 @@ class SoftwareProperties(SimpleGladeApp):
self.sourceslist.refresh()
self.sourceslist_visible=[]
self.distribution.get_sources(self.sourceslist)
+ # Only show sources that are no binary or source code repos for
+ # the current distribution, but show cdrom based repos
for source in self.sourceslist.list:
if not source.invalid and\
- source not in self.distribution.main_sources and\
- source not in self.distribution.child_sources:
+ ((source not in self.distribution.main_sources and\
+ source not in self.distribution.child_sources) or\
+ source in self.distribution.cdrom_sources) and\
+ source not in self.distribution.source_code_sources:
self.sourceslist_visible.append(source)
# Sort the sources list
--
cgit v1.2.3
From 259ccb59e4ac78074f8af195eeb1ee88f257048e Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Sat, 15 Jul 2006 18:11:07 +0200
Subject: * Can now modify the sources list (at the moment only in memory) * A
lot of cleanup and minor fixes
---
SoftwareProperties/SoftwareProperties.py | 199 +++++++++++++++++++++++++------
data/SoftwareProperties.glade | 49 ++++----
2 files changed, 188 insertions(+), 60 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 7c0e11f6..c4667aa0 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -21,6 +21,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
+import pdb
import sys
import apt
import apt_pkg
@@ -83,6 +84,19 @@ class Distribution:
self.description = ""
self.release = ""
+ # get the LSB information
+ lsb_info = []
+ for lsb_option in ["-i", "-c", "-d", "-r"]:
+ pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
+ lsb_info.append(pipe.read().strip())
+ del pipe
+ (self.id, self.codename, self.description, self.release) = lsb_info
+
+ def get_sources(self, sources_list):
+ """
+ Find the corresponding template, main and child sources
+ for the distribution
+ """
# corresponding sources
self.source_template = None
self.child_sources = []
@@ -90,6 +104,7 @@ class Distribution:
self.cdrom_sources = []
self.enabled_comps = []
self.used_media = []
+ self.get_source_code = False
self.source_code_sources = []
# location of the sources
@@ -98,26 +113,13 @@ class Distribution:
self.main_server = ""
self.nearest_server = ""
self.other_servers = []
-
- # get the LSB information
- lsb_info = []
- for lsb_option in ["-i", "-c", "-d", "-r"]:
- pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
- lsb_info.append(pipe.read().strip())
- del pipe
- (self.id, self.codename, self.description, self.release) = lsb_info
- def get_sources(self, sources_list):
- """
- Find the corresponding template, main and child sources
- for the distribution
- """
# find the distro template
for template in sources_list.matcher.templates:
if template.name == self.codename and\
template.distribution == self.id:
- print "yeah! found a template for %s" % self.description
- print template.description, template.base_uri, template.components
+ #print "yeah! found a template for %s" % self.description
+ #print template.description, template.base_uri, template.components
self.source_template = template
break
if self.source_template == None:
@@ -132,8 +134,9 @@ class Distribution:
for source in sources_list.list:
if source.invalid == False and\
source.dist == self.codename and\
+ source.template and\
source.template.name == self.codename:
- print "yeah! found a distro repo: %s" % source.line
+ #print "yeah! found a distro repo: %s" % source.line
# cdroms need do be handled differently
if source.uri.startswith("cdrom:"):
self.cdrom_sources.append(source)
@@ -144,10 +147,8 @@ class Distribution:
media.append(source.uri)
elif source.type == "deb-src":
self.source_code_sources.append(source)
- print source.type
- print len(self.source_code_sources)
if source.template in self.source_template.children:
- print "yeah! child found: %s" % source.template.name
+ #print "yeah! child found: %s" % source.template.name
if source.type == "deb":
self.child_sources.append(source)
elif source.type == "deb-src":
@@ -186,6 +187,24 @@ class Distribution:
not re.match(medium, self.nearest_server):
self.other_servers.append(medium)
+ def add_source(self, sources_list, type=None,
+ uri=None, dist=None, comps=None, comment=""):
+ if uri == None:
+ # FIXME: Add support for the server selector
+ uri = self.main_server
+ if dist == None:
+ dist = self.codename
+ if comps == None:
+ comps = list(self.enabled_comps)
+ if type == None:
+ type = "deb"
+ if comment == "":
+ comment == "Added by software-properties"
+
+ sources_list.add(type, uri, dist, comps, comment)
+ # FIXME: get rid of the ui dependency
+ if self.get_source_code == True:
+ sources_list.add("deb-src", uri, dist, comps, comment)
class SoftwareProperties(SimpleGladeApp):
@@ -203,6 +222,9 @@ class SoftwareProperties(SimpleGladeApp):
self.file = file
self.distribution = Distribution()
+ cell = gtk.CellRendererText()
+ self.combobox_server.pack_start(cell, True)
+ self.combobox_server.add_attribute(cell, 'text', 0)
#self.gnome_program = gnome.init("Software Properties", "0.41")
#self.gconfclient = gconf.client_get_default()
@@ -352,7 +374,7 @@ class SoftwareProperties(SimpleGladeApp):
if comp in self.distribution.enabled_comps:
checkbox.set_active(True)
# setup the callback and show the checkbutton
- checkbox.connect("toggled", self.on_checkbutton_comp_toggled, comp)
+ checkbox.connect("toggled", self.on_component_toggled, comp)
self.vbox_dist_comps.add(checkbox)
checkbox.show()
@@ -367,20 +389,25 @@ class SoftwareProperties(SimpleGladeApp):
# for the child source
if len(set(child.comps) - self.distribution.enabled_comps) == 0:
checkbox.set_active(True)
- elif len(set(child.comps) - self.distribution.enabled_comps) ==\
- len(self.distribution.enabled_comps):
- checkbox.set_active(False)
else:
+ checkbox.set_active(False)
+ if len(self.distribution.enabled_comps ^ set(child.comps)) > 0:
checkbox.set_inconsistent(True)
+ checkbox.set_active(False)
#FIXME: currently we don't handle multiple sources of the same
# child source - the required effort would be questionable
break
# setup the callback and show the checkbutton
checkbox.connect("toggled", self.on_checkbutton_child_toggled,
- template.name)
+ template)
self.vbox_updates.add(checkbox)
checkbox.show()
+ if len(self.distribution.enabled_comps) < 1:
+ self.vbox_updates.set_sensitive(False)
+ else:
+ self.vbox_updates.set_sensitive(True)
+
# setup the location
# FIXME: how to handle uncommented cdroms?
if self.distribution.cdrom_available == True:
@@ -397,9 +424,6 @@ class SoftwareProperties(SimpleGladeApp):
self.combobox_server.set_property("sensitive", False)
server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
self.combobox_server.set_model(server_store)
- 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,
@@ -410,22 +434,127 @@ class SoftwareProperties(SimpleGladeApp):
server_store.append(["%s" % server, server])
# FIXME: which one to choose?
self.combobox_server.set_active(0)
+ self.combobox_server.connect("changed", self.on_combobox_server_changed)
# Check for source code sources
+ self.checkbutton_source_code.set_inconsistent(False)
+ if len(self.distribution.source_code_sources) < 1:
+ # we don't have any source code sources, so
+ # uncheck the button
+ self.checkbutton_source_code.set_active(False)
+ self.distribution.get_source_code = False
+ else:
+ # there are source code sources, so we check the button
+ self.checkbutton_source_code.set_active(True)
+ self.distribution.get_source_code = True
+ # check if there is a corresponding source code source for
+ # every binary source. if not set the checkbutton to inconsistent
+ templates = {}
+ sources = []
+ sources.extend(self.distribution.main_sources)
+ sources.extend(self.distribution.child_sources)
+ for source in sources:
+ if templates.has_key(source.template):
+ templates[source.template] += set(source.comps)
+ else:
+ templates[source.template] = set(source.comps)
+ # add fake http sources for the cdrom, since the sources
+ # for the cdrom are only available in the internet
+ for source in self.distribution.cdrom_sources:
+ if templates.has_key(self.distribution.source_template):
+ templates[self.distribution.source_template] += set(source.comps)
+ else:
+ templates[self.distribution.source_template] += set(source.comps)
+ for source in self.distribution.source_code_sources:
+ if not templates.has_key(source.template) or \
+ (templates.has_key(source.template) and \
+ len(set(templates[source.template]) ^ set(source.comps)) > 0):
+ self.checkbutton_source_code.set_inconsistent(True)
+ self.distribution.get_source_code = False
+ break
+ self.checkbutton_source_code.connect("toggled",
+ self.on_checkbutton_source_code_toggled)
- def on_checkbutton_comp_toggled(self, checkbutton, comp):
+ def on_component_toggled(self, checkbutton, comp):
"""
- Enable or disable a component for the distribution main repository
- and its children
+ Sync the components of all main sources (excluding cdroms),
+ child sources and source code sources
"""
- print "Set %s to %s" % (checkbutton.get_active(), comp)
- state = checkbutton.get_active()
-
- def on_checkbutton_child_toggled(self, checkbutton, child):
+ sources = []
+ sources.extend(self.distribution.main_sources)
+ sources.extend(self.distribution.child_sources)
+ if checkbutton.get_active() == True:
+ # check if there is a main source at all
+ if len(self.distribution.main_sources) < 1:
+ # create a new main source
+ self.distribution.add_source(self.sourceslist, comps=[comp])
+ # add the comp to all main, child and source code sources
+ for source in sources:
+ if comp not in source.comps:
+ source.comps.append(comp)
+ if self.distribution.get_source_code == True:
+ for source in self.distribution.source_code_sources:
+ if comp not in source.comps: source.comps.append(comp)
+ else:
+ for source in sources:
+ if comp in source.comps:
+ source.comps.remove(comp)
+ if len(source.comps) < 1:
+ self.sourceslist.remove(source)
+ self.massive_debug_output()
+
+ def massive_debug_output(self):
+ """
+ do not write our changes yet - just print them to std_out
+ """
+ print "START SOURCES.LIST:"
+ for source in self.sourceslist:
+ print source.str()
+ print "END SOURCES.LIST\n"
+ self.distribution.get_sources(self.sourceslist)
+ self.distro_to_widgets()
+
+ def on_checkbutton_child_toggled(self, checkbutton, template):
"""
Enable or disable a child repo of the distribution main repository
"""
- print "Set %s to %s" % (checkbutton.get_active(), child)
+ if checkbutton.get_active() == False:
+ for source in self.distribution.child_sources:
+ if source.template == template:
+ self.sourceslist.remove(source)
+ else:
+ self.distribution.add_source(self.sourceslist,
+ uri=template.base_uri,
+ dist=template.name)
+ self.massive_debug_output()
+
+ def on_checkbutton_source_code_toggled(self, checkbutton):
+ """
+ Disable or enable the source code for all sources
+ """
+ self.distribution.get_source_code = checkbutton.get_active()
+ sources = []
+ sources.extend(self.distribution.main_sources)
+ sources.extend(self.distribution.child_sources)
+
+ # remove all exisiting sources
+ for source in self.distribution.source_code_sources:
+ self.sourceslist.remove(source)
+
+ if checkbutton.get_active() == True:
+ for source in sources:
+ self.sourceslist.add("deb-src",
+ source.uri,
+ source.dist,
+ source.comps,
+ "Added by software-properties")
+ for source in self.distribution.cdrom_sources:
+ self.sourceslist.add("deb-src",
+ self.distribution.source_template.base_uri,
+ self.distribution.source_template.name,
+ source.comps,
+ "Added by software-properties")
+ self.massive_debug_output()
def open_file(self, file):
"""Show an confirmation for adding the channels of the specified file"""
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index 8f747689..5aa5ee5c 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -69,7 +69,7 @@
True
False
- 6
+ 18
@@ -91,25 +91,6 @@
True
-
-
-
- True
- True
- Source code
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 0
- False
- False
-
-
@@ -172,7 +153,6 @@
- True
True
CD-ROM/DVD
True
@@ -189,6 +169,25 @@
+
+
+ True
+ True
+ Source code
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
+
True
@@ -199,7 +198,7 @@
True
True
- Internet:
+ Download software from the Internet:
True
GTK_RELIEF_NORMAL
True
@@ -229,8 +228,8 @@
0
- False
- False
+ True
+ True
@@ -241,7 +240,7 @@
True
- <b>Location</b>
+ <b>Options</b>
False
True
GTK_JUSTIFY_LEFT
--
cgit v1.2.3
From 2e29da15b6d5c0596c1d282b99ad4b5b027ec6fe Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Sat, 15 Jul 2006 18:13:17 +0200
Subject: * add missing dummy function on_combobox_server_changed
---
SoftwareProperties/SoftwareProperties.py | 2 ++
1 file changed, 2 insertions(+)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index c4667aa0..28d550eb 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -474,6 +474,8 @@ class SoftwareProperties(SimpleGladeApp):
break
self.checkbutton_source_code.connect("toggled",
self.on_checkbutton_source_code_toggled)
+ def on_combobox_server_changed(self, combobox):
+ print "FIXME"
def on_component_toggled(self, checkbutton, comp):
"""
--
cgit v1.2.3
From dc51a1fbcc190ada20439979c0546a459a0edabd Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Wed, 19 Jul 2006 22:38:09 +0200
Subject: * allow to specify a server for all distro sources * use iso-codes to
display "Server for COUNTRY" instead of the URL * depend on iso-codes * write
the deb-src next to the corresponding binary line * minor code improvements *
don't only the enable the comps for a mirror repo if a new one is added -
this is just too much magic * try to reuse a disabled matching source if a
new is added
* bug fixes:
- don't use out commented sources for the distribution
- add a new source if there is none for an enabled comp or reuse the
already existing ones
- do not show disabled sources in the list
- wrong inconsistent state of the source code button
---
SoftwareProperties/SoftwareProperties.py | 150 ++++++++++++++++++++++---------
SoftwareProperties/aptsources.py | 46 ++++++----
debian/control | 2 +-
3 files changed, 138 insertions(+), 60 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 28d550eb..f9fb2c43 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -92,6 +92,21 @@ class Distribution:
del pipe
(self.id, self.codename, self.description, self.release) = lsb_info
+ # get a list of country codes and real names
+ self.countries = {}
+ try:
+ f = open("/usr/share/iso-codes/iso_3166.tab", "r")
+ lines = f.readlines()
+ for line in lines:
+ parts = line.split("\t")
+ self.countries[parts[0].lower()] = parts[1]
+ except:
+ print "could not open file '%s'" % file
+ else:
+ f.close()
+
+
+
def get_sources(self, sources_list):
"""
Find the corresponding template, main and child sources
@@ -101,6 +116,7 @@ class Distribution:
self.source_template = None
self.child_sources = []
self.main_sources = []
+ self.disabled_sources = []
self.cdrom_sources = []
self.enabled_comps = []
self.used_media = []
@@ -112,7 +128,7 @@ class Distribution:
self.use_internet = False
self.main_server = ""
self.nearest_server = ""
- self.other_servers = []
+ self.used_servers = []
# find the distro template
for template in sources_list.matcher.templates:
@@ -140,13 +156,16 @@ class Distribution:
# cdroms need do be handled differently
if source.uri.startswith("cdrom:"):
self.cdrom_sources.append(source)
- if source.type == "deb":
+ if source.type == "deb" and source.disabled == False:
self.main_sources.append(source)
- if source.disabled == False:
- comps.extend(source.comps)
- media.append(source.uri)
- elif source.type == "deb-src":
+ comps.extend(source.comps)
+ media.append(source.uri)
+ elif source.type == "deb" and source.disabled == True:
+ self.disabled_sources.append(source)
+ elif source.type.endswith("-src") and source.disabled == False:
self.source_code_sources.append(source)
+ elif source.type.endswith("-src") and source.disabled == True:
+ self.disabled_sources.append(source)
if source.template in self.source_template.children:
#print "yeah! child found: %s" % source.template.name
if source.type == "deb":
@@ -173,8 +192,10 @@ class Distribution:
z = locale.find(".")
if z == -1:
z = len(locale)
- country = locale[a+1:z].lower()
- self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % country
+ country_code = locale[a+1:z].lower()
+ self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
+ country_code
+ self.country = self.countries[country_code]
# other used servers
for medium in self.used_media:
@@ -183,12 +204,13 @@ class Distribution:
else:
# seems to be a network source
self.use_internet = True
- if not re.match(medium, self.main_server) and \
- not re.match(medium, self.nearest_server):
- self.other_servers.append(medium)
+ self.used_servers.append(medium)
def add_source(self, sources_list, type=None,
uri=None, dist=None, comps=None, comment=""):
+ """
+ Add distribution specific sources
+ """
if uri == None:
# FIXME: Add support for the server selector
uri = self.main_server
@@ -200,11 +222,13 @@ class Distribution:
type = "deb"
if comment == "":
comment == "Added by software-properties"
-
- sources_list.add(type, uri, dist, comps, comment)
- # FIXME: get rid of the ui dependency
- if self.get_source_code == True:
- sources_list.add("deb-src", uri, dist, comps, comment)
+ new_source = sources_list.add(type, uri, dist, comps, comment)
+ # if source code is enabled add a deb-src line after the new
+ # source
+ if self.get_source_code == True and not type.endswith("-src"):
+ sources_list.add("%s-src" % type, uri, dist, comps, comment,
+ file=new_source.file,
+ pos=sources_list.list.index(new_source)+1)
class SoftwareProperties(SimpleGladeApp):
@@ -225,9 +249,14 @@ class SoftwareProperties(SimpleGladeApp):
cell = gtk.CellRendererText()
self.combobox_server.pack_start(cell, True)
self.combobox_server.add_attribute(cell, 'text', 0)
-
- #self.gnome_program = gnome.init("Software Properties", "0.41")
- #self.gconfclient = gconf.client_get_default()
+
+ # set up the handler id for the callbacks
+ self.handler_server_changed = self.combobox_server.connect("changed",
+ self.on_combobox_server_changed)
+ self.handler_source_code_changed = self.checkbutton_source_code.connect(
+ "toggled",
+ self.on_checkbutton_source_code_toggled
+ )
if parent:
self.window_main.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
@@ -415,28 +444,41 @@ class SoftwareProperties(SimpleGladeApp):
else:
self.checkbutton_cdrom.set_active(False)
- # FIXME: needs inconsistence
+ # Intiate the combobox which allows do specify a server for all
+ # distro related sources
if self.distribution.use_internet == True:
self.checkbutton_internet.set_active(True)
self.combobox_server.set_property("sensitive", True)
else:
self.checkbutton_internet.set_active(False)
self.combobox_server.set_property("sensitive", False)
+ self.combobox_server.handler_block(self.handler_server_changed)
server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
self.combobox_server.set_model(server_store)
- # 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,
+ server_store.append([_("Main server"),
self.distribution.main_server])
- server_store.append([_("%s (nearest)") % self.distribution.nearest_server,
- self.distribution.main_server])
- for server in self.distribution.other_servers:
- server_store.append(["%s" % server, server])
- # FIXME: which one to choose?
- self.combobox_server.set_active(0)
- self.combobox_server.connect("changed", self.on_combobox_server_changed)
+ server_store.append([_("Server for %s") % gettext.dgettext("iso-3166",
+ self.distribution.country).rstrip(),
+ self.distribution.nearest_server])
+ if len(self.distribution.used_servers) > 0:
+ for server in self.distribution.used_servers:
+ if not re.match(server, self.distribution.main_server) and \
+ not re.match(server, self.distribution.nearest_server):
+ server_store.append(["%s" % server, server])
+ if len(self.distribution.used_servers) > 1:
+ server_store.append([_("Custom servers"), None])
+ self.combobox_server.set_active(2)
+ elif self.distribution.used_servers[0] == self.distribution.main_server:
+ self.combobox_server.set_active(0)
+ elif self.distribution.used_servers[0] == self.distribution.nearest_server:
+ self.combobox_server.set_active(1)
+ else:
+ self.combobox_server.set_active(0)
+
+ self.combobox_server.handler_unblock(self.handler_server_changed)
# Check for source code sources
+ self.checkbutton_source_code.handler_block(self.handler_source_code_changed)
self.checkbutton_source_code.set_inconsistent(False)
if len(self.distribution.source_code_sources) < 1:
# we don't have any source code sources, so
@@ -455,7 +497,8 @@ class SoftwareProperties(SimpleGladeApp):
sources.extend(self.distribution.child_sources)
for source in sources:
if templates.has_key(source.template):
- templates[source.template] += set(source.comps)
+ for comp in source.comps:
+ templates[source.template].add(comp)
else:
templates[source.template] = set(source.comps)
# add fake http sources for the cdrom, since the sources
@@ -468,14 +511,29 @@ class SoftwareProperties(SimpleGladeApp):
for source in self.distribution.source_code_sources:
if not templates.has_key(source.template) or \
(templates.has_key(source.template) and \
- len(set(templates[source.template]) ^ set(source.comps)) > 0):
+ len(set(templates[source.template]) ^ set(source.comps)) != 0):
self.checkbutton_source_code.set_inconsistent(True)
self.distribution.get_source_code = False
break
- self.checkbutton_source_code.connect("toggled",
- self.on_checkbutton_source_code_toggled)
+ self.checkbutton_source_code.handler_unblock(self.handler_source_code_changed)
+
def on_combobox_server_changed(self, combobox):
- print "FIXME"
+ """
+ Replace the servers used by the main and update sources with
+ the selected one
+ """
+ server_store = combobox.get_model()
+ iter = combobox.get_active_iter()
+ uri_selected = server_store.get_value(iter, 1)
+ sources = []
+ sources.extend(self.distribution.main_sources)
+ sources.extend(self.distribution.child_sources)
+ sources.extend(self.distribution.source_code_sources)
+ for source in sources:
+ # FIXME: ugly
+ if not "security.ubuntu.com" in source.uri:
+ source.uri = uri_selected
+ self.massive_debug_output()
def on_component_toggled(self, checkbutton, comp):
"""
@@ -489,11 +547,12 @@ class SoftwareProperties(SimpleGladeApp):
# check if there is a main source at all
if len(self.distribution.main_sources) < 1:
# create a new main source
- self.distribution.add_source(self.sourceslist, comps=[comp])
- # add the comp to all main, child and source code sources
- for source in sources:
- if comp not in source.comps:
- source.comps.append(comp)
+ self.distribution.add_source(self.sourceslist, comps=["%s"%comp])
+ else:
+ # add the comp to all main, child and source code sources
+ for source in sources:
+ if comp not in source.comps:
+ source.comps.append(comp)
if self.distribution.get_source_code == True:
for source in self.distribution.source_code_sources:
if comp not in source.comps: source.comps.append(comp)
@@ -549,13 +608,17 @@ class SoftwareProperties(SimpleGladeApp):
source.uri,
source.dist,
source.comps,
- "Added by software-properties")
+ "Added by software-properties",
+ self.sourceslist.list.index(source)+1,
+ source.file)
for source in self.distribution.cdrom_sources:
self.sourceslist.add("deb-src",
self.distribution.source_template.base_uri,
self.distribution.source_template.name,
source.comps,
- "Added by software-properties")
+ "Added by software-properties",
+ self.sourceslist.list.index(source)+1,
+ source.file)
self.massive_debug_output()
def open_file(self, file):
@@ -735,7 +798,8 @@ class SoftwareProperties(SimpleGladeApp):
for source in self.sourceslist.list:
if not source.invalid and\
((source not in self.distribution.main_sources and\
- source not in self.distribution.child_sources) or\
+ source not in self.distribution.child_sources and\
+ source not in self.distribution.disabled_sources) or\
source in self.distribution.cdrom_sources) and\
source not in self.distribution.source_code_sources:
self.sourceslist_visible.append(source)
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index fc08fb12..f96bd959 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -30,6 +30,8 @@ import shutil
import time
import os.path
+import pdb
+
from UpdateManager.Common.DistInfo import DistInfo
@@ -64,12 +66,8 @@ def is_mirror(master_uri, compare_uri):
return False
def uniq(s):
- """ simple (and not efficient) way to return uniq list """
- u = []
- for x in s:
- if x not in u:
- u.append(x)
- return u
+ """ simple and efficient way to return uniq list """
+ return list(set(s))
@@ -232,16 +230,29 @@ class SourcesList:
yield entry
raise StopIteration
- def add(self, type, uri, dist, comps, comment="", pos=-1):
- # if there is a repo with the same (type, uri, dist) just add the
- # components
- for i in self.list:
- if i.type == type and is_mirror(uri,i.uri) and i.dist == dist:
- comps = uniq(i.comps + comps)
- # set to the old position and preserve comment
- comment = i.comment
- pos = self.list.index(i)
- self.list.remove(i)
+ def add(self, type, uri, dist, comps, comment="", pos=-1, file=None):
+ """
+ Add a new source to the sources.list.
+ The method will search for existing matching repos and will try to
+ reuse them as far as possible
+ """
+ for source in self.list:
+ # if there is a repo with the same (type, uri, dist) just add the
+ # components
+ if source.disabled == False and source.invalid == False and \
+ source.type == type and uri == source.uri and \
+ source.dist == dist:
+ comps = uniq(source.comps + comps)
+ source.comps = comps
+ return source
+ # if there is a corresponding repo which is disabled, enable it
+ elif source.disabled == True and source.invalid == False and \
+ source.type == type and uri == source.uri and \
+ source.dist == dist and \
+ len(set(source.comps) & set(comps)) == len(comps):
+ source.disabled = False
+ return source
+ # there isn't any matching source, so create a new line and parse it
line = "%s %s %s" % (type,uri,dist)
for c in comps:
line = line + " " + c;
@@ -249,8 +260,11 @@ class SourcesList:
line = "%s #%s\n" %(line,comment)
line = line + "\n"
new_entry = SourceEntry(line)
+ if file != None:
+ new_entry.file = file
self.matcher.match(new_entry)
self.list.insert(pos, new_entry)
+ return source
def remove(self, source_entry):
self.list.remove(source_entry)
diff --git a/debian/control b/debian/control
index a4999f1a..af942223 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.6.2
Package: update-manager
Architecture: all
-Depends: ${python:Depends}, ${misc:Depends}, python, python-glade2, python-apt (>= 0.6.16.2), synaptic (>= 0.57.8), lsb-release, python-gnupginterface, unattended-upgrades, gksu
+Depends: ${python:Depends}, ${misc:Depends}, python, python-glade2, python-apt (>= 0.6.16.2), synaptic (>= 0.57.8), lsb-release, python-gnupginterface, unattended-upgrades, gksu, iso-codes
Recommends: python-gnome2
Description: GNOME application that manages apt updates
This is the GNOME apt update manager. It checks for updates and lets the user
--
cgit v1.2.3
From 880b57ed3239de18b942945aead95d18844c715e Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 21 Jul 2006 15:40:39 +0200
Subject: * move the cdroms of the current distro to its own treeview * add a
popcon tab to the ui - only a fake currently * improve wording: replace free
by OpenSource as suggested by Corey (still a lot to do)
---
SoftwareProperties/SoftwareProperties.py | 118 +++++-----
channels/Ubuntu.info.in | 18 +-
data/SoftwareProperties.glade | 375 +++++++++++++++++++++++++------
3 files changed, 378 insertions(+), 133 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index f9fb2c43..ec02edb3 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -124,8 +124,6 @@ class Distribution:
self.source_code_sources = []
# location of the sources
- self.cdrom_available = False
- self.use_internet = False
self.main_server = ""
self.nearest_server = ""
self.used_servers = []
@@ -199,11 +197,8 @@ class Distribution:
# other used servers
for medium in self.used_media:
- if medium.startswith("cdrom:"):
- self.cdrom_available = True
- else:
+ if not medium.startswith("cdrom:"):
# seems to be a network source
- self.use_internet = True
self.used_servers.append(medium)
def add_source(self, sources_list, type=None,
@@ -383,15 +378,16 @@ class SoftwareProperties(SimpleGladeApp):
if self.file != None:
self.open_file(file)
+
def distro_to_widgets(self):
"""
Represent the distro information in the user interface
"""
# TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
- self.label_updates.set_label(_("%s Updates") % self.distribution.id)
+ self.label_updates.set_label("%s" % (_("%s Updates") %\
+ self.distribution.id))
# TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
- self.label_dist_software.set_label(_("%s Software") % self.distribution.id)
- self.label_dist_name.set_label("%s" % self.distribution.description)
+ self.label_dist_name.set_label("%s" % self.distribution.description)
# Setup the checkbuttons for the components
for checkbutton in self.vbox_dist_comps.get_children():
@@ -437,21 +433,8 @@ class SoftwareProperties(SimpleGladeApp):
else:
self.vbox_updates.set_sensitive(True)
- # setup the location
- # FIXME: how to handle uncommented cdroms?
- if self.distribution.cdrom_available == True:
- self.checkbutton_cdrom.set_active(True)
- else:
- self.checkbutton_cdrom.set_active(False)
-
# Intiate the combobox which allows do specify a server for all
# distro related sources
- if self.distribution.use_internet == True:
- self.checkbutton_internet.set_active(True)
- self.combobox_server.set_property("sensitive", True)
- else:
- self.checkbutton_internet.set_active(False)
- self.combobox_server.set_property("sensitive", False)
self.combobox_server.handler_block(self.handler_server_changed)
server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
self.combobox_server.set_model(server_store)
@@ -503,11 +486,13 @@ class SoftwareProperties(SimpleGladeApp):
templates[source.template] = set(source.comps)
# add fake http sources for the cdrom, since the sources
# for the cdrom are only available in the internet
+ pdb.set_trace()
for source in self.distribution.cdrom_sources:
+ # FIXME: produces a key error
if templates.has_key(self.distribution.source_template):
templates[self.distribution.source_template] += set(source.comps)
else:
- templates[self.distribution.source_template] += set(source.comps)
+ templates[self.distribution.source_template] = set(source.comps)
for source in self.distribution.source_code_sources:
if not templates.has_key(source.template) or \
(templates.has_key(source.template) and \
@@ -517,6 +502,11 @@ class SoftwareProperties(SimpleGladeApp):
break
self.checkbutton_source_code.handler_unblock(self.handler_source_code_changed)
+ if len(self.cdrom_store) == 0:
+ self.treeview_cdroms.set_sensitive(False)
+ else:
+ self.treeview_cdroms.set_sensitive(True)
+
def on_combobox_server_changed(self, combobox):
"""
Replace the servers used by the main and update sources with
@@ -533,7 +523,7 @@ class SoftwareProperties(SimpleGladeApp):
# FIXME: ugly
if not "security.ubuntu.com" in source.uri:
source.uri = uri_selected
- self.massive_debug_output()
+ self.modified_sourceslist()
def on_component_toggled(self, checkbutton, comp):
"""
@@ -562,7 +552,7 @@ class SoftwareProperties(SimpleGladeApp):
source.comps.remove(comp)
if len(source.comps) < 1:
self.sourceslist.remove(source)
- self.massive_debug_output()
+ self.modified_sourceslist()
def massive_debug_output(self):
"""
@@ -587,7 +577,7 @@ class SoftwareProperties(SimpleGladeApp):
self.distribution.add_source(self.sourceslist,
uri=template.base_uri,
dist=template.name)
- self.massive_debug_output()
+ self.modified_sourceslist()
def on_checkbutton_source_code_toggled(self, checkbutton):
"""
@@ -619,7 +609,7 @@ class SoftwareProperties(SimpleGladeApp):
"Added by software-properties",
self.sourceslist.list.index(source)+1,
source.file)
- self.massive_debug_output()
+ self.modified_sourceslist()
def open_file(self, file):
"""Show an confirmation for adding the channels of the specified file"""
@@ -654,6 +644,12 @@ class SoftwareProperties(SimpleGladeApp):
# STORE_SOURCE - the source entry object
# STORE_SEPARATOR - if the entry is a separator
# STORE_VISIBLE - if the entry is shown or hidden
+ self.cdrom_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
+ gobject.TYPE_STRING,
+ gobject.TYPE_PYOBJECT,
+ gobject.TYPE_BOOLEAN,
+ gobject.TYPE_BOOLEAN)
+ self.treeview_cdroms.set_model(self.cdrom_store)
self.source_store = gtk.ListStore(gobject.TYPE_BOOLEAN,
gobject.TYPE_STRING,
gobject.TYPE_PYOBJECT,
@@ -662,7 +658,6 @@ class SoftwareProperties(SimpleGladeApp):
self.treeview_sources.set_model(self.source_store)
self.treeview_sources.set_row_separator_func(self.is_separator,
STORE_SEPARATOR)
- #self.treeview_sources.set_rules_hint(False)
cell_desc = gtk.CellRendererText()
cell_desc.set_property("xpad", 2)
@@ -674,7 +669,24 @@ class SoftwareProperties(SimpleGladeApp):
cell_toggle = gtk.CellRendererToggle()
cell_toggle.set_property("xpad", 2)
cell_toggle.set_property("ypad", 2)
- cell_toggle.connect('toggled', self.on_channel_toggled)
+ cell_toggle.connect('toggled', self.on_channel_toggled, self.cdrom_store)
+ col_active = gtk.TreeViewColumn(_("Active"), cell_toggle,
+ active=COLUMN_ACTIVE)
+
+ self.treeview_cdroms.append_column(col_active)
+ self.treeview_cdroms.append_column(col_desc)
+
+ cell_desc = gtk.CellRendererText()
+ cell_desc.set_property("xpad", 2)
+ cell_desc.set_property("ypad", 2)
+ col_desc = gtk.TreeViewColumn(_("Software Channel"), cell_desc,
+ markup=COLUMN_DESC)
+ col_desc.set_max_width(1000)
+
+ cell_toggle = gtk.CellRendererToggle()
+ cell_toggle.set_property("xpad", 2)
+ cell_toggle.set_property("ypad", 2)
+ cell_toggle.connect('toggled', self.on_channel_toggled, self.source_store)
col_active = gtk.TreeViewColumn(_("Active"), cell_toggle,
active=COLUMN_ACTIVE)
@@ -698,11 +710,12 @@ class SoftwareProperties(SimpleGladeApp):
self.button_edit.set_sensitive(False)
self.button_remove.set_sensitive(False)
- def on_channel_toggled(self, cell_toggle, path):
+ def on_channel_toggled(self, cell_toggle, path, store):
"""Enable or disable the selected channel"""
- iter = self.source_store.get_iter((int(path),))
- source_entry = self.source_store.get_value(iter, STORE_SOURCE)
+ iter = store.get_iter((int(path),))
+ source_entry = store.get_value(iter, STORE_SOURCE)
source_entry.disabled = not source_entry.disabled
+ store.set_value(iter, STORE_ACTIVE, not source_entry.disabled)
self.modified_sourceslist()
def init_keyslist(self):
@@ -726,10 +739,10 @@ class SoftwareProperties(SimpleGladeApp):
def modified_sourceslist(self):
"""The sources list was changed and now needs to be saved and reloaded"""
- self.button_revert.set_sensitive(True)
- self.sourceslist.check_for_endangered_dists()
- self.save_sourceslist()
- self.reload_sourceslist()
+ self.massive_debug_output()
+ #self.button_revert.set_sensitive(True)
+ #self.save_sourceslist()
+ #self.reload_sourceslist()
self.modified = True
def render_source(self, source):
@@ -790,24 +803,27 @@ class SoftwareProperties(SimpleGladeApp):
def reload_sourceslist(self):
(path_x, path_y) = self.treeview_sources.get_cursor()
self.source_store.clear()
+ self.cdrom_store.clear()
self.sourceslist.refresh()
self.sourceslist_visible=[]
self.distribution.get_sources(self.sourceslist)
# Only show sources that are no binary or source code repos for
# the current distribution, but show cdrom based repos
for source in self.sourceslist.list:
- if not source.invalid and\
- ((source not in self.distribution.main_sources and\
- source not in self.distribution.child_sources and\
- source not in self.distribution.disabled_sources) or\
- source in self.distribution.cdrom_sources) and\
- source not in self.distribution.source_code_sources:
- self.sourceslist_visible.append(source)
+ if not source.invalid and\
+ (source not in self.distribution.main_sources and\
+ source not in self.distribution.child_sources and\
+ source not in self.distribution.disabled_sources) and\
+ source not in self.distribution.source_code_sources:
+ self.sourceslist_visible.append(source)
+ elif not source.invalid and source in self.distribution.cdrom_sources:
+ contents = self.render_source(source)
+ self.cdrom_store.append([not source.disabled, contents,
+ source, False, True])
# Sort the sources list
self.sourceslist_visible.sort(key=self.get_comparable)
- dist_first = False
for source in self.sourceslist_visible:
contents = self.render_source(source)
@@ -1086,13 +1102,13 @@ class SoftwareProperties(SimpleGladeApp):
self.reload_sourceslist()
self.modified = True
- def on_channel_toggled(self, cell_toggle, path):
- """Enable or disable the selected channel"""
- iter = self.source_store.get_iter((int(path),))
- source_entry = self.source_store.get_value(iter, LIST_ENTRY_OBJ)
- source_entry.disabled = not source_entry.disabled
- self.reload_sourceslist()
- self.modified = True
+ # def on_channel_toggled(self, cell_toggle, path, store):
+ # """Enable or disable the selected channel"""
+ # iter = store.get_iter((int(path),))
+ # source_entry = store.get_value(iter, LIST_ENTRY_OBJ)
+ # source_entry.disabled = not source_entry.disabled
+ # self.reload_sourceslist()
+ # self.modified = True
# FIXME: move this into a different file
class GtkCdromProgress(apt.progress.CdromProgress, SimpleGladeApp):
diff --git a/channels/Ubuntu.info.in b/channels/Ubuntu.info.in
index f92d8b8b..e01a9221 100644
--- a/channels/Ubuntu.info.in
+++ b/channels/Ubuntu.info.in
@@ -4,19 +4,19 @@ Suite: dapper
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu/
-_Description: Ubuntu 6.04 'Dapper Drake'
+_Description: Ubuntu 6.06 'Dapper Drake'
Component: main
Enabled: 1
_CompDescription: Officially supported
-_CompDescriptionLong: Free software that is officially supported by Canonical Ltd. (main)
+_CompDescriptionLong: OpenSource software that is officially supported by Canonical Ltd. (main)
Component: universe
Enabled: 0
_CompDescription: Community maintained (universe)
-_CompDescriptionLong: Free software that is maintained by the community (universe)
+_CompDescriptionLong: OpenSource software that is maintained by the community (universe)
Component: restricted
Enabled: 1
_CompDescription: Non-free drivers
-_CompDescriptionLong: Non-free drivers for devices (restricted)
+_CompDescriptionLong: Proprietary drivers for devices (restricted)
Component: multiverse
Enabled: 0
_CompDescription: Restricted software (Multiverse)
@@ -24,8 +24,8 @@ _CompDescriptionLong: Software that is restricted by copyright or legal issues (
Suite: dapper
MatchName: .*
-BaseURI: cdrom:\[Ubuntu.*6.04
-_Description: Cdrom with Ubuntu 6.04 'Dapper Drake'
+BaseURI: cdrom:\[Ubuntu.*6.06
+_Description: Cdrom with Ubuntu 6.06 'Dapper Drake'
Available: False
Component: main
Enabled: 1
@@ -39,21 +39,21 @@ ParentSuite: dapper
RepositoryType: deb
BaseURI: http://security.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu/|security.ubuntu.com
-_Description: Ubuntu 6.04 Security Updates
+_Description: Important security updates
Suite: dapper-updates
ParentSuite: dapper
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu/
-_Description: Ubuntu 6.04 Updates
+_Description: Recommended updates
Suite: dapper-backports
ParentSuite: dapper
RepositoryType: deb
BaseURI: http://archive.ubuntu.com/ubuntu/
MatchURI: archive.ubuntu.com/ubuntu/
-_Description: Ubuntu 6.04 Backports
+_Description: Backported updates
Suite: dapper-backports
RepositoryType: deb
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index 5aa5ee5c..b0ab7144 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -5,8 +5,6 @@
6
- 620
- 400
Software Sources
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_CENTER
@@ -72,17 +70,26 @@
18
-
+
True
False
6
-
-
+
+ True
+ False
+ 6
-
-
+
+
+
+
+
+ 0
+ True
+ True
+
@@ -99,7 +106,7 @@
True
-
+ <b>Downloadable software</b>
False
True
GTK_JUSTIFY_LEFT
@@ -127,14 +134,14 @@
-
+
True
0
0.5
GTK_SHADOW_NONE
-
+
True
0.5
0.5
@@ -146,26 +153,59 @@
0
-
+
True
False
6
-
- True
- CD-ROM/DVD
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
+
+ True
+ False
+ 12
+
+
+
+ True
+ Download from:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ False
+ True
+
+
+ 0
+ True
+ True
+
+
0
False
- False
+ True
@@ -187,43 +227,89 @@
False
+
+
+
+
+
+
+
+ True
+ <b>Download options</b>
+ False
+ True
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ label_item
+
+
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+ 0
+ 0.5
+ GTK_SHADOW_NONE
+
+
+
+ True
+ 0.5
+ 0.5
+ 1
+ 1
+ 6
+ 0
+ 12
+ 0
+
+
+
+ True
+ False
+ 6
-
+
+ 75
True
- False
- 12
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+ GTK_SHADOW_IN
+ GTK_CORNER_TOP_LEFT
-
+
+ 109
True
True
- Download software from the Internet:
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
+ False
+ True
+ False
+ True
+ False
+ False
+ False
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- True
-
-
- 0
- True
- True
-
@@ -238,9 +324,9 @@
-
+
True
- <b>Options</b>
+ <b>CDROM/DVD</b>
False
True
GTK_JUSTIFY_LEFT
@@ -262,7 +348,7 @@
0
- False
+ True
True
@@ -274,7 +360,7 @@
-
+
True
False
@@ -345,7 +431,7 @@
-
+
True
<b>Internet Updates</b>
False
@@ -627,9 +713,9 @@
-
+
True
-
+ Internet Updates
False
False
GTK_JUSTIFY_LEFT
@@ -793,7 +879,7 @@
True
- Additional Software
+ Third Party
False
False
GTK_JUSTIFY_LEFT
@@ -857,15 +943,77 @@
6
-
+
True
- Restore the default keys of your distribution
+ Import the public key from a trusted software provider
True
- Restore _Defaults
- True
GTK_RELIEF_NORMAL
True
-
+
+
+
+
+ True
+ 0.5
+ 0.5
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ True
+ False
+ 2
+
+
+
+ True
+ gtk-add
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ _Import Key File
+ True
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+
0
@@ -875,14 +1023,15 @@
-
+
True
+ Restore the default keys of your distribution
True
- gtk-remove
- True
+ Restore _Defaults
+ True
GTK_RELIEF_NORMAL
True
-
+
0
@@ -893,21 +1042,19 @@
-
+
True
- Import the public key from a trusted software provider
True
- _Import Key File
- True
+ gtk-remove
+ True
GTK_RELIEF_NORMAL
True
-
+
0
False
False
- GTK_PACK_END
@@ -946,6 +1093,88 @@
tab
+
+
+
+ 12
+ True
+ False
+ 6
+
+
+
+ True
+ <i>Please take part in the popularity contest, to improve the user experience of Ubuntu. Therefor the following data will be collected and sent to the Ubuntu project anonymously on a weekly basis: the list of installed software and how often it was used.
+
+The results are used to improve the support for popular applications and to rank applications in the search results.</i>
+ False
+ True
+ GTK_JUSTIFY_LEFT
+ True
+ False
+ 0
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ True
+ Submit statistical information to Ubuntu
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
+
+
+
+ False
+ True
+
+
+
+
+
+ True
+ Statistics
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ tab
+
+
0
--
cgit v1.2.3
From ea2c5c8a8ea54060b7292775d9e8ceb7085235af Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 21 Jul 2006 17:11:10 +0200
Subject: * rearrange download section in the user interface * fix some bugs
because of the cdrom /download sources separation
---
SoftwareProperties/SoftwareProperties.py | 31 +++--
SoftwareProperties/aptsources.py | 2 +-
data/SoftwareProperties.glade | 204 ++++++++++++-------------------
3 files changed, 102 insertions(+), 135 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index ec02edb3..9bc19cdd 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -118,7 +118,9 @@ class Distribution:
self.main_sources = []
self.disabled_sources = []
self.cdrom_sources = []
+ self.download_comps = []
self.enabled_comps = []
+ self.cdrom_comps = []
self.used_media = []
self.get_source_code = False
self.source_code_sources = []
@@ -144,6 +146,8 @@ class Distribution:
# find main and child sources
media = []
comps = []
+ cdrom_comps = []
+ enabled_comps = []
source_code = []
for source in sources_list.list:
if source.invalid == False and\
@@ -154,7 +158,8 @@ class Distribution:
# cdroms need do be handled differently
if source.uri.startswith("cdrom:"):
self.cdrom_sources.append(source)
- if source.type == "deb" and source.disabled == False:
+ cdrom_comps.extend(source.comps)
+ elif source.type == "deb" and source.disabled == False:
self.main_sources.append(source)
comps.extend(source.comps)
media.append(source.uri)
@@ -170,7 +175,11 @@ class Distribution:
self.child_sources.append(source)
elif source.type == "deb-src":
self.source_code_sources.append(source)
- self.enabled_comps = set(comps)
+ self.download_comps = set(comps)
+ self.cdrom_comps = set(cdrom_comps)
+ enabled_comps.extend(comps)
+ enabled_comps.extend(cdrom_comps)
+ self.enabled_comps = set(enabled_comps)
self.used_media = set(media)
self.get_mirrors()
@@ -271,8 +280,6 @@ class SoftwareProperties(SimpleGladeApp):
self.window_main.show()
- # internet update setings
-
# this maps the key (combo-box-index) to the auto-update-interval value
# where (-1) means, no key
self.combobox_interval_mapping = { 0 : 1,
@@ -384,7 +391,7 @@ class SoftwareProperties(SimpleGladeApp):
Represent the distro information in the user interface
"""
# TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
- self.label_updates.set_label("%s" % (_("%s Updates") %\
+ self.label_updates.set_label("%s" % (_("%s updates") %\
self.distribution.id))
# TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
self.label_dist_name.set_label("%s" % self.distribution.description)
@@ -396,7 +403,7 @@ class SoftwareProperties(SimpleGladeApp):
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:
+ if comp in self.distribution.download_comps:
checkbox.set_active(True)
# setup the callback and show the checkbutton
checkbox.connect("toggled", self.on_component_toggled, comp)
@@ -486,7 +493,6 @@ class SoftwareProperties(SimpleGladeApp):
templates[source.template] = set(source.comps)
# add fake http sources for the cdrom, since the sources
# for the cdrom are only available in the internet
- pdb.set_trace()
for source in self.distribution.cdrom_sources:
# FIXME: produces a key error
if templates.has_key(self.distribution.source_template):
@@ -533,6 +539,7 @@ class SoftwareProperties(SimpleGladeApp):
sources = []
sources.extend(self.distribution.main_sources)
sources.extend(self.distribution.child_sources)
+ sources.extend(self.distribution.source_code_sources)
if checkbutton.get_active() == True:
# check if there is a main source at all
if len(self.distribution.main_sources) < 1:
@@ -547,6 +554,10 @@ class SoftwareProperties(SimpleGladeApp):
for source in self.distribution.source_code_sources:
if comp not in source.comps: source.comps.append(comp)
else:
+ if comp in self.distribution.cdrom_comps:
+ sources = []
+ sources.extend(self.distribution.main_sources)
+
for source in sources:
if comp in source.comps:
source.comps.remove(comp)
@@ -562,8 +573,6 @@ class SoftwareProperties(SimpleGladeApp):
for source in self.sourceslist:
print source.str()
print "END SOURCES.LIST\n"
- self.distribution.get_sources(self.sourceslist)
- self.distro_to_widgets()
def on_checkbutton_child_toggled(self, checkbutton, template):
"""
@@ -712,6 +721,7 @@ class SoftwareProperties(SimpleGladeApp):
def on_channel_toggled(self, cell_toggle, path, store):
"""Enable or disable the selected channel"""
+ #FIXME cdroms need to disable the comps in the childs and sources
iter = store.get_iter((int(path),))
source_entry = store.get_value(iter, STORE_SOURCE)
source_entry.disabled = not source_entry.disabled
@@ -744,6 +754,8 @@ class SoftwareProperties(SimpleGladeApp):
#self.save_sourceslist()
#self.reload_sourceslist()
self.modified = True
+ self.distribution.get_sources(self.sourceslist)
+ self.distro_to_widgets()
def render_source(self, source):
"""Render a nice output to show the source in a treeview"""
@@ -812,6 +824,7 @@ class SoftwareProperties(SimpleGladeApp):
for source in self.sourceslist.list:
if not source.invalid and\
(source not in self.distribution.main_sources and\
+ source not in self.distribution.cdrom_sources and\
source not in self.distribution.child_sources and\
source not in self.distribution.disabled_sources) and\
source not in self.distribution.source_code_sources:
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index f96bd959..4e76824d 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -264,7 +264,7 @@ class SourcesList:
new_entry.file = file
self.matcher.match(new_entry)
self.list.insert(pos, new_entry)
- return source
+ return new_entry
def remove(self, source_entry):
self.list.remove(source_entry)
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index b0ab7144..b541ab65 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -76,13 +76,45 @@
6
-
+
True
False
6
-
+
+ True
+ False
+ 6
+
+
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+
+ True
+ True
+ Source code
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ False
+ True
+
+
+ 0
+ False
+ False
+
@@ -91,109 +123,50 @@
True
-
-
- 0
- True
- True
-
-
-
-
-
-
-
-
-
- True
- <b>Downloadable software</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- label_item
-
-
-
-
- 0
- False
- True
-
-
-
-
-
- True
- 0
- 0.5
- GTK_SHADOW_NONE
-
-
-
- True
- 0.5
- 0.5
- 1
- 1
- 6
- 0
- 12
- 0
-
-
-
- True
- False
- 6
-
-
-
- True
- False
- 12
-
+
True
- Download from:
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
+ False
+ 12
-
-
- True
- False
- True
+
+
+ True
+ Download from:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ False
+ True
+
+
+ 0
+ True
+ True
+
+
0
@@ -204,38 +177,19 @@
0
- False
+ True
True
-
-
-
- True
- True
- Source code
- True
- GTK_RELIEF_NORMAL
- True
- False
- False
- True
-
-
- 0
- False
- False
-
-
-
+
True
- <b>Download options</b>
+ <b>Downloadable software</b>
False
True
GTK_JUSTIFY_LEFT
@@ -433,7 +387,7 @@
True
- <b>Internet Updates</b>
+ <b>Internet updates</b>
False
True
GTK_JUSTIFY_LEFT
@@ -679,7 +633,7 @@
True
- <b>Automatic Updates</b>
+ <b>Automatic updates</b>
False
True
GTK_JUSTIFY_LEFT
--
cgit v1.2.3
From b0391ead1648a93222ba3e83f718c5659cfbb8f4 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 21 Jul 2006 17:15:42 +0200
Subject: * replace self.distribution by self.distro
---
SoftwareProperties/SoftwareProperties.py | 124 +++++++++++++++----------------
1 file changed, 62 insertions(+), 62 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 9bc19cdd..38b83d32 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -249,7 +249,7 @@ class SoftwareProperties(SimpleGladeApp):
self.file = file
- self.distribution = Distribution()
+ self.distro = Distribution()
cell = gtk.CellRendererText()
self.combobox_server.pack_start(cell, True)
self.combobox_server.add_attribute(cell, 'text', 0)
@@ -392,18 +392,18 @@ class SoftwareProperties(SimpleGladeApp):
"""
# TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
self.label_updates.set_label("%s" % (_("%s updates") %\
- self.distribution.id))
+ self.distro.id))
# TRANS: %s stands for the distribution name e.g. Debian or Ubuntu
- self.label_dist_name.set_label("%s" % self.distribution.description)
+ self.label_dist_name.set_label("%s" % self.distro.description)
# Setup the checkbuttons for the components
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][2])
+ for comp in self.distro.source_template.components.keys():
+ checkbox = gtk.CheckButton(label=self.distro.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.download_comps:
+ if comp in self.distro.download_comps:
checkbox.set_active(True)
# setup the callback and show the checkbutton
checkbox.connect("toggled", self.on_component_toggled, comp)
@@ -413,17 +413,17 @@ class SoftwareProperties(SimpleGladeApp):
# Setup the checkbuttons for the child repos / updates
for checkbutton in self.vbox_updates.get_children():
self.vbox_updates.remove(checkbutton)
- for template in self.distribution.source_template.children:
+ for template in self.distro.source_template.children:
checkbox = gtk.CheckButton(label=template.description)
- for child in self.distribution.child_sources:
+ for child in self.distro.child_sources:
if child.template == template:
# check if all comps of the main source are also enabled
# for the child source
- if len(set(child.comps) - self.distribution.enabled_comps) == 0:
+ if len(set(child.comps) - self.distro.enabled_comps) == 0:
checkbox.set_active(True)
else:
checkbox.set_active(False)
- if len(self.distribution.enabled_comps ^ set(child.comps)) > 0:
+ if len(self.distro.enabled_comps ^ set(child.comps)) > 0:
checkbox.set_inconsistent(True)
checkbox.set_active(False)
#FIXME: currently we don't handle multiple sources of the same
@@ -435,7 +435,7 @@ class SoftwareProperties(SimpleGladeApp):
self.vbox_updates.add(checkbox)
checkbox.show()
- if len(self.distribution.enabled_comps) < 1:
+ if len(self.distro.enabled_comps) < 1:
self.vbox_updates.set_sensitive(False)
else:
self.vbox_updates.set_sensitive(True)
@@ -446,21 +446,21 @@ class SoftwareProperties(SimpleGladeApp):
server_store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
self.combobox_server.set_model(server_store)
server_store.append([_("Main server"),
- self.distribution.main_server])
+ self.distro.main_server])
server_store.append([_("Server for %s") % gettext.dgettext("iso-3166",
- self.distribution.country).rstrip(),
- self.distribution.nearest_server])
- if len(self.distribution.used_servers) > 0:
- for server in self.distribution.used_servers:
- if not re.match(server, self.distribution.main_server) and \
- not re.match(server, self.distribution.nearest_server):
+ self.distro.country).rstrip(),
+ self.distro.nearest_server])
+ if len(self.distro.used_servers) > 0:
+ for server in self.distro.used_servers:
+ if not re.match(server, self.distro.main_server) and \
+ not re.match(server, self.distro.nearest_server):
server_store.append(["%s" % server, server])
- if len(self.distribution.used_servers) > 1:
+ if len(self.distro.used_servers) > 1:
server_store.append([_("Custom servers"), None])
self.combobox_server.set_active(2)
- elif self.distribution.used_servers[0] == self.distribution.main_server:
+ elif self.distro.used_servers[0] == self.distro.main_server:
self.combobox_server.set_active(0)
- elif self.distribution.used_servers[0] == self.distribution.nearest_server:
+ elif self.distro.used_servers[0] == self.distro.nearest_server:
self.combobox_server.set_active(1)
else:
self.combobox_server.set_active(0)
@@ -470,21 +470,21 @@ class SoftwareProperties(SimpleGladeApp):
# Check for source code sources
self.checkbutton_source_code.handler_block(self.handler_source_code_changed)
self.checkbutton_source_code.set_inconsistent(False)
- if len(self.distribution.source_code_sources) < 1:
+ if len(self.distro.source_code_sources) < 1:
# we don't have any source code sources, so
# uncheck the button
self.checkbutton_source_code.set_active(False)
- self.distribution.get_source_code = False
+ self.distro.get_source_code = False
else:
# there are source code sources, so we check the button
self.checkbutton_source_code.set_active(True)
- self.distribution.get_source_code = True
+ self.distro.get_source_code = True
# check if there is a corresponding source code source for
# every binary source. if not set the checkbutton to inconsistent
templates = {}
sources = []
- sources.extend(self.distribution.main_sources)
- sources.extend(self.distribution.child_sources)
+ sources.extend(self.distro.main_sources)
+ sources.extend(self.distro.child_sources)
for source in sources:
if templates.has_key(source.template):
for comp in source.comps:
@@ -493,18 +493,18 @@ class SoftwareProperties(SimpleGladeApp):
templates[source.template] = set(source.comps)
# add fake http sources for the cdrom, since the sources
# for the cdrom are only available in the internet
- for source in self.distribution.cdrom_sources:
+ for source in self.distro.cdrom_sources:
# FIXME: produces a key error
- if templates.has_key(self.distribution.source_template):
- templates[self.distribution.source_template] += set(source.comps)
+ if templates.has_key(self.distro.source_template):
+ templates[self.distro.source_template] += set(source.comps)
else:
- templates[self.distribution.source_template] = set(source.comps)
- for source in self.distribution.source_code_sources:
+ templates[self.distro.source_template] = set(source.comps)
+ for source in self.distro.source_code_sources:
if not templates.has_key(source.template) or \
(templates.has_key(source.template) and \
len(set(templates[source.template]) ^ set(source.comps)) != 0):
self.checkbutton_source_code.set_inconsistent(True)
- self.distribution.get_source_code = False
+ self.distro.get_source_code = False
break
self.checkbutton_source_code.handler_unblock(self.handler_source_code_changed)
@@ -522,9 +522,9 @@ class SoftwareProperties(SimpleGladeApp):
iter = combobox.get_active_iter()
uri_selected = server_store.get_value(iter, 1)
sources = []
- sources.extend(self.distribution.main_sources)
- sources.extend(self.distribution.child_sources)
- sources.extend(self.distribution.source_code_sources)
+ sources.extend(self.distro.main_sources)
+ sources.extend(self.distro.child_sources)
+ sources.extend(self.distro.source_code_sources)
for source in sources:
# FIXME: ugly
if not "security.ubuntu.com" in source.uri:
@@ -537,26 +537,26 @@ class SoftwareProperties(SimpleGladeApp):
child sources and source code sources
"""
sources = []
- sources.extend(self.distribution.main_sources)
- sources.extend(self.distribution.child_sources)
- sources.extend(self.distribution.source_code_sources)
+ sources.extend(self.distro.main_sources)
+ sources.extend(self.distro.child_sources)
+ sources.extend(self.distro.source_code_sources)
if checkbutton.get_active() == True:
# check if there is a main source at all
- if len(self.distribution.main_sources) < 1:
+ if len(self.distro.main_sources) < 1:
# create a new main source
- self.distribution.add_source(self.sourceslist, comps=["%s"%comp])
+ self.distro.add_source(self.sourceslist, comps=["%s"%comp])
else:
# add the comp to all main, child and source code sources
for source in sources:
if comp not in source.comps:
source.comps.append(comp)
- if self.distribution.get_source_code == True:
- for source in self.distribution.source_code_sources:
+ if self.distro.get_source_code == True:
+ for source in self.distro.source_code_sources:
if comp not in source.comps: source.comps.append(comp)
else:
- if comp in self.distribution.cdrom_comps:
+ if comp in self.distro.cdrom_comps:
sources = []
- sources.extend(self.distribution.main_sources)
+ sources.extend(self.distro.main_sources)
for source in sources:
if comp in source.comps:
@@ -579,11 +579,11 @@ class SoftwareProperties(SimpleGladeApp):
Enable or disable a child repo of the distribution main repository
"""
if checkbutton.get_active() == False:
- for source in self.distribution.child_sources:
+ for source in self.distro.child_sources:
if source.template == template:
self.sourceslist.remove(source)
else:
- self.distribution.add_source(self.sourceslist,
+ self.distro.add_source(self.sourceslist,
uri=template.base_uri,
dist=template.name)
self.modified_sourceslist()
@@ -592,13 +592,13 @@ class SoftwareProperties(SimpleGladeApp):
"""
Disable or enable the source code for all sources
"""
- self.distribution.get_source_code = checkbutton.get_active()
+ self.distro.get_source_code = checkbutton.get_active()
sources = []
- sources.extend(self.distribution.main_sources)
- sources.extend(self.distribution.child_sources)
+ sources.extend(self.distro.main_sources)
+ sources.extend(self.distro.child_sources)
# remove all exisiting sources
- for source in self.distribution.source_code_sources:
+ for source in self.distro.source_code_sources:
self.sourceslist.remove(source)
if checkbutton.get_active() == True:
@@ -610,10 +610,10 @@ class SoftwareProperties(SimpleGladeApp):
"Added by software-properties",
self.sourceslist.list.index(source)+1,
source.file)
- for source in self.distribution.cdrom_sources:
+ for source in self.distro.cdrom_sources:
self.sourceslist.add("deb-src",
- self.distribution.source_template.base_uri,
- self.distribution.source_template.name,
+ self.distro.source_template.base_uri,
+ self.distro.source_template.name,
source.comps,
"Added by software-properties",
self.sourceslist.list.index(source)+1,
@@ -754,7 +754,7 @@ class SoftwareProperties(SimpleGladeApp):
#self.save_sourceslist()
#self.reload_sourceslist()
self.modified = True
- self.distribution.get_sources(self.sourceslist)
+ self.distro.get_sources(self.sourceslist)
self.distro_to_widgets()
def render_source(self, source):
@@ -801,7 +801,7 @@ class SoftwareProperties(SimpleGladeApp):
if source.template:
has_template = 0
desc = source.template.description
- if source.template.distribution == self.distribution:
+ if source.template.distribution == self.distro:
cur_sys = 0
else:
desc = "%s %s %s" % (source.uri, source.dist, source.comps)
@@ -818,18 +818,18 @@ class SoftwareProperties(SimpleGladeApp):
self.cdrom_store.clear()
self.sourceslist.refresh()
self.sourceslist_visible=[]
- self.distribution.get_sources(self.sourceslist)
+ self.distro.get_sources(self.sourceslist)
# Only show sources that are no binary or source code repos for
# the current distribution, but show cdrom based repos
for source in self.sourceslist.list:
if not source.invalid and\
- (source not in self.distribution.main_sources and\
- source not in self.distribution.cdrom_sources and\
- source not in self.distribution.child_sources and\
- source not in self.distribution.disabled_sources) and\
- source not in self.distribution.source_code_sources:
+ (source not in self.distro.main_sources and\
+ source not in self.distro.cdrom_sources and\
+ source not in self.distro.child_sources and\
+ source not in self.distro.disabled_sources) and\
+ source not in self.distro.source_code_sources:
self.sourceslist_visible.append(source)
- elif not source.invalid and source in self.distribution.cdrom_sources:
+ elif not source.invalid and source in self.distro.cdrom_sources:
contents = self.render_source(source)
self.cdrom_store.append([not source.disabled, contents,
source, False, True])
--
cgit v1.2.3
From ddb439217cc1c348df47752a0d7942d3841f22a7 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 21 Jul 2006 18:07:21 +0200
Subject: * do add the comps of a disabled cd to enabled_comps * fix the
inconsistent state of the source code button if cdroms are used
---
SoftwareProperties/SoftwareProperties.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 38b83d32..87a9aaad 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -156,9 +156,13 @@ class Distribution:
source.template.name == self.codename:
#print "yeah! found a distro repo: %s" % source.line
# cdroms need do be handled differently
- if source.uri.startswith("cdrom:"):
+ if source.uri.startswith("cdrom:") and \
+ source.disabled == False:
self.cdrom_sources.append(source)
cdrom_comps.extend(source.comps)
+ elif source.uri.startswith("cdrom:") and \
+ source.disabled == True:
+ self.cdrom_sources.append(source)
elif source.type == "deb" and source.disabled == False:
self.main_sources.append(source)
comps.extend(source.comps)
@@ -493,16 +497,13 @@ class SoftwareProperties(SimpleGladeApp):
templates[source.template] = set(source.comps)
# add fake http sources for the cdrom, since the sources
# for the cdrom are only available in the internet
- for source in self.distro.cdrom_sources:
- # FIXME: produces a key error
- if templates.has_key(self.distro.source_template):
- templates[self.distro.source_template] += set(source.comps)
- else:
- templates[self.distro.source_template] = set(source.comps)
+ if len(self.distro.cdrom_sources) > 0:
+ templates[self.distro.source_template] = self.distro.cdrom_comps
for source in self.distro.source_code_sources:
if not templates.has_key(source.template) or \
- (templates.has_key(source.template) and \
- len(set(templates[source.template]) ^ set(source.comps)) != 0):
+ (templates.has_key(source.template) and not \
+ (len(set(templates[source.template]) ^ set(source.comps)) == 0\
+ or (len(set(source.comps) ^ self.distro.enabled_comps) == 0))):
self.checkbutton_source_code.set_inconsistent(True)
self.distro.get_source_code = False
break
--
cgit v1.2.3
From 14d80b531b3b1d7e2f13003c9d04cf428b6df1b7 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 21 Jul 2006 19:11:31 +0200
Subject: * WRITE ALL CHANGES TO THE SOURCES.LIST!!! * fix the add, remove and
edit buttons on the third party tab * minor fixes and clean ups * wording:
channel -> source
---
SoftwareProperties/SoftwareProperties.py | 52 +++---
SoftwareProperties/dialog_add.py | 185 ++++---------------
data/SoftwareProperties.glade | 1 -
data/SoftwarePropertiesDialogs.glade | 297 +------------------------------
4 files changed, 65 insertions(+), 470 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 87a9aaad..14e570b9 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -751,12 +751,10 @@ class SoftwareProperties(SimpleGladeApp):
def modified_sourceslist(self):
"""The sources list was changed and now needs to be saved and reloaded"""
self.massive_debug_output()
- #self.button_revert.set_sensitive(True)
- #self.save_sourceslist()
- #self.reload_sourceslist()
self.modified = True
- self.distro.get_sources(self.sourceslist)
- self.distro_to_widgets()
+ #self.button_revert.set_sensitive(True)
+ self.save_sourceslist()
+ self.reload_sourceslist()
def render_source(self, source):
"""Render a nice output to show the source in a treeview"""
@@ -843,6 +841,13 @@ class SoftwareProperties(SimpleGladeApp):
self.source_store.append([not source.disabled, contents,
source, False, True])
+
+ if len(self.source_store) < 1:
+ self.button_remove.set_sensitive(False)
+ self.button_edit.set_sensitive(False)
+ else:
+ self.treeview_sources.set_cursor(0)
+ self.distro.get_sources(self.sourceslist)
self.distro_to_widgets()
def is_separator(self, model, iter, column):
@@ -965,20 +970,14 @@ class SoftwareProperties(SimpleGladeApp):
#shutil.copy(location, location + ".save")
self.sourceslist.backup(".save")
self.sourceslist.save()
- # show a dialog that a reload of the channel information is required
- # only if there is no parent defined
- if self.modified == True and \
- self.options.toplevel == None:
- d = dialog_cache_outdated.DialogCacheOutdated(self.window_main,
- self.datadir)
- res = d.run()
def on_add_clicked(self, widget):
dialog = dialog_add.dialog_add(self.window_main, self.sourceslist,
self.datadir)
- if dialog.run() == gtk.RESPONSE_OK:
- self.reload_sourceslist()
- self.modified = True
+ line = dialog.run()
+ if line != None:
+ self.sourceslist.list.append(aptsources.SourceEntry(line))
+ self.modified_sourceslist()
def on_edit_clicked(self, widget):
sel = self.treeview_sources.get_selection()
@@ -1024,14 +1023,14 @@ class SoftwareProperties(SimpleGladeApp):
self.button_edit.set_sensitive(True)
def on_remove_clicked(self, widget):
- sel = self.treeview_sources.get_selection()
- (model, iter) = sel.get_selected()
+ model = self.treeview_sources.get_model()
+ (path, column) = self.treeview_sources.get_cursor()
+ iter = model.get_iter(path)
if iter:
source = model.get_value(iter, LIST_ENTRY_OBJ)
self.sourceslist.remove(source)
- self.reload_sourceslist()
- self.modified = True
-
+ self.modified_sourceslist()
+
def add_key_clicked(self, widget):
chooser = gtk.FileChooserDialog(title=_("Import key"),
parent=self.window_main,
@@ -1066,11 +1065,16 @@ class SoftwareProperties(SimpleGladeApp):
self.reload_keyslist()
def on_delete_event(self, widget, args):
- self.save_sourceslist()
- self.quit()
-
+ self.on_close_button(self, widget)
+
def on_close_button(self, widget):
- self.save_sourceslist()
+ # show a dialog that a reload of the channel information is required
+ # only if there is no parent defined
+ if self.modified == True and \
+ self.options.toplevel == None:
+ d = dialog_cache_outdated.DialogCacheOutdated(self.window_main,
+ self.datadir)
+ res = d.run()
self.quit()
def on_help_button(self, widget):
diff --git a/SoftwareProperties/dialog_add.py b/SoftwareProperties/dialog_add.py
index b5fbe07f..81dd1cb2 100644
--- a/SoftwareProperties/dialog_add.py
+++ b/SoftwareProperties/dialog_add.py
@@ -6,7 +6,8 @@
# Authors:
# Michael Vogt
# Michiel Sikkes
-#
+# Sebastian Heinlein
+#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
@@ -29,167 +30,43 @@ import gtk.glade
from gettext import gettext as _
import aptsources
-import dialog_edit
class dialog_add:
- def __init__(self, parent, sourceslist, datadir, source_entry = None):
+ def __init__(self, parent, sourceslist, datadir):
+ """
+ Initialize the dialog that allows to add a new source entering the
+ raw apt line
+ """
self.sourceslist = sourceslist
self.parent = parent
self.datadir = datadir
- self.custom = False
- # we have a source_entry that we want to modify
- self.source_entry = source_entry
- if source_entry:
- self.source_entry_index = sourceslist.list.index(source_entry)
- else:
- self.source_entry_index = None
-
- # templates
- self.templatelist = aptsources.SourceEntryTemplates(datadir)
-
- # FIXME: simple-glade-app should be able to do all this!
-
# gtk stuff
- self.gladexml = gtk.glade.XML("%s/glade/SoftwarePropertiesDialogs.glade" % datadir)
-
- self.main = widget = self.gladexml.get_widget("dialog_add")
- self.main.set_transient_for(self.parent)
-
- combo = self.gladexml.get_widget("combobox_what")
- self.gladexml.signal_connect("on_combobox_what_changed", self.on_combobox_what_changed, None)
- # combox box needs
- cell = gtk.CellRendererText()
- combo.pack_start(cell, True)
- combo.add_attribute(cell, 'text', 0)
- self.fill_combo(combo)
- if source_entry:
- self.main.set_title(_("Edit Channel"))
- self.gladexml.get_widget("button_add").set_label("gtk-ok")
- self.gladexml.signal_connect("on_button_custom_clicked",
- self.on_button_custom_clicked, None)
-
+ self.gladexml = gtk.glade.XML("%s/glade/SoftwarePropertiesDialogs.glade" %\
+ datadir)
+ self.dialog = self.gladexml.get_widget("dialog_add_custom")
+ self.dialog.set_transient_for(self.parent)
+ self.entry = self.gladexml.get_widget("entry_source_line")
+ self.button_add = self.gladexml.get_widget("button_add_source")
+ self.entry.connect("changed", self.check_line)
- def fill_combo(self,combo):
- liststore = gtk.ListStore(gobject.TYPE_STRING,gobject.TYPE_PYOBJECT)
- matched_template = None
- for item in self.templatelist.templates:
- liststore.append((item.description, item))
- if self.source_entry and item.matches(self.source_entry):
- matched_template = item
- combo.set_model(liststore)
- if matched_template:
- try:
- combo.set_active(self.templatelist.templates.index(matched_template))
- vbox = self.gladexml.get_widget("vbox_comps")
- for c in vbox.get_children():
- c.set_active(c.get_data("name") in self.source_entry.comps)
- except ValueError:
- pass
+ def run(self):
+ res = self.dialog.run()
+ self.dialog.hide()
+ if res == gtk.RESPONSE_OK:
+ line = self.entry.get_text() + "\n"
else:
- combo.set_active(0)
-
- def on_combobox_what_changed(self, combobox, user):
- #print "on_combobox_what_changed"
- vbox = self.gladexml.get_widget("vbox_comps")
- vbox.foreach(lambda widget,vbox: vbox.remove(widget), vbox)
- liststore = combobox.get_model()
- a_iter = liststore.iter_nth_child(None, combobox.get_active())
- (name, template) = liststore.get(a_iter, 0,1)
- self.selected = template
- comps = template.comps
- for c in comps:
- checkbox = gtk.CheckButton(c.description)
- checkbox.set_active(c.on_by_default)
- checkbox.set_data("name",c.name)
- vbox.pack_start(checkbox)
- checkbox.show()
+ line = None
+ return line
- def on_button_custom_clicked(self, widget, data):
- #print "on_button_custom_clicked()"
- # this hide here is ugly :/
- self.main.hide()
- # check if we are in add or edit-matched mode
- if self.source_entry:
- # we are in "edit" mode
- # get the SourceEntry as it is now (with local changes)
- # and display the "old" edit dialog
- self.selected_comps = []
- vbox = self.gladexml.get_widget("vbox_comps")
- vbox.foreach(self.get_enabled_comps)
- source_entry = self._make_source_entry()
- # since we're passing the SourceEntry as it is now,
- # this SourceEntry needs to be in the sourceslist,
- # so temporarily swap the original for the current
- if source_entry:
- self.sourceslist.list[self.source_entry_index] = source_entry
- dialog = dialog_edit.dialog_edit(self.parent, self.sourceslist,
- source_entry, self.datadir)
- res = dialog.run()
- if res == gtk.RESPONSE_CANCEL:
- # restore original SourceEntry
- self.sourceslist.list[self.source_entry_index] = self.source_entry
- elif res == gtk.RESPONSE_OK:
- # the sourceslist is allready updated, but we'll overwrite it
- # in self.run if we're not carefull
- self.custom = True
+ def check_line(self, *args):
+ """
+ Check for a valid apt line and set the sensitiveness of the
+ button 'add' accordingly
+ """
+ line = self.entry.get_text() + "\n"
+ source_entry = aptsources.SourceEntry(line)
+ if source_entry.invalid == True or source_entry.disabled == True:
+ self.button_add.set_sensitive(False)
else:
- # we are in "add" mode
- dialog = self.gladexml.get_widget("dialog_add_custom")
- dialog.set_transient_for(self.parent)
- res = dialog.run()
- dialog.hide()
- entry = self.gladexml.get_widget("entry_source_line")
- line = entry.get_text() + "\n"
- self.sourceslist.list.append(aptsources.SourceEntry(line))
- self.main.response(res)
+ self.button_add.set_sensitive(True)
- def get_enabled_comps(self, checkbutton):
- if checkbutton.get_active():
- self.selected_comps.append(checkbutton.get_data("name"))
-
- def _make_source_entry(self):
- " helper for the 'edit' mode "
- # we use "selected" for pretty much everything *but* we use
- # self.source_entry.uri to make sure that the mirror information is
- # preserved
-
- line = "%s %s %s" % (self.selected.type, self.source_entry.uri, self.selected.dist)
- if self.source_entry.disabled:
- line = "#" + line
- if len(self.selected.comps) > 0 and len(self.selected_comps) == 0:
- line = "#" + line
- elif len(self.selected_comps) > 0:
- line += " " + " ".join(self.selected_comps)
- if self.selected.matches(self.source_entry) and self.source_entry.comment != "":
- line += " #"+self.source_entry.comment
- line += "\n"
- return aptsources.SourceEntry(line,self.source_entry.file)
-
- def run(self):
- res = self.main.run()
- if res == gtk.RESPONSE_OK:
- # add repository
- self.selected_comps = []
- vbox = self.gladexml.get_widget("vbox_comps")
- vbox.foreach(self.get_enabled_comps)
-
- # check if we are in 'add' or 'edit' mode
- if self.source_entry:
- # 'edit' - ode
- # check if there are no selected components
- if len(self.selected_comps) < 1:
- # remove the source
- self.sourceslist.remove(self.source_entry)
- else:
- if not self.custom:
- entry = self._make_source_entry()
- if entry:
- self.sourceslist.list[self.source_entry_index] = entry
- else:
- # 'add' mode
- self.sourceslist.add(self.selected.type,
- self.selected.uri,
- self.selected.dist,
- self.selected_comps)
- self.main.hide()
- return res
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index b541ab65..9c63fd52 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -803,7 +803,6 @@
- True
True
gtk-revert-to-saved
True
diff --git a/data/SoftwarePropertiesDialogs.glade b/data/SoftwarePropertiesDialogs.glade
index 8c5b00c6..b381965b 100644
--- a/data/SoftwarePropertiesDialogs.glade
+++ b/data/SoftwarePropertiesDialogs.glade
@@ -3,292 +3,6 @@
-
- 6
- Add Channel
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- True
- False
- False
- True
- True
- False
- GDK_WINDOW_TYPE_HINT_DIALOG
- GDK_GRAVITY_NORTH_WEST
- True
- False
- False
-
-
-
- True
- False
- 12
-
-
-
- True
- GTK_BUTTONBOX_END
-
-
-
- True
- True
- True
- _Custom
- True
- GTK_RELIEF_NORMAL
- True
- -6
-
-
-
-
-
-
- True
- True
- True
- gtk-cancel
- True
- GTK_RELIEF_NORMAL
- True
- -6
-
-
-
-
-
- True
- True
- True
- True
- True
- gtk-add
- True
- GTK_RELIEF_NORMAL
- True
- -5
-
-
-
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
-
-
- 6
- True
- False
- 12
-
-
-
- True
- False
- 6
-
-
-
- True
- <b>Channel</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- 0
-
-
-
- True
-
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- True
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
-
- True
- False
- 6
-
-
-
- True
- <b>Components</b>
- False
- True
- GTK_JUSTIFY_LEFT
- False
- False
- 0
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- 0
-
-
-
- True
-
- False
- False
- GTK_JUSTIFY_LEFT
- False
- False
- 0.5
- 0.5
- 0
- 0
- PANGO_ELLIPSIZE_NONE
- -1
- False
- 0
-
-
- 0
- False
- False
-
-
-
-
-
- True
- False
- 6
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
- 0
- True
- True
-
-
-
-
-
-
6
@@ -331,8 +45,9 @@
-
+
True
+ False
True
True
True
@@ -379,7 +94,7 @@
True
- _Add Channel
+ _Add Source
True
False
GTK_JUSTIFY_LEFT
@@ -449,9 +164,9 @@
True
True
- <big><b>Enter the complete APT line of the channel that you want to add</b></big>
+ <big><b>Enter the complete APT line of the source that you want to add</b></big>
-The APT line includes the type, location and components of a channel, for example <i>"deb http://ftp.debian.org sarge main"</i>.
+The APT line includes the type, location and components of a source, for example <i>"deb http://ftp.debian.org sarge main"</i>.
False
True
GTK_JUSTIFY_LEFT
@@ -549,7 +264,7 @@ The APT line includes the type, location and components of a channel, for exampl
6
- Edit Channel
+ Edit Source
GTK_WINDOW_TOPLEVEL
GTK_WIN_POS_NONE
True
--
cgit v1.2.3
From faa8e24031b9dfb788aa51e50770b7f572f18e9d Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 21 Jul 2006 22:53:55 +0200
Subject: * Moved the Distribution class to aptsources * Added a command line
option: --enable-component * Added a handler for the toggled popcon
checkbutton
---
SoftwareProperties/SoftwareProperties.py | 193 +--------------------------
SoftwareProperties/aptsources.py | 219 +++++++++++++++++++++++++++++--
data/SoftwareProperties.glade | 5 +-
software-properties | 25 +++-
4 files changed, 233 insertions(+), 209 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 14e570b9..d920b693 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -73,170 +73,6 @@ CONF_MAP = {
STORE_VISIBLE
) = range(5)
-class Distribution:
- def __init__(self):
- """"
- Container for distribution specific informations
- """
- # LSB information
- self.id = ""
- self.codename = ""
- self.description = ""
- self.release = ""
-
- # get the LSB information
- lsb_info = []
- for lsb_option in ["-i", "-c", "-d", "-r"]:
- pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
- lsb_info.append(pipe.read().strip())
- del pipe
- (self.id, self.codename, self.description, self.release) = lsb_info
-
- # get a list of country codes and real names
- self.countries = {}
- try:
- f = open("/usr/share/iso-codes/iso_3166.tab", "r")
- lines = f.readlines()
- for line in lines:
- parts = line.split("\t")
- self.countries[parts[0].lower()] = parts[1]
- except:
- print "could not open file '%s'" % file
- else:
- f.close()
-
-
-
- def get_sources(self, sources_list):
- """
- Find the corresponding template, main and child sources
- for the distribution
- """
- # corresponding sources
- self.source_template = None
- self.child_sources = []
- self.main_sources = []
- self.disabled_sources = []
- self.cdrom_sources = []
- self.download_comps = []
- self.enabled_comps = []
- self.cdrom_comps = []
- self.used_media = []
- self.get_source_code = False
- self.source_code_sources = []
-
- # location of the sources
- self.main_server = ""
- self.nearest_server = ""
- self.used_servers = []
-
- # find the distro template
- for template in sources_list.matcher.templates:
- if template.name == self.codename and\
- template.distribution == self.id:
- #print "yeah! found a template for %s" % self.description
- #print template.description, template.base_uri, template.components
- self.source_template = template
- 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
- media = []
- comps = []
- cdrom_comps = []
- enabled_comps = []
- source_code = []
- for source in sources_list.list:
- if source.invalid == False and\
- source.dist == self.codename and\
- source.template and\
- source.template.name == self.codename:
- #print "yeah! found a distro repo: %s" % source.line
- # cdroms need do be handled differently
- if source.uri.startswith("cdrom:") and \
- source.disabled == False:
- self.cdrom_sources.append(source)
- cdrom_comps.extend(source.comps)
- elif source.uri.startswith("cdrom:") and \
- source.disabled == True:
- self.cdrom_sources.append(source)
- elif source.type == "deb" and source.disabled == False:
- self.main_sources.append(source)
- comps.extend(source.comps)
- media.append(source.uri)
- elif source.type == "deb" and source.disabled == True:
- self.disabled_sources.append(source)
- elif source.type.endswith("-src") and source.disabled == False:
- self.source_code_sources.append(source)
- elif source.type.endswith("-src") and source.disabled == True:
- self.disabled_sources.append(source)
- if source.template in self.source_template.children:
- #print "yeah! child found: %s" % source.template.name
- if source.type == "deb":
- self.child_sources.append(source)
- elif source.type == "deb-src":
- self.source_code_sources.append(source)
- self.download_comps = set(comps)
- self.cdrom_comps = set(cdrom_comps)
- enabled_comps.extend(comps)
- enabled_comps.extend(cdrom_comps)
- self.enabled_comps = set(enabled_comps)
- self.used_media = set(media)
-
- self.get_mirrors()
-
- def get_mirrors(self):
- """
- Provide a set of mirrors where you can get the distribution from
- """
- # the main server is stored in the template
- self.main_server = self.source_template.base_uri
-
- # try to guess the nearest mirror from the locale
- # FIXME: for debian we need something different
- if self.id == "Ubuntu":
- locale = os.getenv("LANG", default="en.UK")
- a = locale.find("_")
- z = locale.find(".")
- if z == -1:
- z = len(locale)
- country_code = locale[a+1:z].lower()
- self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
- country_code
- self.country = self.countries[country_code]
-
- # other used servers
- for medium in self.used_media:
- if not medium.startswith("cdrom:"):
- # seems to be a network source
- self.used_servers.append(medium)
-
- def add_source(self, sources_list, type=None,
- uri=None, dist=None, comps=None, comment=""):
- """
- Add distribution specific sources
- """
- if uri == None:
- # FIXME: Add support for the server selector
- uri = self.main_server
- if dist == None:
- dist = self.codename
- if comps == None:
- comps = list(self.enabled_comps)
- if type == None:
- type = "deb"
- if comment == "":
- comment == "Added by software-properties"
- new_source = sources_list.add(type, uri, dist, comps, comment)
- # if source code is enabled add a deb-src line after the new
- # source
- if self.get_source_code == True and not type.endswith("-src"):
- sources_list.add("%s-src" % type, uri, dist, comps, comment,
- file=new_source.file,
- pos=sources_list.list.index(new_source)+1)
class SoftwareProperties(SimpleGladeApp):
@@ -253,7 +89,7 @@ class SoftwareProperties(SimpleGladeApp):
self.file = file
- self.distro = Distribution()
+ self.distro = aptsources.Distribution()
cell = gtk.CellRendererText()
self.combobox_server.pack_start(cell, True)
self.combobox_server.add_attribute(cell, 'text', 0)
@@ -537,33 +373,10 @@ class SoftwareProperties(SimpleGladeApp):
Sync the components of all main sources (excluding cdroms),
child sources and source code sources
"""
- sources = []
- sources.extend(self.distro.main_sources)
- sources.extend(self.distro.child_sources)
- sources.extend(self.distro.source_code_sources)
if checkbutton.get_active() == True:
- # check if there is a main source at all
- if len(self.distro.main_sources) < 1:
- # create a new main source
- self.distro.add_source(self.sourceslist, comps=["%s"%comp])
- else:
- # add the comp to all main, child and source code sources
- for source in sources:
- if comp not in source.comps:
- source.comps.append(comp)
- if self.distro.get_source_code == True:
- for source in self.distro.source_code_sources:
- if comp not in source.comps: source.comps.append(comp)
+ self.distro.enable_component(self.sourceslist, comp)
else:
- if comp in self.distro.cdrom_comps:
- sources = []
- sources.extend(self.distro.main_sources)
-
- for source in sources:
- if comp in source.comps:
- source.comps.remove(comp)
- if len(source.comps) < 1:
- self.sourceslist.remove(source)
+ self.distro.disable_component(self.sourceslist, comp)
self.modified_sourceslist()
def massive_debug_output(self):
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 4e76824d..7418a7cb 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -339,17 +339,6 @@ class SourcesList:
#print self.parents
return (parents, used_child_templates)
- def check_for_endangered_dists(self):
- """set the components of a child source to the ones of the parent channel"""
- (parents, used_child_templates) = self.check_for_relations(self.list)
- # the magical part
- for mother in parents:
- for child_template in mother.template.children:
- if used_child_templates.has_key(child_template):
- for child in used_child_templates[child_template]:
- if child.type == mother.type:
- child.comps = mother.comps
-
# templates for the add dialog
class SourceEntryTemplate(SourceEntry):
def __init__(self,a_type,uri,dist,description,comps):
@@ -495,6 +484,214 @@ class SourceEntryMatcher:
break
return found
+class Distribution:
+ def __init__(self):
+ """"
+ Container for distribution specific informations
+ """
+ # LSB information
+ self.id = ""
+ self.codename = ""
+ self.description = ""
+ self.release = ""
+
+ # get the LSB information
+ lsb_info = []
+ for lsb_option in ["-i", "-c", "-d", "-r"]:
+ pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
+ lsb_info.append(pipe.read().strip())
+ del pipe
+ (self.id, self.codename, self.description, self.release) = lsb_info
+
+ # get a list of country codes and real names
+ self.countries = {}
+ try:
+ f = open("/usr/share/iso-codes/iso_3166.tab", "r")
+ lines = f.readlines()
+ for line in lines:
+ parts = line.split("\t")
+ self.countries[parts[0].lower()] = parts[1]
+ except:
+ print "could not open file '%s'" % file
+ else:
+ f.close()
+
+ def get_sources(self, sources_list):
+ """
+ Find the corresponding template, main and child sources
+ for the distribution
+ """
+ # corresponding sources
+ self.source_template = None
+ self.child_sources = []
+ self.main_sources = []
+ self.disabled_sources = []
+ self.cdrom_sources = []
+ self.download_comps = []
+ self.enabled_comps = []
+ self.cdrom_comps = []
+ self.used_media = []
+ self.get_source_code = False
+ self.source_code_sources = []
+
+ # location of the sources
+ self.main_server = ""
+ self.nearest_server = ""
+ self.used_servers = []
+
+ # find the distro template
+ for template in sources_list.matcher.templates:
+ if template.name == self.codename and\
+ template.distribution == self.id:
+ #print "yeah! found a template for %s" % self.description
+ #print template.description, template.base_uri, template.components
+ self.source_template = template
+ 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
+ media = []
+ comps = []
+ cdrom_comps = []
+ enabled_comps = []
+ source_code = []
+ for source in sources_list.list:
+ if source.invalid == False and\
+ source.dist == self.codename and\
+ source.template and\
+ source.template.name == self.codename:
+ #print "yeah! found a distro repo: %s" % source.line
+ # cdroms need do be handled differently
+ if source.uri.startswith("cdrom:") and \
+ source.disabled == False:
+ self.cdrom_sources.append(source)
+ cdrom_comps.extend(source.comps)
+ elif source.uri.startswith("cdrom:") and \
+ source.disabled == True:
+ self.cdrom_sources.append(source)
+ elif source.type == "deb" and source.disabled == False:
+ self.main_sources.append(source)
+ comps.extend(source.comps)
+ media.append(source.uri)
+ elif source.type == "deb" and source.disabled == True:
+ self.disabled_sources.append(source)
+ elif source.type.endswith("-src") and source.disabled == False:
+ self.source_code_sources.append(source)
+ elif source.type.endswith("-src") and source.disabled == True:
+ self.disabled_sources.append(source)
+ if source.template in self.source_template.children:
+ #print "yeah! child found: %s" % source.template.name
+ if source.type == "deb":
+ self.child_sources.append(source)
+ elif source.type == "deb-src":
+ self.source_code_sources.append(source)
+ self.download_comps = set(comps)
+ self.cdrom_comps = set(cdrom_comps)
+ enabled_comps.extend(comps)
+ enabled_comps.extend(cdrom_comps)
+ self.enabled_comps = set(enabled_comps)
+ self.used_media = set(media)
+
+ self.get_mirrors()
+
+ def get_mirrors(self):
+ """
+ Provide a set of mirrors where you can get the distribution from
+ """
+ # the main server is stored in the template
+ self.main_server = self.source_template.base_uri
+
+ # try to guess the nearest mirror from the locale
+ # FIXME: for debian we need something different
+ if self.id == "Ubuntu":
+ locale = os.getenv("LANG", default="en.UK")
+ a = locale.find("_")
+ z = locale.find(".")
+ if z == -1:
+ z = len(locale)
+ country_code = locale[a+1:z].lower()
+ self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
+ country_code
+ self.country = self.countries[country_code]
+
+ # other used servers
+ for medium in self.used_media:
+ if not medium.startswith("cdrom:"):
+ # seems to be a network source
+ self.used_servers.append(medium)
+
+ def add_source(self, sources_list, type=None,
+ uri=None, dist=None, comps=None, comment=""):
+ """
+ Add distribution specific sources
+ """
+ if uri == None:
+ # FIXME: Add support for the server selector
+ uri = self.main_server
+ if dist == None:
+ dist = self.codename
+ if comps == None:
+ comps = list(self.enabled_comps)
+ if type == None:
+ type = "deb"
+ if comment == "":
+ comment == "Added by software-properties"
+ new_source = sources_list.add(type, uri, dist, comps, comment)
+ # if source code is enabled add a deb-src line after the new
+ # source
+ if self.get_source_code == True and not type.endswith("-src"):
+ sources_list.add("%s-src" % type, uri, dist, comps, comment,
+ file=new_source.file,
+ pos=sources_list.list.index(new_source)+1)
+
+ def enable_component(self, sourceslist, comp):
+ """
+ Disable a component in all main, child and source code sources
+ (excluding cdrom based sources)
+
+ sourceslist: an aptsource.sources_list
+ comp: the component that should be enabled
+ """
+ sources = []
+ sources.extend(self.main_sources)
+ sources.extend(self.child_sources)
+ sources.extend(self.source_code_sources)
+ # check if there is a main source at all
+ if len(self.main_sources) < 1:
+ # create a new main source
+ self.add_source(sourceslist, comps=["%s"%comp])
+ else:
+ # add the comp to all main, child and source code sources
+ for source in sources:
+ if comp not in source.comps:
+ source.comps.append(comp)
+ if self.get_source_code == True:
+ for source in self.source_code_sources:
+ if comp not in source.comps: source.comps.append(comp)
+
+ def disable_component(self, sourceslist, comp):
+ """
+ Disable a component in all main, child and source code sources
+ (excluding cdrom based sources)
+ """
+ sources = []
+ sources.extend(self.main_sources)
+ sources.extend(self.child_sources)
+ sources.extend(self.source_code_sources)
+ if comp in self.cdrom_comps:
+ sources = []
+ sources.extend(self.main_sources)
+
+ for source in sources:
+ if comp in source.comps:
+ source.comps.remove(comp)
+ if len(source.comps) < 1:
+ sourceslist.remove(source)
+
+
# some simple tests
if __name__ == "__main__":
apt_pkg.InitConfig()
diff --git a/data/SoftwareProperties.glade b/data/SoftwareProperties.glade
index 9c63fd52..08ffd743 100644
--- a/data/SoftwareProperties.glade
+++ b/data/SoftwareProperties.glade
@@ -1052,7 +1052,7 @@
12
True
False
- 6
+ 12
@@ -1085,13 +1085,14 @@ The results are used to improve the support for popular applications and to rank
True
True
- Submit statistical information to Ubuntu
+ Submit statistical information
True
GTK_RELIEF_NORMAL
True
False
False
True
+
0
diff --git a/software-properties b/software-properties
index f21a5b52..6c38d073 100644
--- a/software-properties
+++ b/software-properties
@@ -34,6 +34,8 @@ import sys
from optparse import OptionParser
+import SoftwareProperties.aptsources as aptsources
+
#sys.path.append("@prefix@/share/update-manager/python")
from SoftwareProperties import SoftwareProperties
@@ -51,14 +53,18 @@ if __name__ == "__main__":
action="store", type="string", dest="toplevel",
help="Set x-window-id of the toplevel parent for the "\
"dialog (usefull for embedding)")
+ parser.add_option("-e", "--enable-component",
+ action="store", type="string", dest="enable_component",
+ help="Enable the specified component of the distro's "\
+ "repositories")
(options, args) = parser.parse_args()
# Check for root permissions
if os.geteuid() != 0:
- dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
+ dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE,
_("You need to be root to run this program") )
- dialog.set_default_response(gtk.RESPONSE_OK)
+ dialog.set_default_response(gtk.RESPONSE_CLOSE)
dialog.run()
dialog.destroy()
sys.exit(1)
@@ -74,7 +80,14 @@ if __name__ == "__main__":
#data_dir="/tmp/xxx/share/update-manager/"
file = None
if len(args) > 0:
- file = args[0]
- app = SoftwareProperties.SoftwareProperties(data_dir, options, file)
- app.run()
- sys.exit(app.modified)
+ file = args[0]
+ if options.enable_component:
+ sourceslist = aptsources.SourcesList()
+ distro = aptsources.Distribution()
+ distro.get_sources(sourceslist)
+ distro.enable_component(sourceslist, options.enable_component)
+ sourceslist.save()
+ else:
+ app = SoftwareProperties.SoftwareProperties(data_dir, options, file)
+ app.run()
+ sys.exit(app.modified)
--
cgit v1.2.3
From 461a996561636856d91627a67c7e432bf03543e5 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Sat, 22 Jul 2006 12:26:41 +0200
Subject: * introduce a default_server that can be reused by adding sources
---
SoftwareProperties/SoftwareProperties.py | 1 +
SoftwareProperties/aptsources.py | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index d920b693..f9af3a58 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -366,6 +366,7 @@ class SoftwareProperties(SimpleGladeApp):
# FIXME: ugly
if not "security.ubuntu.com" in source.uri:
source.uri = uri_selected
+ self.distro.ddefault_server = uri_selected
self.modified_sourceslist()
def on_component_toggled(self, checkbutton, comp):
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 7418a7cb..c111e4ff 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -535,6 +535,7 @@ class Distribution:
self.source_code_sources = []
# location of the sources
+ self.default_server = ""
self.main_server = ""
self.nearest_server = ""
self.used_servers = []
@@ -623,6 +624,11 @@ class Distribution:
# seems to be a network source
self.used_servers.append(medium)
+ if len(self.main_sources) == 0:
+ self.default_server = self.main_server
+ else:
+ self.default_server = self.main_sources[0].uri
+
def add_source(self, sources_list, type=None,
uri=None, dist=None, comps=None, comment=""):
"""
@@ -630,7 +636,7 @@ class Distribution:
"""
if uri == None:
# FIXME: Add support for the server selector
- uri = self.main_server
+ uri = self.default_server
if dist == None:
dist = self.codename
if comps == None:
--
cgit v1.2.3
From baf6630e1531c73128aba1625c8758b0836b9028 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Sat, 22 Jul 2006 16:39:12 +0200
Subject: * also handle multiple repositories of a child source
---
SoftwareProperties/SoftwareProperties.py | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index f9af3a58..60a0208a 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -255,20 +255,25 @@ class SoftwareProperties(SimpleGladeApp):
self.vbox_updates.remove(checkbutton)
for template in self.distro.source_template.children:
checkbox = gtk.CheckButton(label=template.description)
+ comps = []
for child in self.distro.child_sources:
if child.template == template:
- # check if all comps of the main source are also enabled
- # for the child source
- if len(set(child.comps) - self.distro.enabled_comps) == 0:
- checkbox.set_active(True)
- else:
- checkbox.set_active(False)
- if len(self.distro.enabled_comps ^ set(child.comps)) > 0:
- checkbox.set_inconsistent(True)
- checkbox.set_active(False)
- #FIXME: currently we don't handle multiple sources of the same
- # child source - the required effort would be questionable
- break
+ comps.extend(child.comps)
+ # check if all comps of the main source are also enabled
+ # for the corresponding child sources
+ if len(comps) > 0 and \
+ len(self.distro.enabled_comps ^ set(comps)) == 0:
+ # the cild source covers all components
+ checkbox.set_active(True)
+ elif len(comps) > 0 and\
+ len(self.distro.enabled_comps ^ set(comps)) != 0:
+ # the cild is enabled, but doesn't cover
+ # all components
+ checkbox.set_active(False)
+ checkbox.set_inconsistent(True)
+ else:
+ # there is no corresponding child source at all
+ checkbox.set_active(False)
# setup the callback and show the checkbutton
checkbox.connect("toggled", self.on_checkbutton_child_toggled,
template)
--
cgit v1.2.3
From d5e1d9349540d5d1c6f63b2f482b5b9ea6a68836 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Sat, 22 Jul 2006 16:57:22 +0200
Subject: * Backported the add dialog for drag and drop and mime handling *
Removed references to the obsolete edit_predefined dialog
---
SoftwareProperties/SoftwareProperties.py | 32 ++---
SoftwareProperties/dialog_add_sources_list.py | 133 ++++++++++++++++++
data/glade/SoftwarePropertiesDialogs.glade | 188 ++++++++++++++++++++++++++
3 files changed, 333 insertions(+), 20 deletions(-)
create mode 100644 SoftwareProperties/dialog_add_sources_list.py
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 60a0208a..73544205 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -42,8 +42,7 @@ import aptsources
import dialog_add
import dialog_edit
import dialog_cache_outdated
-#import dialog_edit_predefined
-#import dialog_sources_list
+import dialog_add_sources_list
from dialog_apt_key import apt_key
from utils import *
@@ -225,7 +224,6 @@ class SoftwareProperties(SimpleGladeApp):
if self.file != None:
self.open_file(file)
-
def distro_to_widgets(self):
"""
Represent the distro information in the user interface
@@ -442,16 +440,15 @@ class SoftwareProperties(SimpleGladeApp):
def open_file(self, file):
"""Show an confirmation for adding the channels of the specified file"""
- #dialog = dialog_sources_list.AddSourcesList(self.window_main,
- # self.sourceslist,
- # self.render_source,
- # self.get_comparable,
- # self.datadir,
- # file)
- #res = dialog.run()
- #if res == gtk.RESPONSE_OK:
- # self.modified_sourceslist()
- print "droped a sources.list"
+ dialog = dialog_add_sources_list.AddSourcesList(self.window_main,
+ self.sourceslist,
+ self.render_source,
+ self.get_comparable,
+ self.datadir,
+ file)
+ res = dialog.run()
+ if res == gtk.RESPONSE_OK:
+ self.modified_sourceslist()
def on_sources_drag_data_received(self, widget, context, x, y,
selection, target_type, timestamp):
@@ -804,13 +801,8 @@ class SoftwareProperties(SimpleGladeApp):
if not iter:
return
source_entry = model.get_value(iter, LIST_ENTRY_OBJ)
- if source_entry.template == None:
- dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist,
- source_entry, self.datadir)
- else:
- dialog = dialog_edit_predefined.dialog_edit_predefined(self.window_main,
- self.sourceslist,
- source_entry, self.datadir)
+ dialog = dialog_edit.dialog_edit(self.window_main, self.sourceslist,
+ source_entry, self.datadir)
if dialog.run() == gtk.RESPONSE_OK:
self.modified_sourceslist()
diff --git a/SoftwareProperties/dialog_add_sources_list.py b/SoftwareProperties/dialog_add_sources_list.py
new file mode 100644
index 00000000..cf8ddd95
--- /dev/null
+++ b/SoftwareProperties/dialog_add_sources_list.py
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+import pygtk
+import gtk
+import gtk.glade
+import gobject
+import os
+from optparse import OptionParser
+from aptsources import SourcesList, SourceEntryMatcher
+from gettext import gettext as _
+import gettext
+import urllib
+from utils import *
+
+class AddSourcesList:
+ def __init__(self, parent, sourceslist, source_renderer,
+ get_comparable, datadir, file):
+ print file
+ self.parent = parent
+ self.source_renderer = source_renderer
+ self.sources_old = sourceslist
+ self.get_comparable = get_comparable
+ self.file = self.format_uri(file)
+ self.glade = gtk.glade.XML(os.path.join(datadir,
+ "glade/SoftwarePropertiesDialogs.glade"))
+ self.glade.signal_autoconnect(self)
+ self.dialog = self.glade.get_widget("dialog_sources_list")
+ self.label = self.glade.get_widget("label_sources")
+ self.button_add = self.glade.get_widget("button_add")
+ self.button_cancel = self.glade.get_widget("button_cancel")
+ self.treeview = self.glade.get_widget("treeview_sources")
+ self.button_close = self.glade.get_widget("button_close")
+ self.scrolled = self.glade.get_widget("scrolled_window")
+ self.image = self.glade.get_widget("image_sources_list")
+
+ self.dialog.realize()
+ if self.parent != None:
+ self.dialog.set_transient_for(parent)
+ else:
+ self.dialog.set_title(_("Add Software Channels"))
+ self.dialog.window.set_functions(gtk.gdk.FUNC_MOVE)
+
+ # Setup the treeview
+ self.store = gtk.ListStore(gobject.TYPE_STRING)
+ self.treeview.set_model(self.store)
+ cell = gtk.CellRendererText()
+ cell.set_property("xpad", 2)
+ cell.set_property("ypad", 2)
+ column = gtk.TreeViewColumn("Software Channel", cell, markup=0)
+ column.set_max_width(500)
+ self.treeview.append_column(column)
+
+ # Parse the source.list file
+ try:
+ self.sources = SingleSourcesList(self.file)
+ except:
+ self.error()
+ return
+
+ # show the found channels or an error message
+ if len(self.sources.list) > 0:
+ self.button_close.hide()
+ counter = 0
+
+ for source in self.sources.list:
+ if source.invalid or source.disabled:
+ continue
+ self.sources.matcher.match(source)
+ # sort the list
+ self.sources.list.sort(key=self.get_comparable)
+
+ for source in self.sources.list:
+ if source.invalid or source.disabled:
+ continue
+ counter = counter +1
+ line = self.source_renderer(source)
+ self.store.append([line])
+ if counter == 0:
+ self.error()
+ return
+
+ header = gettext.ngettext("Add the following software channel?",
+ "Add the following software channels?",
+ counter)
+ body = _("You can install software from a channel. Use "\
+ "trusted channels, only.")
+ self.label.set_markup("%s\n\n%s" % (header, body))
+ self.button_add.set_use_underline(True)
+ self.button_add.set_label(gettext.ngettext("_Add Channel",
+ "_Add Channels",
+ counter))
+ else:
+ self.error()
+ return
+
+ def error(self):
+ self.button_add.hide()
+ self.button_cancel.hide()
+ self.scrolled.hide()
+ self.button_close.show()
+ self.image.set_from_stock(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
+ header = _("Could not add any software channels")
+ body = _("The file '%s' does not contain any valid "
+ "software channels." % self.file)
+ self.label.set_markup("%s\n\n%s" % (header, body))
+
+ def run(self):
+ res = self.dialog.run()
+ if res == gtk.RESPONSE_OK:
+ for source in self.sources:
+ self.sources_old.add(source.type,
+ source.uri,
+ source.dist,
+ source.comps,
+ source.comment)
+ self.dialog.destroy()
+ return res
+
+ def format_uri(self, uri):
+ path = urllib.url2pathname(uri) # escape special chars
+ path = path.strip('\r\n\x00') # remove \r\n and NULL
+ if path.startswith('file:\\\\\\'): # windows
+ path = path[8:] # 8 is len('file:///')
+ elif path.startswith('file://'): #nautilus, rox
+ path = path[7:] # 7 is len('file://')
+ elif path.startswith('file:'): # xffm
+ path = path[5:] # 5 is len('file:')
+ return path
+
+class SingleSourcesList(SourcesList):
+ def __init__(self, file):
+ self.matcher = SourceEntryMatcher()
+ self.list = []
+ self.load(file)
diff --git a/data/glade/SoftwarePropertiesDialogs.glade b/data/glade/SoftwarePropertiesDialogs.glade
index b381965b..e95d31e7 100644
--- a/data/glade/SoftwarePropertiesDialogs.glade
+++ b/data/glade/SoftwarePropertiesDialogs.glade
@@ -895,4 +895,192 @@ You need a working internet connection to continue.
+
+ 6
+
+ GTK_WINDOW_TOPLEVEL
+ GTK_WIN_POS_NONE
+ False
+ False
+ False
+ True
+ False
+ False
+ GDK_WINDOW_TYPE_HINT_DIALOG
+ GDK_GRAVITY_NORTH_WEST
+ True
+ False
+ False
+
+
+
+ True
+ False
+ 12
+
+
+
+ True
+ GTK_BUTTONBOX_END
+
+
+
+ True
+ True
+ True
+ gtk-cancel
+ True
+ GTK_RELIEF_NORMAL
+ True
+ -6
+
+
+
+
+
+ True
+ True
+ True
+ GTK_RELIEF_NORMAL
+ True
+ -5
+
+
+
+ True
+ gtk-add
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+
+
+
+
+ True
+ True
+ True
+ gtk-close
+ True
+ GTK_RELIEF_NORMAL
+ True
+ -7
+
+
+
+
+ 0
+ False
+ True
+ GTK_PACK_END
+
+
+
+
+
+ 6
+ True
+ False
+ 12
+
+
+
+ True
+ gtk-dialog-question
+ 6
+ 0
+ 0
+ 0
+ 0
+
+
+ 0
+ False
+ True
+
+
+
+
+
+ True
+ False
+ 12
+
+
+
+ True
+
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ True
+ False
+ 0
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ 200
+ True
+ True
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
+ GTK_SHADOW_IN
+ GTK_CORNER_TOP_LEFT
+
+
+
+ True
+ True
+ False
+ True
+ False
+ True
+ False
+ False
+ False
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+
+
--
cgit v1.2.3
From 16c3025952c0828ed474acb724b05f04df12fa30 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Sat, 22 Jul 2006 18:19:57 +0200
Subject: * allow to replace the current sources by the ones from a file
---
SoftwareProperties/SoftwareProperties.py | 16 +++++++--
SoftwareProperties/dialog_add_sources_list.py | 52 ++++++++++++---------------
data/glade/SoftwarePropertiesDialogs.glade | 34 +++++++-----------
3 files changed, 47 insertions(+), 55 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 73544205..f7a40821 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -62,6 +62,8 @@ CONF_MAP = {
COLUMN_DESC
) = range(2)
+RESPONSE_REPLACE = 1
+RESPONSE_ADD = 2
# columns of the source_store
(
@@ -446,9 +448,17 @@ class SoftwareProperties(SimpleGladeApp):
self.get_comparable,
self.datadir,
file)
- res = dialog.run()
- if res == gtk.RESPONSE_OK:
- self.modified_sourceslist()
+ (res, new_sources) = dialog.run()
+ if res == RESPONSE_REPLACE:
+ self.sourceslist.list = []
+ if res in (RESPONSE_ADD, RESPONSE_REPLACE):
+ for source in new_sources:
+ self.sourceslist.add(source.type,
+ source.uri,
+ source.dist,
+ source.comps,
+ source.comment)
+ self.modified_sourceslist()
def on_sources_drag_data_received(self, widget, context, x, y,
selection, target_type, timestamp):
diff --git a/SoftwareProperties/dialog_add_sources_list.py b/SoftwareProperties/dialog_add_sources_list.py
index cf8ddd95..b0a868b1 100644
--- a/SoftwareProperties/dialog_add_sources_list.py
+++ b/SoftwareProperties/dialog_add_sources_list.py
@@ -17,18 +17,18 @@ class AddSourcesList:
print file
self.parent = parent
self.source_renderer = source_renderer
- self.sources_old = sourceslist
+ self.sourceslist = sourceslist
self.get_comparable = get_comparable
self.file = self.format_uri(file)
self.glade = gtk.glade.XML(os.path.join(datadir,
"glade/SoftwarePropertiesDialogs.glade"))
self.glade.signal_autoconnect(self)
- self.dialog = self.glade.get_widget("dialog_sources_list")
+ self.dialog = self.glade.get_widget("dialog_add_sources_list")
self.label = self.glade.get_widget("label_sources")
self.button_add = self.glade.get_widget("button_add")
self.button_cancel = self.glade.get_widget("button_cancel")
+ self.button_replace = self.glade.get_widget("button_replace")
self.treeview = self.glade.get_widget("treeview_sources")
- self.button_close = self.glade.get_widget("button_close")
self.scrolled = self.glade.get_widget("scrolled_window")
self.image = self.glade.get_widget("image_sources_list")
@@ -51,24 +51,23 @@ class AddSourcesList:
# Parse the source.list file
try:
- self.sources = SingleSourcesList(self.file)
+ self.new_sources = SingleSourcesList(self.file)
except:
self.error()
return
# show the found channels or an error message
- if len(self.sources.list) > 0:
- self.button_close.hide()
+ if len(self.new_sources.list) > 0:
counter = 0
- for source in self.sources.list:
+ for source in self.new_sources.list:
if source.invalid or source.disabled:
continue
- self.sources.matcher.match(source)
+ self.new_sources.matcher.match(source)
# sort the list
- self.sources.list.sort(key=self.get_comparable)
+ self.new_sources.list.sort(key=self.get_comparable)
- for source in self.sources.list:
+ for source in self.new_sources.list:
if source.invalid or source.disabled:
continue
counter = counter +1
@@ -78,42 +77,35 @@ class AddSourcesList:
self.error()
return
- header = gettext.ngettext("Add the following software channel?",
- "Add the following software channels?",
+ header = gettext.ngettext("Install software additionally or "
+ "only from this source?",
+ "Install software additionally or "
+ "only from these sources?",
counter)
- body = _("You can install software from a channel. Use "\
- "trusted channels, only.")
+ body = _("You can either add the following sources or replace your "
+ "current sources by them. Only install software from "
+ "trusted sources.")
self.label.set_markup("%s\n\n%s" % (header, body))
- self.button_add.set_use_underline(True)
- self.button_add.set_label(gettext.ngettext("_Add Channel",
- "_Add Channels",
- counter))
else:
self.error()
return
def error(self):
self.button_add.hide()
- self.button_cancel.hide()
+ self.button_cancel.set_use_stock(True)
+ self.button_cancel.set_label("gtk-close")
+ self.button_replace.hide()
self.scrolled.hide()
- self.button_close.show()
self.image.set_from_stock(gtk.STOCK_DIALOG_ERROR, gtk.ICON_SIZE_DIALOG)
- header = _("Could not add any software channels")
+ header = _("There are no sources to install software from")
body = _("The file '%s' does not contain any valid "
- "software channels." % self.file)
+ "software sources." % self.file)
self.label.set_markup("%s\n\n%s" % (header, body))
def run(self):
res = self.dialog.run()
- if res == gtk.RESPONSE_OK:
- for source in self.sources:
- self.sources_old.add(source.type,
- source.uri,
- source.dist,
- source.comps,
- source.comment)
self.dialog.destroy()
- return res
+ return res, self.new_sources
def format_uri(self, uri):
path = urllib.url2pathname(uri) # escape special chars
diff --git a/data/glade/SoftwarePropertiesDialogs.glade b/data/glade/SoftwarePropertiesDialogs.glade
index e95d31e7..b4bf6180 100644
--- a/data/glade/SoftwarePropertiesDialogs.glade
+++ b/data/glade/SoftwarePropertiesDialogs.glade
@@ -895,7 +895,7 @@ You need a working internet connection to continue.
-
+
6
GTK_WINDOW_TOPLEVEL
@@ -924,51 +924,41 @@ You need a working internet connection to continue.
GTK_BUTTONBOX_END
-
+
True
True
True
- gtk-cancel
- True
+ _Replace
+ True
GTK_RELIEF_NORMAL
True
- -6
+ 1
-
+
True
True
True
+ gtk-cancel
+ True
GTK_RELIEF_NORMAL
True
- -5
-
-
-
- True
- gtk-add
- 4
- 0.5
- 0.5
- 0
- 0
-
-
+ -6
-
+
True
True
True
- gtk-close
+ gtk-add
True
GTK_RELIEF_NORMAL
True
- -7
+ 2
--
cgit v1.2.3
From 54d5696fa964d3cc7a79a1ba0ed4083d9701de1e Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Thu, 27 Jul 2006 17:20:33 +0200
Subject: * data/glade/SoftwareProperties.glade: - changed the text for
Popcon participation * SoftwareProperties/SoftwareProperties.py: - support
popcon pariticipation
---
SoftwareProperties/SoftwareProperties.py | 22 ++++++++++++++++++++++
data/glade/SoftwareProperties.glade | 2 +-
2 files changed, 23 insertions(+), 1 deletion(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
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
+
diff --git a/data/glade/SoftwareProperties.glade b/data/glade/SoftwareProperties.glade
index 08ffd743..98bf65bc 100644
--- a/data/glade/SoftwareProperties.glade
+++ b/data/glade/SoftwareProperties.glade
@@ -1057,7 +1057,7 @@
True
- <i>Please take part in the popularity contest, to improve the user experience of Ubuntu. Therefor the following data will be collected and sent to the Ubuntu project anonymously on a weekly basis: the list of installed software and how often it was used.
+ <i>To improve the user experience of Ubuntu please take part in the popularity contest. If you do so the list of installed software and how often it was used will be collected and sent anonymously to the Ubuntu project on a weekly basis.
The results are used to improve the support for popular applications and to rank applications in the search results.</i>
False
--
cgit v1.2.3
From 2179699f8b08b68be792cb0e5f263931475fc26d Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 27 Jul 2006 22:40:09 +0200
Subject: * add an error handler if the locale is not in the iso country list
---
SoftwareProperties/SoftwareProperties.py | 12 ++++++++----
SoftwareProperties/aptsources.py | 5 ++++-
2 files changed, 12 insertions(+), 5 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 93028206..9e9071be 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -292,10 +292,14 @@ class SoftwareProperties(SimpleGladeApp):
self.combobox_server.set_model(server_store)
server_store.append([_("Main server"),
self.distro.main_server])
- # TRANSLATORS: %s is a country
- server_store.append([_("Server for %s") % gettext.dgettext("iso-3166",
- self.distro.country).rstrip(),
- self.distro.nearest_server])
+ if self.distro.country != None:
+ # TRANSLATORS: %s is a country
+ server_store.append([_("Server for %s") % gettext.dgettext("iso-3166",
+ self.distro.country).rstrip(),
+ self.distro.nearest_server])
+ else:
+ server_store.append([_("Nearest server"),
+ self.distro.nearest_server])
if len(self.distro.used_servers) > 0:
for server in self.distro.used_servers:
if not re.match(server, self.distro.main_server) and \
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
index 40b55dfa..a4d16fa0 100644
--- a/SoftwareProperties/aptsources.py
+++ b/SoftwareProperties/aptsources.py
@@ -563,7 +563,10 @@ class Distribution:
country_code = locale[a+1:z].lower()
self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
country_code
- self.country = self.countries[country_code]
+ if self.countries.has_key(country_code):
+ self.country = self.countries[country_code]
+ else:
+ self.country = None
# other used servers
for medium in self.used_media:
--
cgit v1.2.3
From 8b0c51a898bd788ba5f2285daf4f15ab8d78ae67 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Thu, 27 Jul 2006 23:37:19 +0200
Subject: * fix the close button in the window decoration
---
SoftwareProperties/SoftwareProperties.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 9e9071be..768e942a 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -927,7 +927,7 @@ class SoftwareProperties(SimpleGladeApp):
self.reload_keyslist()
def on_delete_event(self, widget, args):
- self.on_close_button(self, widget)
+ self.on_close_button(widget)
def on_close_button(self, widget):
# show a dialog that a reload of the channel information is required
--
cgit v1.2.3
From 18ebb5a4446010824b05b92820689e795498cd87 Mon Sep 17 00:00:00 2001
From: "glatzor@ubuntu.com" <>
Date: Fri, 28 Jul 2006 00:22:49 +0200
Subject: * add a revert and add cdrom button
---
SoftwareProperties/SoftwareProperties.py | 21 +++--
data/glade/SoftwareProperties.glade | 135 ++++++++++++++++++++++++++-----
2 files changed, 131 insertions(+), 25 deletions(-)
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 768e942a..35793151 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -118,6 +118,7 @@ class SoftwareProperties(SimpleGladeApp):
self.init_sourceslist()
self.reload_sourceslist()
+ self.backup_sourceslist()
self.window_main.show()
@@ -572,6 +573,15 @@ class SoftwareProperties(SimpleGladeApp):
self.sourceslist = aptsources.SourcesList()
+ def backup_sourceslist(self):
+ """
+ Duplicate the list of sources
+ """
+ self.sourceslist_backup = []
+ for source in self.sourceslist.list:
+ source_bkp = aptsources.SourceEntry(line=source.line,file=source.file)
+ self.sourceslist_backup.append(source_bkp)
+
def on_channel_activate(self, treeview, path, column):
"""Open the edit dialog if a channel was double clicked"""
self.on_edit_clicked(treeview)
@@ -607,10 +617,11 @@ class SoftwareProperties(SimpleGladeApp):
def on_button_revert_clicked(self, button):
"""Restore the source list from the startup of the dialog"""
- self.sourceslist.restoreBackup(".save")
- self.sourceslist.clearBackup(".save")
- self.sourceslist.backup(".save")
- self.sourceslist.refresh()
+ self.sourceslist.list = []
+ for source in self.sourceslist_backup:
+ source_reset = aptsources.SourceEntry(line=source.line,file=source.file)
+ self.sourceslist.list.append(source_reset)
+ self.save_sourceslist()
self.reload_sourceslist()
self.button_revert.set_sensitive(False)
self.modified = False
@@ -619,7 +630,7 @@ class SoftwareProperties(SimpleGladeApp):
"""The sources list was changed and now needs to be saved and reloaded"""
self.massive_debug_output()
self.modified = True
- #self.button_revert.set_sensitive(True)
+ self.button_revert.set_sensitive(True)
self.save_sourceslist()
self.reload_sourceslist()
diff --git a/data/glade/SoftwareProperties.glade b/data/glade/SoftwareProperties.glade
index 98bf65bc..d262980d 100644
--- a/data/glade/SoftwareProperties.glade
+++ b/data/glade/SoftwareProperties.glade
@@ -737,7 +737,7 @@
True
- False
+ True
6
@@ -758,6 +758,85 @@
+
+
+ True
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+
+ True
+ 0.5
+ 0.5
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
+
+
+
+ True
+ False
+ 2
+
+
+
+ True
+ gtk-add
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Add Cdrom
+ True
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+ PANGO_ELLIPSIZE_NONE
+ -1
+ False
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+
+
+
+ 0
+ False
+ False
+
+
+
True
@@ -794,25 +873,10 @@
-
- 0
- True
- True
-
-
-
-
-
- True
- gtk-revert-to-saved
- True
- GTK_RELIEF_NORMAL
- True
-
0
False
- False
+ True
@@ -1138,11 +1202,11 @@ The results are used to improve the support for popular applications and to rank
-
+
6
True
- GTK_BUTTONBOX_EDGE
- 0
+ False
+ 6
@@ -1155,6 +1219,11 @@ The results are used to improve the support for popular applications and to rank
True
+
+ 0
+ False
+ False
+
@@ -1168,6 +1237,32 @@ The results are used to improve the support for popular applications and to rank
True
+
+ 0
+ False
+ False
+ GTK_PACK_END
+
+
+
+
+
+ True
+ False
+ True
+ True
+ gtk-revert-to-saved
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+ 0
+ False
+ False
+ GTK_PACK_END
+
--
cgit v1.2.3
From 372e249cb7ca0f7da468786f1d643cfc3905ffc6 Mon Sep 17 00:00:00 2001
From: Michael Vogt
Date: Mon, 31 Jul 2006 23:39:48 +0200
Subject: * moved aptsources into the Common directory
---
DistUpgrade/DistUpgrade.glade | 2 +-
DistUpgrade/build-tarball.sh | 2 +-
SoftwareProperties/SoftwareProperties.py | 2 +-
SoftwareProperties/aptsources.py | 665 ------------------------------
UpdateManager/Common/aptsources.py | 666 +++++++++++++++++++++++++++++++
po/ar.po | 2 +-
po/bg.po | 2 +-
po/bn.po | 2 +-
po/br.po | 2 +-
po/ca.po | 2 +-
po/cs.po | 2 +-
po/da.po | 2 +-
po/de.po | 2 +-
po/el.po | 2 +-
po/en_AU.po | 2 +-
po/en_CA.po | 2 +-
po/en_GB.po | 2 +-
po/es.po | 2 +-
po/fi.po | 2 +-
po/fr.po | 2 +-
po/fur.po | 2 +-
po/gl.po | 2 +-
po/he.po | 2 +-
po/hi.po | 2 +-
po/hr.po | 2 +-
po/hu.po | 2 +-
po/id.po | 2 +-
po/it.po | 2 +-
po/ja.po | 2 +-
po/ka.po | 2 +-
po/ko.po | 2 +-
po/ku.po | 2 +-
po/lt.po | 2 +-
po/mk.po | 2 +-
po/ms.po | 2 +-
po/nb.po | 2 +-
po/ne.po | 2 +-
po/nl.po | 2 +-
po/no.po | 2 +-
po/oc.po | 2 +-
po/pa.po | 2 +-
po/pl.po | 2 +-
po/pt.po | 2 +-
po/pt_BR.po | 2 +-
po/ro.po | 2 +-
po/ru.po | 2 +-
po/rw.po | 2 +-
po/sk.po | 2 +-
po/sr.po | 2 +-
po/sv.po | 2 +-
po/th.po | 2 +-
po/tr.po | 2 +-
po/uk.po | 2 +-
po/update-manager.pot | 2 +-
po/ur.po | 2 +-
po/urd.po | 2 +-
po/vi.po | 2 +-
po/xh.po | 2 +-
po/zh_CN.po | 2 +-
po/zh_HK.po | 2 +-
po/zh_TW.po | 2 +-
software-properties | 2 +-
62 files changed, 726 insertions(+), 725 deletions(-)
delete mode 100644 SoftwareProperties/aptsources.py
create mode 100644 UpdateManager/Common/aptsources.py
(limited to 'SoftwareProperties/SoftwareProperties.py')
diff --git a/DistUpgrade/DistUpgrade.glade b/DistUpgrade/DistUpgrade.glade
index 91d5b33f..a31df120 100644
--- a/DistUpgrade/DistUpgrade.glade
+++ b/DistUpgrade/DistUpgrade.glade
@@ -38,7 +38,7 @@
True
- <span weight="bold" size="x-large">Upgrading to Ubuntu 6.06 LTS</span>
+ <span weight="bold" size="x-large">Upgrading to Ubuntu 6.10</span>
False
True
GTK_JUSTIFY_LEFT
diff --git a/DistUpgrade/build-tarball.sh b/DistUpgrade/build-tarball.sh
index a30e40a0..4f88b848 100755
--- a/DistUpgrade/build-tarball.sh
+++ b/DistUpgrade/build-tarball.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-DIST=dapper
+DIST=edgy
# cleanup
rm -f *~ *.bak *.pyc *.moved '#'*
diff --git a/SoftwareProperties/SoftwareProperties.py b/SoftwareProperties/SoftwareProperties.py
index 35793151..18e5d260 100644
--- a/SoftwareProperties/SoftwareProperties.py
+++ b/SoftwareProperties/SoftwareProperties.py
@@ -38,7 +38,7 @@ import re
from UpdateManager.Common.SimpleGladeApp import SimpleGladeApp
from UpdateManager.Common.HelpViewer import HelpViewer
-import aptsources
+import UpdateManager.Common.aptsources as aptsources
import dialog_add
import dialog_edit
import dialog_cache_outdated
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py
deleted file mode 100644
index a4d16fa0..00000000
--- a/SoftwareProperties/aptsources.py
+++ /dev/null
@@ -1,665 +0,0 @@
-# aptsource.py.in - parse sources.list
-#
-# Copyright (c) 2004,2005 Canonical
-# 2004 Michiel Sikkes
-#
-# Author: Michiel Sikkes
-# Michael Vogt
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-# USA
-
-import string
-import gettext
-import re
-import apt_pkg
-import glob
-import shutil
-import time
-import os.path
-
-#import pdb
-
-from UpdateManager.Common.DistInfo import DistInfo
-
-
-# some global helpers
-def is_mirror(master_uri, compare_uri):
- """check if the given add_url is idential or a mirror of orig_uri
- e.g. master_uri = archive.ubuntu.com
- compare_uri = de.archive.ubuntu.com
- -> True
- """
- # remove traling spaces and "/"
- compare_uri = compare_uri.rstrip("/ ")
- master_uri = master_uri.rstrip("/ ")
- # uri is identical
- if compare_uri == master_uri:
- #print "Identical"
- return True
- # add uri is a master site and orig_uri has the from "XX.mastersite"
- # (e.g. de.archive.ubuntu.com)
- try:
- compare_srv = compare_uri.split("//")[1]
- master_srv = master_uri.split("//")[1]
- #print "%s == %s " % (add_srv, orig_srv)
- except IndexError: # ok, somethings wrong here
- #print "IndexError"
- return False
- # remove the leading "." (if any) and see if that helps
- if "." in compare_srv and \
- compare_srv[compare_srv.index(".")+1:] == master_srv:
- #print "Mirror"
- return True
- return False
-
-def uniq(s):
- """ simple and efficient way to return uniq list """
- return list(set(s))
-
-
-
-# actual source.list entries
-class SourceEntry:
-
- def __init__(self, line,file=None):
- self.invalid = False
- self.disabled = False
- self.type = ""
- self.uri = ""
- self.dist = ""
- self.comps = []
- self.comment = ""
- self.line = line
- if file == None:
- file = apt_pkg.Config.FindDir("Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist")
- self.file = file
- self.parse(line)
- self.template = None
- self.children = []
-
- # works mostely like split but takes [] into account
- def mysplit(self, line):
- line = string.strip(line)
- pieces = []
- tmp = ""
- # we are inside a [..] block
- p_found = False
- space_found = False
- for i in range(len(line)):
- if line[i] == "[":
- p_found=True
- tmp += line[i]
- elif line[i] == "]":
- p_found=False
- tmp += line[i]
- elif space_found and not line[i].isspace(): # we skip one or more space
- space_found = False
- pieces.append(tmp)
- tmp = line[i]
- elif line[i].isspace() and not p_found: # found a whitespace
- space_found = True
- else:
- tmp += line[i]
- # append last piece
- if len(tmp) > 0:
- pieces.append(tmp)
- return pieces
-
-
- # parse a given source line and split it into the fields we need
- def parse(self,line):
- line = string.strip(self.line)
- #print line
- # check if the source is enabled/disabled
- if line == "" or line == "#": # empty line
- self.invalid = True
- return
- if line[0] == "#":
- self.disabled = True
- pieces = string.split(line[1:])
- # if it looks not like a disabled deb line return
- if not (pieces[0] == "deb" or pieces[0] == "deb-src"):
- self.invalid = True
- return
- else:
- line = line[1:]
- # check for another "#" in the line (this is treated as a comment)
- i = line.find("#")
- if i > 0:
- self.comment = line[i+1:]
- line = line[:i]
- # source is ok, split it and see what we have
- pieces = self.mysplit(line)
- # Sanity check
- if len(pieces) < 3:
- self.invalid = True
- return
- # Type, deb or deb-src
- self.type = string.strip(pieces[0])
- # Sanity check
- if self.type not in ("deb", "deb-src"):
- self.invalid = True
- return
- # URI
- self.uri = string.strip(pieces[1])
- if len(self.uri) < 1:
- self.invalid = True
- # distro and components (optional)
- # Directory or distro
- self.dist = string.strip(pieces[2])
- if len(pieces) > 3:
- # List of components
- self.comps = pieces[3:]
- else:
- self.comps = []
-
- #print self.__dict__
-
-
- # set enabled/disabled
- def set_enabled(self, new_value):
- self.disabled = not new_value
- # enable, remove all "#" from the start of the line
- if new_value == True:
- i=0
- self.line = string.lstrip(self.line)
- while self.line[i] == "#":
- i += 1
- self.line = self.line[i:]
- else:
- # disabled, add a "#"
- if string.strip(self.line)[0] != "#":
- self.line = "#" + self.line
-
- def __str__(self):
- """ debug helper """
- return self.str().strip()
-
- def str(self):
- """ return the current line as string """
- if self.invalid:
- return self.line
- line = ""
- if self.disabled:
- line = "# "
- line += "%s %s %s" % (self.type, self.uri, self.dist)
- if len(self.comps) > 0:
- line += " " + " ".join(self.comps)
- if self.comment != "":
- line += " #"+self.comment
- line += "\n"
- return line
-
-# the SourceList file as a class
-class SourcesList:
- def __init__(self):
- self.list = [] # of Type SourceEntries
- self.matcher = SourceEntryMatcher()
- self.refresh()
-
- def refresh(self):
- self.list = []
- # read sources.list
- dir = apt_pkg.Config.FindDir("Dir::Etc")
- file = apt_pkg.Config.Find("Dir::Etc::sourcelist")
- self.load(dir+file)
- # read sources.list.d
- partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts")
- for file in glob.glob("%s/*.list" % partsdir):
- self.load(file)
- # check if the source item fits a predefined template
- for source in self.list:
- if source.invalid == False:
- self.matcher.match(source)
-
- def __iter__(self):
- for entry in self.list:
- yield entry
- raise StopIteration
-
- def add(self, type, uri, dist, comps, comment="", pos=-1, file=None):
- """
- Add a new source to the sources.list.
- The method will search for existing matching repos and will try to
- reuse them as far as possible
- """
- for source in self.list:
- # if there is a repo with the same (type, uri, dist) just add the
- # components
- if source.disabled == False and source.invalid == False and \
- source.type == type and uri == source.uri and \
- source.dist == dist:
- comps = uniq(source.comps + comps)
- source.comps = comps
- return source
- # if there is a corresponding repo which is disabled, enable it
- elif source.disabled == True and source.invalid == False and \
- source.type == type and uri == source.uri and \
- source.dist == dist and \
- len(set(source.comps) & set(comps)) == len(comps):
- source.disabled = False
- return source
- # there isn't any matching source, so create a new line and parse it
- line = "%s %s %s" % (type,uri,dist)
- for c in comps:
- line = line + " " + c;
- if comment != "":
- line = "%s #%s\n" %(line,comment)
- line = line + "\n"
- new_entry = SourceEntry(line)
- if file != None:
- new_entry.file = file
- self.matcher.match(new_entry)
- self.list.insert(pos, new_entry)
- return new_entry
-
- def remove(self, source_entry):
- self.list.remove(source_entry)
-
- def restoreBackup(self, backup_ext):
- " restore sources.list files based on the backup extension "
- dir = apt_pkg.Config.FindDir("Dir::Etc")
- file = apt_pkg.Config.Find("Dir::Etc::sourcelist")
- if os.path.exists(dir+file+backup_ext):
- shutil.copy(dir+file+backup_ext,dir+file)
- # now sources.list.d
- partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts")
- for file in glob.glob("%s/*.list" % partsdir):
- if os.path.exists(file+backup_ext):
- shutil.copy(file+backup_ext,file)
-
- def backup(self, backup_ext=None):
- """ make a backup of the current source files, if no backup extension
- is given, the current date/time is used (and returned) """
- already_backuped = set()
- if backup_ext == None:
- backup_ext = time.strftime("%y%m%d.%H%M")
- for source in self.list:
- if not source.file in already_backuped:
- shutil.copy(source.file,"%s%s" % (source.file,backup_ext))
- return backup_ext
-
- def load(self,file):
- """ (re)load the current sources """
- try:
- f = open(file, "r")
- lines = f.readlines()
- for line in lines:
- source = SourceEntry(line,file)
- self.list.append(source)
- except:
- print "could not open file '%s'" % file
- else:
- f.close()
-
- def save(self):
- """ save the current sources """
- files = {}
- for source in self.list:
- if not files.has_key(source.file):
- files[source.file]=open(source.file,"w")
- files[source.file].write(source.str())
- for f in files:
- files[f].close()
-
- def check_for_relations(self, sources_list):
- """get all parent and child channels in the sources list"""
- parents = []
- used_child_templates = {}
- for source in sources_list:
- # try to avoid checking uninterressting sources
- if source.template == None:
- continue
- # set up a dict with all used child templates and corresponding
- # source entries
- if source.template.child == True:
- key = source.template
- if not used_child_templates.has_key(key):
- used_child_templates[key] = []
- temp = used_child_templates[key]
- temp.append(source)
- else:
- # store each source with children aka. a parent :)
- if len(source.template.children) > 0:
- parents.append(source)
- #print self.used_child_templates
- #print self.parents
- return (parents, used_child_templates)
-
-# templates for the add dialog
-class SourceEntryTemplate(SourceEntry):
- def __init__(self,a_type,uri,dist,description,comps):
- self.comps_descriptions = []
- self.type = a_type
- self.uri = uri
- self.dist = dist
- self.description = description
- self.comps = comps
-
- def matches(self,source_entry):
- """ check if a given source_entry matches this one """
- if (self.type != source_entry.type):
- return False
- if (self.dist != source_entry.dist):
- return False
- if not is_mirror(self.uri,source_entry.uri):
- return False
- for e_comp in source_entry.comps:
- for t_comp in self.comps:
- if e_comp == t_comp.name: break
- else:
- return False
- return True
-
-class SourceCompTemplate:
- def __init__(self, name, description, on_by_default):
- self.name = name
- self.description = description
- self.on_by_default = on_by_default
-
-class SourceEntryTemplates:
- def __init__(self,datadir):
- _ = gettext.gettext
- self.templates = []
-
- dinfo = DistInfo (base_dir=datadir+"channels/")
-
- for suite in dinfo.suites:
- comps = []
- for comp in suite.components:
- comps.append(SourceCompTemplate(comp.name, _(comp.description),
- comp.enabled))
- self.templates.append (SourceEntryTemplate(suite.repository_type,
- suite.base_uri,
- suite.name,
- suite.description,
- comps))
-
-# matcher class to make a source entry look nice
-# lots of predefined matchers to make it i18n/gettext friendly
-class SourceEntryMatcher:
- class MatchType:
- def __init__(self, a_type,a_descr):
- self.type = a_type
- self.description = a_descr
-
- class MatchDist:
- def __init__(self,a_uri,a_dist, a_descr,l_comps, l_comps_descr):
- self.uri = a_uri
- self.dist = a_dist
- self.description = a_descr
- self.comps = l_comps
- self.comps_descriptions = l_comps_descr
-
- def __init__(self):
- self.templates = []
- # Get the human readable channel and comp names from the channel .infos
- spec_files = glob.glob("/usr/share/update-manager/channels/*.info")
- for f in spec_files:
- f = os.path.basename(f)
- i = f.find(".info")
- f = f[0:i]
- dist = DistInfo(f)
- for suite in dist.suites:
- if suite.match_uri != None:
- self.templates.append(suite)
- return
-
- def match(self, source):
- """Add a matching template to the source"""
- _ = gettext.gettext
- found = False
- for template in self.templates:
- #print "'%s'" %source.uri
- if re.search(template.match_uri, source.uri) and \
- re.match(template.match_name, source.dist):
- found = True
- source.template = template
- break
- return found
-
-class Distribution:
- def __init__(self):
- """"
- Container for distribution specific informations
- """
- # LSB information
- self.id = ""
- self.codename = ""
- self.description = ""
- self.release = ""
-
- # get the LSB information
- lsb_info = []
- for lsb_option in ["-i", "-c", "-d", "-r"]:
- pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
- lsb_info.append(pipe.read().strip())
- del pipe
- (self.id, self.codename, self.description, self.release) = lsb_info
-
- # get a list of country codes and real names
- self.countries = {}
- try:
- f = open("/usr/share/iso-codes/iso_3166.tab", "r")
- lines = f.readlines()
- for line in lines:
- parts = line.split("\t")
- self.countries[parts[0].lower()] = parts[1]
- except:
- print "could not open file '%s'" % file
- else:
- f.close()
-
- def get_sources(self, sources_list):
- """
- Find the corresponding template, main and child sources
- for the distribution
- """
- # corresponding sources
- self.source_template = None
- self.child_sources = []
- self.main_sources = []
- self.disabled_sources = []
- self.cdrom_sources = []
- self.download_comps = []
- self.enabled_comps = []
- self.cdrom_comps = []
- self.used_media = []
- self.get_source_code = False
- self.source_code_sources = []
-
- # location of the sources
- self.default_server = ""
- self.main_server = ""
- self.nearest_server = ""
- self.used_servers = []
-
- # find the distro template
- for template in sources_list.matcher.templates:
- if template.name == self.codename and\
- template.distribution == self.id:
- #print "yeah! found a template for %s" % self.description
- #print template.description, template.base_uri, template.components
- self.source_template = template
- 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
- media = []
- comps = []
- cdrom_comps = []
- enabled_comps = []
- source_code = []
- for source in sources_list.list:
- if source.invalid == False and\
- source.dist == self.codename and\
- source.template and\
- source.template.name == self.codename:
- #print "yeah! found a distro repo: %s" % source.line
- # cdroms need do be handled differently
- if source.uri.startswith("cdrom:") and \
- source.disabled == False:
- self.cdrom_sources.append(source)
- cdrom_comps.extend(source.comps)
- elif source.uri.startswith("cdrom:") and \
- source.disabled == True:
- self.cdrom_sources.append(source)
- elif source.type == "deb" and source.disabled == False:
- self.main_sources.append(source)
- comps.extend(source.comps)
- media.append(source.uri)
- elif source.type == "deb" and source.disabled == True:
- self.disabled_sources.append(source)
- elif source.type.endswith("-src") and source.disabled == False:
- self.source_code_sources.append(source)
- elif source.type.endswith("-src") and source.disabled == True:
- self.disabled_sources.append(source)
- if source.template in self.source_template.children:
- #print "yeah! child found: %s" % source.template.name
- if source.type == "deb":
- self.child_sources.append(source)
- elif source.type == "deb-src":
- self.source_code_sources.append(source)
- self.download_comps = set(comps)
- self.cdrom_comps = set(cdrom_comps)
- enabled_comps.extend(comps)
- enabled_comps.extend(cdrom_comps)
- self.enabled_comps = set(enabled_comps)
- self.used_media = set(media)
-
- self.get_mirrors()
-
- def get_mirrors(self):
- """
- Provide a set of mirrors where you can get the distribution from
- """
- # the main server is stored in the template
- self.main_server = self.source_template.base_uri
-
- # try to guess the nearest mirror from the locale
- # FIXME: for debian we need something different
- if self.id == "Ubuntu":
- locale = os.getenv("LANG", default="en.UK")
- a = locale.find("_")
- z = locale.find(".")
- if z == -1:
- z = len(locale)
- country_code = locale[a+1:z].lower()
- self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
- country_code
- if self.countries.has_key(country_code):
- self.country = self.countries[country_code]
- else:
- self.country = None
-
- # other used servers
- for medium in self.used_media:
- if not medium.startswith("cdrom:"):
- # seems to be a network source
- self.used_servers.append(medium)
-
- if len(self.main_sources) == 0:
- self.default_server = self.main_server
- else:
- self.default_server = self.main_sources[0].uri
-
- def add_source(self, sources_list, type=None,
- uri=None, dist=None, comps=None, comment=""):
- """
- Add distribution specific sources
- """
- if uri == None:
- # FIXME: Add support for the server selector
- uri = self.default_server
- if dist == None:
- dist = self.codename
- if comps == None:
- comps = list(self.enabled_comps)
- if type == None:
- type = "deb"
- if comment == "":
- comment == "Added by software-properties"
- new_source = sources_list.add(type, uri, dist, comps, comment)
- # if source code is enabled add a deb-src line after the new
- # source
- if self.get_source_code == True and not type.endswith("-src"):
- sources_list.add("%s-src" % type, uri, dist, comps, comment,
- file=new_source.file,
- pos=sources_list.list.index(new_source)+1)
-
- def enable_component(self, sourceslist, comp):
- """
- Disable a component in all main, child and source code sources
- (excluding cdrom based sources)
-
- sourceslist: an aptsource.sources_list
- comp: the component that should be enabled
- """
- sources = []
- sources.extend(self.main_sources)
- sources.extend(self.child_sources)
- sources.extend(self.source_code_sources)
- # check if there is a main source at all
- if len(self.main_sources) < 1:
- # create a new main source
- self.add_source(sourceslist, comps=["%s"%comp])
- else:
- # add the comp to all main, child and source code sources
- for source in sources:
- if comp not in source.comps:
- source.comps.append(comp)
- if self.get_source_code == True:
- for source in self.source_code_sources:
- if comp not in source.comps: source.comps.append(comp)
-
- def disable_component(self, sourceslist, comp):
- """
- Disable a component in all main, child and source code sources
- (excluding cdrom based sources)
- """
- sources = []
- sources.extend(self.main_sources)
- sources.extend(self.child_sources)
- sources.extend(self.source_code_sources)
- if comp in self.cdrom_comps:
- sources = []
- sources.extend(self.main_sources)
-
- for source in sources:
- if comp in source.comps:
- source.comps.remove(comp)
- if len(source.comps) < 1:
- sourceslist.remove(source)
-
-
-# some simple tests
-if __name__ == "__main__":
- apt_pkg.InitConfig()
- sources = SourcesList()
-
- for entry in sources:
- print entry.str()
- #print entry.uri
-
- mirror = is_mirror("http://archive.ubuntu.com/ubuntu/",
- "http://de.archive.ubuntu.com/ubuntu/")
- print "is_mirror(): %s" % mirror
-
- print is_mirror("http://archive.ubuntu.com/ubuntu",
- "http://de.archive.ubuntu.com/ubuntu/")
diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py
new file mode 100644
index 00000000..fce06c2b
--- /dev/null
+++ b/UpdateManager/Common/aptsources.py
@@ -0,0 +1,666 @@
+# aptsource.py.in - parse sources.list
+#
+# Copyright (c) 2004,2005 Canonical
+# 2004 Michiel Sikkes
+#
+# Author: Michiel Sikkes
+# Michael Vogt
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+import string
+import gettext
+import re
+import apt_pkg
+import glob
+import shutil
+import time
+import os.path
+
+#import pdb
+
+from UpdateManager.Common.DistInfo import DistInfo
+
+
+# some global helpers
+def is_mirror(master_uri, compare_uri):
+ """check if the given add_url is idential or a mirror of orig_uri
+ e.g. master_uri = archive.ubuntu.com
+ compare_uri = de.archive.ubuntu.com
+ -> True
+ """
+ # remove traling spaces and "/"
+ compare_uri = compare_uri.rstrip("/ ")
+ master_uri = master_uri.rstrip("/ ")
+ # uri is identical
+ if compare_uri == master_uri:
+ #print "Identical"
+ return True
+ # add uri is a master site and orig_uri has the from "XX.mastersite"
+ # (e.g. de.archive.ubuntu.com)
+ try:
+ compare_srv = compare_uri.split("//")[1]
+ master_srv = master_uri.split("//")[1]
+ #print "%s == %s " % (add_srv, orig_srv)
+ except IndexError: # ok, somethings wrong here
+ #print "IndexError"
+ return False
+ # remove the leading "." (if any) and see if that helps
+ if "." in compare_srv and \
+ compare_srv[compare_srv.index(".")+1:] == master_srv:
+ #print "Mirror"
+ return True
+ return False
+
+def uniq(s):
+ """ simple and efficient way to return uniq list """
+ return list(set(s))
+
+
+
+# actual source.list entries
+class SourceEntry:
+
+ def __init__(self, line,file=None):
+ self.invalid = False
+ self.disabled = False
+ self.type = ""
+ self.uri = ""
+ self.dist = ""
+ self.comps = []
+ self.comment = ""
+ self.line = line
+ if file == None:
+ file = apt_pkg.Config.FindDir("Dir::Etc")+apt_pkg.Config.Find("Dir::Etc::sourcelist")
+ self.file = file
+ self.parse(line)
+ self.template = None
+ self.children = []
+
+ # works mostely like split but takes [] into account
+ def mysplit(self, line):
+ line = string.strip(line)
+ pieces = []
+ tmp = ""
+ # we are inside a [..] block
+ p_found = False
+ space_found = False
+ for i in range(len(line)):
+ if line[i] == "[":
+ p_found=True
+ tmp += line[i]
+ elif line[i] == "]":
+ p_found=False
+ tmp += line[i]
+ elif space_found and not line[i].isspace(): # we skip one or more space
+ space_found = False
+ pieces.append(tmp)
+ tmp = line[i]
+ elif line[i].isspace() and not p_found: # found a whitespace
+ space_found = True
+ else:
+ tmp += line[i]
+ # append last piece
+ if len(tmp) > 0:
+ pieces.append(tmp)
+ return pieces
+
+
+ # parse a given source line and split it into the fields we need
+ def parse(self,line):
+ line = string.strip(self.line)
+ #print line
+ # check if the source is enabled/disabled
+ if line == "" or line == "#": # empty line
+ self.invalid = True
+ return
+ if line[0] == "#":
+ self.disabled = True
+ pieces = string.split(line[1:])
+ # if it looks not like a disabled deb line return
+ if not (pieces[0] == "deb" or pieces[0] == "deb-src"):
+ self.invalid = True
+ return
+ else:
+ line = line[1:]
+ # check for another "#" in the line (this is treated as a comment)
+ i = line.find("#")
+ if i > 0:
+ self.comment = line[i+1:]
+ line = line[:i]
+ # source is ok, split it and see what we have
+ pieces = self.mysplit(line)
+ # Sanity check
+ if len(pieces) < 3:
+ self.invalid = True
+ return
+ # Type, deb or deb-src
+ self.type = string.strip(pieces[0])
+ # Sanity check
+ if self.type not in ("deb", "deb-src"):
+ self.invalid = True
+ return
+ # URI
+ self.uri = string.strip(pieces[1])
+ if len(self.uri) < 1:
+ self.invalid = True
+ # distro and components (optional)
+ # Directory or distro
+ self.dist = string.strip(pieces[2])
+ if len(pieces) > 3:
+ # List of components
+ self.comps = pieces[3:]
+ else:
+ self.comps = []
+
+ #print self.__dict__
+
+
+ # set enabled/disabled
+ def set_enabled(self, new_value):
+ self.disabled = not new_value
+ # enable, remove all "#" from the start of the line
+ if new_value == True:
+ i=0
+ self.line = string.lstrip(self.line)
+ while self.line[i] == "#":
+ i += 1
+ self.line = self.line[i:]
+ else:
+ # disabled, add a "#"
+ if string.strip(self.line)[0] != "#":
+ self.line = "#" + self.line
+
+ def __str__(self):
+ """ debug helper """
+ return self.str().strip()
+
+ def str(self):
+ """ return the current line as string """
+ if self.invalid:
+ return self.line
+ line = ""
+ if self.disabled:
+ line = "# "
+ line += "%s %s %s" % (self.type, self.uri, self.dist)
+ if len(self.comps) > 0:
+ line += " " + " ".join(self.comps)
+ if self.comment != "":
+ line += " #"+self.comment
+ line += "\n"
+ return line
+
+# the SourceList file as a class
+class SourcesList:
+ def __init__(self, withMatcher=True):
+ self.list = [] # of Type SourceEntries
+ if withMatcher:
+ self.matcher = SourceEntryMatcher()
+ self.refresh()
+
+ def refresh(self):
+ self.list = []
+ # read sources.list
+ dir = apt_pkg.Config.FindDir("Dir::Etc")
+ file = apt_pkg.Config.Find("Dir::Etc::sourcelist")
+ self.load(dir+file)
+ # read sources.list.d
+ partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts")
+ for file in glob.glob("%s/*.list" % partsdir):
+ self.load(file)
+ # check if the source item fits a predefined template
+ for source in self.list:
+ if source.invalid == False:
+ self.matcher.match(source)
+
+ def __iter__(self):
+ for entry in self.list:
+ yield entry
+ raise StopIteration
+
+ def add(self, type, uri, dist, comps, comment="", pos=-1, file=None):
+ """
+ Add a new source to the sources.list.
+ The method will search for existing matching repos and will try to
+ reuse them as far as possible
+ """
+ for source in self.list:
+ # if there is a repo with the same (type, uri, dist) just add the
+ # components
+ if source.disabled == False and source.invalid == False and \
+ source.type == type and uri == source.uri and \
+ source.dist == dist:
+ comps = uniq(source.comps + comps)
+ source.comps = comps
+ return source
+ # if there is a corresponding repo which is disabled, enable it
+ elif source.disabled == True and source.invalid == False and \
+ source.type == type and uri == source.uri and \
+ source.dist == dist and \
+ len(set(source.comps) & set(comps)) == len(comps):
+ source.disabled = False
+ return source
+ # there isn't any matching source, so create a new line and parse it
+ line = "%s %s %s" % (type,uri,dist)
+ for c in comps:
+ line = line + " " + c;
+ if comment != "":
+ line = "%s #%s\n" %(line,comment)
+ line = line + "\n"
+ new_entry = SourceEntry(line)
+ if file != None:
+ new_entry.file = file
+ self.matcher.match(new_entry)
+ self.list.insert(pos, new_entry)
+ return new_entry
+
+ def remove(self, source_entry):
+ self.list.remove(source_entry)
+
+ def restoreBackup(self, backup_ext):
+ " restore sources.list files based on the backup extension "
+ dir = apt_pkg.Config.FindDir("Dir::Etc")
+ file = apt_pkg.Config.Find("Dir::Etc::sourcelist")
+ if os.path.exists(dir+file+backup_ext):
+ shutil.copy(dir+file+backup_ext,dir+file)
+ # now sources.list.d
+ partsdir = apt_pkg.Config.FindDir("Dir::Etc::sourceparts")
+ for file in glob.glob("%s/*.list" % partsdir):
+ if os.path.exists(file+backup_ext):
+ shutil.copy(file+backup_ext,file)
+
+ def backup(self, backup_ext=None):
+ """ make a backup of the current source files, if no backup extension
+ is given, the current date/time is used (and returned) """
+ already_backuped = set()
+ if backup_ext == None:
+ backup_ext = time.strftime("%y%m%d.%H%M")
+ for source in self.list:
+ if not source.file in already_backuped:
+ shutil.copy(source.file,"%s%s" % (source.file,backup_ext))
+ return backup_ext
+
+ def load(self,file):
+ """ (re)load the current sources """
+ try:
+ f = open(file, "r")
+ lines = f.readlines()
+ for line in lines:
+ source = SourceEntry(line,file)
+ self.list.append(source)
+ except:
+ print "could not open file '%s'" % file
+ else:
+ f.close()
+
+ def save(self):
+ """ save the current sources """
+ files = {}
+ for source in self.list:
+ if not files.has_key(source.file):
+ files[source.file]=open(source.file,"w")
+ files[source.file].write(source.str())
+ for f in files:
+ files[f].close()
+
+ def check_for_relations(self, sources_list):
+ """get all parent and child channels in the sources list"""
+ parents = []
+ used_child_templates = {}
+ for source in sources_list:
+ # try to avoid checking uninterressting sources
+ if source.template == None:
+ continue
+ # set up a dict with all used child templates and corresponding
+ # source entries
+ if source.template.child == True:
+ key = source.template
+ if not used_child_templates.has_key(key):
+ used_child_templates[key] = []
+ temp = used_child_templates[key]
+ temp.append(source)
+ else:
+ # store each source with children aka. a parent :)
+ if len(source.template.children) > 0:
+ parents.append(source)
+ #print self.used_child_templates
+ #print self.parents
+ return (parents, used_child_templates)
+
+# templates for the add dialog
+class SourceEntryTemplate(SourceEntry):
+ def __init__(self,a_type,uri,dist,description,comps):
+ self.comps_descriptions = []
+ self.type = a_type
+ self.uri = uri
+ self.dist = dist
+ self.description = description
+ self.comps = comps
+
+ def matches(self,source_entry):
+ """ check if a given source_entry matches this one """
+ if (self.type != source_entry.type):
+ return False
+ if (self.dist != source_entry.dist):
+ return False
+ if not is_mirror(self.uri,source_entry.uri):
+ return False
+ for e_comp in source_entry.comps:
+ for t_comp in self.comps:
+ if e_comp == t_comp.name: break
+ else:
+ return False
+ return True
+
+class SourceCompTemplate:
+ def __init__(self, name, description, on_by_default):
+ self.name = name
+ self.description = description
+ self.on_by_default = on_by_default
+
+class SourceEntryTemplates:
+ def __init__(self,datadir):
+ _ = gettext.gettext
+ self.templates = []
+
+ dinfo = DistInfo (base_dir=datadir+"channels/")
+
+ for suite in dinfo.suites:
+ comps = []
+ for comp in suite.components:
+ comps.append(SourceCompTemplate(comp.name, _(comp.description),
+ comp.enabled))
+ self.templates.append (SourceEntryTemplate(suite.repository_type,
+ suite.base_uri,
+ suite.name,
+ suite.description,
+ comps))
+
+# matcher class to make a source entry look nice
+# lots of predefined matchers to make it i18n/gettext friendly
+class SourceEntryMatcher:
+ class MatchType:
+ def __init__(self, a_type,a_descr):
+ self.type = a_type
+ self.description = a_descr
+
+ class MatchDist:
+ def __init__(self,a_uri,a_dist, a_descr,l_comps, l_comps_descr):
+ self.uri = a_uri
+ self.dist = a_dist
+ self.description = a_descr
+ self.comps = l_comps
+ self.comps_descriptions = l_comps_descr
+
+ def __init__(self):
+ self.templates = []
+ # Get the human readable channel and comp names from the channel .infos
+ spec_files = glob.glob("/usr/share/update-manager/channels/*.info")
+ for f in spec_files:
+ f = os.path.basename(f)
+ i = f.find(".info")
+ f = f[0:i]
+ dist = DistInfo(f)
+ for suite in dist.suites:
+ if suite.match_uri != None:
+ self.templates.append(suite)
+ return
+
+ def match(self, source):
+ """Add a matching template to the source"""
+ _ = gettext.gettext
+ found = False
+ for template in self.templates:
+ #print "'%s'" %source.uri
+ if re.search(template.match_uri, source.uri) and \
+ re.match(template.match_name, source.dist):
+ found = True
+ source.template = template
+ break
+ return found
+
+class Distribution:
+ def __init__(self):
+ """"
+ Container for distribution specific informations
+ """
+ # LSB information
+ self.id = ""
+ self.codename = ""
+ self.description = ""
+ self.release = ""
+
+ # get the LSB information
+ lsb_info = []
+ for lsb_option in ["-i", "-c", "-d", "-r"]:
+ pipe = os.popen("lsb_release %s | cut -d : -f 2-" % lsb_option)
+ lsb_info.append(pipe.read().strip())
+ del pipe
+ (self.id, self.codename, self.description, self.release) = lsb_info
+
+ # get a list of country codes and real names
+ self.countries = {}
+ try:
+ f = open("/usr/share/iso-codes/iso_3166.tab", "r")
+ lines = f.readlines()
+ for line in lines:
+ parts = line.split("\t")
+ self.countries[parts[0].lower()] = parts[1]
+ except:
+ print "could not open file '%s'" % file
+ else:
+ f.close()
+
+ def get_sources(self, sources_list):
+ """
+ Find the corresponding template, main and child sources
+ for the distribution
+ """
+ # corresponding sources
+ self.source_template = None
+ self.child_sources = []
+ self.main_sources = []
+ self.disabled_sources = []
+ self.cdrom_sources = []
+ self.download_comps = []
+ self.enabled_comps = []
+ self.cdrom_comps = []
+ self.used_media = []
+ self.get_source_code = False
+ self.source_code_sources = []
+
+ # location of the sources
+ self.default_server = ""
+ self.main_server = ""
+ self.nearest_server = ""
+ self.used_servers = []
+
+ # find the distro template
+ for template in sources_list.matcher.templates:
+ if template.name == self.codename and\
+ template.distribution == self.id:
+ #print "yeah! found a template for %s" % self.description
+ #print template.description, template.base_uri, template.components
+ self.source_template = template
+ 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
+ media = []
+ comps = []
+ cdrom_comps = []
+ enabled_comps = []
+ source_code = []
+ for source in sources_list.list:
+ if source.invalid == False and\
+ source.dist == self.codename and\
+ source.template and\
+ source.template.name == self.codename:
+ #print "yeah! found a distro repo: %s" % source.line
+ # cdroms need do be handled differently
+ if source.uri.startswith("cdrom:") and \
+ source.disabled == False:
+ self.cdrom_sources.append(source)
+ cdrom_comps.extend(source.comps)
+ elif source.uri.startswith("cdrom:") and \
+ source.disabled == True:
+ self.cdrom_sources.append(source)
+ elif source.type == "deb" and source.disabled == False:
+ self.main_sources.append(source)
+ comps.extend(source.comps)
+ media.append(source.uri)
+ elif source.type == "deb" and source.disabled == True:
+ self.disabled_sources.append(source)
+ elif source.type.endswith("-src") and source.disabled == False:
+ self.source_code_sources.append(source)
+ elif source.type.endswith("-src") and source.disabled == True:
+ self.disabled_sources.append(source)
+ if source.template in self.source_template.children:
+ #print "yeah! child found: %s" % source.template.name
+ if source.type == "deb":
+ self.child_sources.append(source)
+ elif source.type == "deb-src":
+ self.source_code_sources.append(source)
+ self.download_comps = set(comps)
+ self.cdrom_comps = set(cdrom_comps)
+ enabled_comps.extend(comps)
+ enabled_comps.extend(cdrom_comps)
+ self.enabled_comps = set(enabled_comps)
+ self.used_media = set(media)
+
+ self.get_mirrors()
+
+ def get_mirrors(self):
+ """
+ Provide a set of mirrors where you can get the distribution from
+ """
+ # the main server is stored in the template
+ self.main_server = self.source_template.base_uri
+
+ # try to guess the nearest mirror from the locale
+ # FIXME: for debian we need something different
+ if self.id == "Ubuntu":
+ locale = os.getenv("LANG", default="en.UK")
+ a = locale.find("_")
+ z = locale.find(".")
+ if z == -1:
+ z = len(locale)
+ country_code = locale[a+1:z].lower()
+ self.nearest_server = "http://%s.archive.ubuntu.com/ubuntu/" % \
+ country_code
+ if self.countries.has_key(country_code):
+ self.country = self.countries[country_code]
+ else:
+ self.country = None
+
+ # other used servers
+ for medium in self.used_media:
+ if not medium.startswith("cdrom:"):
+ # seems to be a network source
+ self.used_servers.append(medium)
+
+ if len(self.main_sources) == 0:
+ self.default_server = self.main_server
+ else:
+ self.default_server = self.main_sources[0].uri
+
+ def add_source(self, sources_list, type=None,
+ uri=None, dist=None, comps=None, comment=""):
+ """
+ Add distribution specific sources
+ """
+ if uri == None:
+ # FIXME: Add support for the server selector
+ uri = self.default_server
+ if dist == None:
+ dist = self.codename
+ if comps == None:
+ comps = list(self.enabled_comps)
+ if type == None:
+ type = "deb"
+ if comment == "":
+ comment == "Added by software-properties"
+ new_source = sources_list.add(type, uri, dist, comps, comment)
+ # if source code is enabled add a deb-src line after the new
+ # source
+ if self.get_source_code == True and not type.endswith("-src"):
+ sources_list.add("%s-src" % type, uri, dist, comps, comment,
+ file=new_source.file,
+ pos=sources_list.list.index(new_source)+1)
+
+ def enable_component(self, sourceslist, comp):
+ """
+ Disable a component in all main, child and source code sources
+ (excluding cdrom based sources)
+
+ sourceslist: an aptsource.sources_list
+ comp: the component that should be enabled
+ """
+ sources = []
+ sources.extend(self.main_sources)
+ sources.extend(self.child_sources)
+ sources.extend(self.source_code_sources)
+ # check if there is a main source at all
+ if len(self.main_sources) < 1:
+ # create a new main source
+ self.add_source(sourceslist, comps=["%s"%comp])
+ else:
+ # add the comp to all main, child and source code sources
+ for source in sources:
+ if comp not in source.comps:
+ source.comps.append(comp)
+ if self.get_source_code == True:
+ for source in self.source_code_sources:
+ if comp not in source.comps: source.comps.append(comp)
+
+ def disable_component(self, sourceslist, comp):
+ """
+ Disable a component in all main, child and source code sources
+ (excluding cdrom based sources)
+ """
+ sources = []
+ sources.extend(self.main_sources)
+ sources.extend(self.child_sources)
+ sources.extend(self.source_code_sources)
+ if comp in self.cdrom_comps:
+ sources = []
+ sources.extend(self.main_sources)
+
+ for source in sources:
+ if comp in source.comps:
+ source.comps.remove(comp)
+ if len(source.comps) < 1:
+ sourceslist.remove(source)
+
+
+# some simple tests
+if __name__ == "__main__":
+ apt_pkg.InitConfig()
+ sources = SourcesList()
+
+ for entry in sources:
+ print entry.str()
+ #print entry.uri
+
+ mirror = is_mirror("http://archive.ubuntu.com/ubuntu/",
+ "http://de.archive.ubuntu.com/ubuntu/")
+ print "is_mirror(): %s" % mirror
+
+ print is_mirror("http://archive.ubuntu.com/ubuntu",
+ "http://de.archive.ubuntu.com/ubuntu/")
diff --git a/po/ar.po b/po/ar.po
index cbcf3459..b25550fa 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:46+0000\n"
"Last-Translator: Jadmadi \n"
"Language-Team: Arabic \n"
diff --git a/po/bg.po b/po/bg.po
index 83cf9797..de6df323 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:40+0000\n"
"Last-Translator: Nikola Kasabov \n"
"Language-Team: Bulgarian \n"
diff --git a/po/bn.po b/po/bn.po
index 199defa6..dcd7a2fb 100644
--- a/po/bn.po
+++ b/po/bn.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-26 12:09+0000\n"
"Last-Translator: Khandakar Mujahidul Islam \n"
"Language-Team: Bengali \n"
diff --git a/po/br.po b/po/br.po
index d68c230c..784f625b 100644
--- a/po/br.po
+++ b/po/br.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-19 02:42+0000\n"
"Last-Translator: Oublieuse \n"
"Language-Team: Breton
\n"
diff --git a/po/ca.po b/po/ca.po
index f2987b80..6da4ed56 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-29 21:18+0000\n"
"Last-Translator: Jordi Irazuzta \n"
"Language-Team: Catalan \n"
diff --git a/po/cs.po b/po/cs.po
index 73071fc3..9387e60b 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-25 18:52+0000\n"
"Last-Translator: Tomáš Hála \n"
"Language-Team: Czech \n"
diff --git a/po/da.po b/po/da.po
index aed71b7e..8d2981b1 100644
--- a/po/da.po
+++ b/po/da.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:41+0000\n"
"Last-Translator: Mathias-K \n"
"Language-Team: Danish \n"
diff --git a/po/de.po b/po/de.po
index 51276339..412385d2 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-27 10:58+0000\n"
"Last-Translator: Sebastian Heinlein \n"
"Language-Team: German GNOME Translations \n"
diff --git a/po/el.po b/po/el.po
index 253457db..df431e8b 100644
--- a/po/el.po
+++ b/po/el.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: el\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-25 15:39+0000\n"
"Last-Translator: Kostas Papadimas \n"
"Language-Team: Greek \n"
diff --git a/po/en_AU.po b/po/en_AU.po
index 0cfccae4..983a7e36 100644
--- a/po/en_AU.po
+++ b/po/en_AU.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-26 21:06+0000\n"
"Last-Translator: David Symons \n"
"Language-Team: English (Australia) \n"
diff --git a/po/en_CA.po b/po/en_CA.po
index 6f6246f2..ea0eb274 100644
--- a/po/en_CA.po
+++ b/po/en_CA.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:41+0000\n"
"Last-Translator: Adam Weinberger \n"
"Language-Team: Canadian English \n"
diff --git a/po/en_GB.po b/po/en_GB.po
index dcea5c7d..42f56e94 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:41+0000\n"
"Last-Translator: Abigail Brady \n"
"Language-Team: \n"
diff --git a/po/es.po b/po/es.po
index 97430b97..8be24196 100644
--- a/po/es.po
+++ b/po/es.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: es\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-26 09:38+0000\n"
"Last-Translator: Ricardo Pérez López \n"
"Language-Team: Spanish \n"
diff --git a/po/fi.po b/po/fi.po
index b01d2588..4fb7509c 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-25 18:26+0000\n"
"Last-Translator: Timo Jyrinki \n"
"Language-Team: Finnish \n"
diff --git a/po/fr.po b/po/fr.po
index 519fef68..d3d1746a 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager 0.37.2\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-26 21:09+0000\n"
"Last-Translator: Claude Paroz \n"
"Language-Team: French \n"
diff --git a/po/fur.po b/po/fur.po
index 3c3aedae..256127d4 100644
--- a/po/fur.po
+++ b/po/fur.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-30 14:37+0000\n"
"Last-Translator: marcuz \n"
"Language-Team: Friulian \n"
diff --git a/po/gl.po b/po/gl.po
index e0da8cea..1370f0da 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gl\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:42+0000\n"
"Last-Translator: Ignacio Casal Quinteiro \n"
"Language-Team: Galego\n"
diff --git a/po/he.po b/po/he.po
index d489f76d..2b3b0c3b 100644
--- a/po/he.po
+++ b/po/he.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager.HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-30 11:15+0000\n"
"Last-Translator: Yaniv Abir \n"
"Language-Team: Hebrew \n"
diff --git a/po/hi.po b/po/hi.po
index 8d75639f..d0862c24 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:46+0000\n"
"Last-Translator: Rosetta Administrators \n"
"Language-Team: Hindi \n"
diff --git a/po/hr.po b/po/hr.po
index 6082643e..85aa2a13 100644
--- a/po/hr.po
+++ b/po/hr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 20:54+0000\n"
"Last-Translator: Ante Karamatić \n"
"Language-Team: Croatian
\n"
diff --git a/po/hu.po b/po/hu.po
index fa0ec160..a124cc27 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager.HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-28 21:22+0000\n"
"Last-Translator: Gabor Kelemen \n"
"Language-Team: Hungarian \n"
diff --git a/po/id.po b/po/id.po
index c15dbb90..6f8f1983 100644
--- a/po/id.po
+++ b/po/id.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-28 18:46+0000\n"
"Last-Translator: Andy Apdhani \n"
"Language-Team: Indonesian \n"
diff --git a/po/it.po b/po/it.po
index b5004cf1..f61c58f9 100644
--- a/po/it.po
+++ b/po/it.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 14:01+0000\n"
"Last-Translator: Luca Ferretti \n"
"Language-Team: Italian \n"
diff --git a/po/ja.po b/po/ja.po
index 7eca8a7a..448e8696 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager 0.42.4\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 07:06+0000\n"
"Last-Translator: Ikuya Awashiro \n"
"Language-Team: Ubuntu Japanese Team \n"
diff --git a/po/ka.po b/po/ka.po
index 47e5af28..0e776ab9 100644
--- a/po/ka.po
+++ b/po/ka.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:19+0000\n"
"Last-Translator: Vladimer Sichinava \n"
"Language-Team: Georgian \n"
diff --git a/po/ko.po b/po/ko.po
index e2e9df5c..227b519f 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-28 15:14+0000\n"
"Last-Translator: darehanl \n"
"Language-Team: Korean \n"
diff --git a/po/ku.po b/po/ku.po
index 0bd54299..42644134 100644
--- a/po/ku.po
+++ b/po/ku.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:43+0000\n"
"Last-Translator: Erdal Ronahi \n"
"Language-Team: Kurdish \n"
diff --git a/po/lt.po b/po/lt.po
index 5bd29c07..0e5df421 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-28 20:07+0000\n"
"Last-Translator: Mantas Kriaučiūnas \n"
"Language-Team: Lithuanian \n"
diff --git a/po/mk.po b/po/mk.po
index b98bde16..3ca8f9bb 100644
--- a/po/mk.po
+++ b/po/mk.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: mk\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:43+0000\n"
"Last-Translator: Арангел Ангов \n"
"Language-Team: Macedonian \n"
diff --git a/po/ms.po b/po/ms.po
index 7510b364..baba9a1a 100644
--- a/po/ms.po
+++ b/po/ms.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-30 13:49+0000\n"
"Last-Translator: azlinux \n"
"Language-Team: Malay \n"
diff --git a/po/nb.po b/po/nb.po
index d4ce9cdf..0edbc0c9 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: nb\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-29 13:06+0000\n"
"Last-Translator: Hans Petter Birkeland \n"
"Language-Team: Norwegian Bokmal \n"
diff --git a/po/ne.po b/po/ne.po
index 92d0bfd2..cbef83ef 100644
--- a/po/ne.po
+++ b/po/ne.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager.HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:43+0000\n"
"Last-Translator: Jaydeep Bhusal \n"
"Language-Team: Nepali \n"
diff --git a/po/nl.po b/po/nl.po
index e99d3fb7..9efe0175 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 01:32+0000\n"
"Last-Translator: Tino Meinen \n"
"Language-Team: Nederlands \n"
diff --git a/po/no.po b/po/no.po
index 45e77058..1b04ca84 100644
--- a/po/no.po
+++ b/po/no.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: nb\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2005-06-08 23:10+0200\n"
"Last-Translator: Terance Edward Sola \n"
"Language-Team: Norwegian Bokmal \n"
diff --git a/po/oc.po b/po/oc.po
index c5f21fd3..a2209808 100644
--- a/po/oc.po
+++ b/po/oc.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-29 08:11+0000\n"
"Last-Translator: Yannig MARCHEGAY (Kokoyaya) \n"
diff --git a/po/pa.po b/po/pa.po
index 45b445c9..3e5fd974 100644
--- a/po/pa.po
+++ b/po/pa.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pa\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-04-28 23:31+0000\n"
"Last-Translator: Amanpreet Singh Alam \n"
"Language-Team: Punjabi \n"
diff --git a/po/pl.po b/po/pl.po
index b3a03e01..b37d0d39 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager cvs\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:59+0000\n"
"Last-Translator: Tomasz Dominikowski \n"
"Language-Team: Polish \n"
diff --git a/po/pt.po b/po/pt.po
index 2144bab4..1e9fe9db 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 10:17+0000\n"
"Last-Translator: Joao Carvalhinho \n"
"Language-Team: Ubuntu Portuguese Team \n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 3ab912a9..cb3c8c2c 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-26 22:31+0000\n"
"Last-Translator: KurtKraut \n"
"Language-Team: Ubuntu-BR \n"
diff --git a/po/ro.po b/po/ro.po
index 1e0d1589..e73adf0f 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 17:39+0000\n"
"Last-Translator: Sami POTIRCA \n"
"Language-Team: Romanian \n"
diff --git a/po/ru.po b/po/ru.po
index e873db5a..c14af2cf 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-25 19:23+0000\n"
"Last-Translator: Igor Zubarev \n"
"Language-Team: Russian \n"
diff --git a/po/rw.po b/po/rw.po
index 931052ca..abba200e 100644
--- a/po/rw.po
+++ b/po/rw.po
@@ -15,7 +15,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:44+0000\n"
"Last-Translator: Steve Murphy \n"
"Language-Team: Kinyarwanda \n"
diff --git a/po/sk.po b/po/sk.po
index acb12569..974215ac 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 17:32+0000\n"
"Last-Translator: Peter Chabada \n"
"Language-Team: Slovak \n"
diff --git a/po/sr.po b/po/sr.po
index f6e75a7b..7a432396 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-27 12:27+0000\n"
"Last-Translator: Dejan Milosavljevic \n"
"Language-Team: Serbian \n"
diff --git a/po/sv.po b/po/sv.po
index 6c187227..03fe3e20 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:18+0000\n"
"Last-Translator: Robin Sonefors \n"
"Language-Team: Swedish \n"
diff --git a/po/th.po b/po/th.po
index 9cf2d41a..d42d3b0f 100644
--- a/po/th.po
+++ b/po/th.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-24 16:44+0000\n"
"Last-Translator: Roys Hengwatanakul \n"
"Language-Team: Thai \n"
diff --git a/po/tr.po b/po/tr.po
index 8ffe6754..e8018237 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:45+0000\n"
"Last-Translator: Özgur KIRCALI \n"
"Language-Team: Turkish \n"
diff --git a/po/uk.po b/po/uk.po
index f996843e..322af381 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:45+0000\n"
"Last-Translator: Serhey Kusyumoff \n"
"Language-Team: Ukrainian \n"
diff --git a/po/update-manager.pot b/po/update-manager.pot
index f2e00f38..897a7804 100644
--- a/po/update-manager.pot
+++ b/po/update-manager.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
diff --git a/po/ur.po b/po/ur.po
index 18ebec55..3464b679 100644
--- a/po/ur.po
+++ b/po/ur.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-19 02:46+0000\n"
"Last-Translator: Hameed محمد حمید \n"
"Language-Team: Urdu \n"
diff --git a/po/urd.po b/po/urd.po
index 27d954c5..18e68cec 100644
--- a/po/urd.po
+++ b/po/urd.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-07 01:53+0000\n"
"Last-Translator: Hameed محمد حمید \n"
"Language-Team: Urdu \n"
diff --git a/po/vi.po b/po/vi.po
index 025b54ed..c03e91e0 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager Gnome HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:45+0000\n"
"Last-Translator: Tran The Trung \n"
"Language-Team: Vietnamese \n"
diff --git a/po/xh.po b/po/xh.po
index 86d1c4df..e519731a 100644
--- a/po/xh.po
+++ b/po/xh.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-notifier\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-04-20 19:15+0000\n"
"Last-Translator: Canonical Ltd \n"
"Language-Team: Xhosa \n"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 9f78ebe5..d9e7edab 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager HEAD\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-30 14:16+0000\n"
"Last-Translator: catinsnow \n"
"Language-Team: zh_CN \n"
diff --git a/po/zh_HK.po b/po/zh_HK.po
index 4322ad56..b89955ac 100644
--- a/po/zh_HK.po
+++ b/po/zh_HK.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager 0.41.1\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-23 19:45+0000\n"
"Last-Translator: Abel Cheung \n"
"Language-Team: Chinese (traditional) \n"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 0400bb12..5d0bb9d7 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: update-manager 0.41.1\n"
"Report-Msgid-Bugs-To: sebastian.heinlein@web.de\n"
-"POT-Creation-Date: 2006-07-31 18:12+0200\n"
+"POT-Creation-Date: 2006-07-31 21:12+0200\n"
"PO-Revision-Date: 2006-05-31 12:00+0000\n"
"Last-Translator: PCMan \n"
"Language-Team: Chinese (Taiwan) \n"
diff --git a/software-properties b/software-properties
index 6c38d073..129c3085 100644
--- a/software-properties
+++ b/software-properties
@@ -34,7 +34,7 @@ import sys
from optparse import OptionParser
-import SoftwareProperties.aptsources as aptsources
+import UpdateManager.Common.aptsources as aptsources
#sys.path.append("@prefix@/share/update-manager/python")
--
cgit v1.2.3
|