diff options
author | René 'Necoro' Neumann <necoro@necoro.net> | 2008-04-09 01:22:15 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.net> | 2008-04-09 01:22:15 +0200 |
commit | 1d2d44b9162a9bcddc1a3b642c6f5038095b72c8 (patch) | |
tree | 178ad6b7794ae2d7c5520be298c0e3b7cfa68659 | |
parent | acf2acc79558471ff909e9edb11b0bef5e95f25c (diff) | |
download | portato-1d2d44b9162a9bcddc1a3b642c6f5038095b72c8.tar.gz portato-1d2d44b9162a9bcddc1a3b642c6f5038095b72c8.tar.bz2 portato-1d2d44b9162a9bcddc1a3b642c6f5038095b72c8.zip |
Do something useful if an assertionerror is thrown during dep-resolution
Diffstat (limited to '')
-rw-r--r-- | i18n/de.po | 96 | ||||
-rw-r--r-- | i18n/messages.pot | 86 | ||||
-rw-r--r-- | portato/backend/package.py | 8 | ||||
-rw-r--r-- | portato/dependency.py | 5 | ||||
-rw-r--r-- | portato/gui/windows/main.py | 16 |
5 files changed, 114 insertions, 97 deletions
@@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Portato\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2008-04-07 20:07+0100\n" +"PO-Revision-Date: 2008-04-09 01:21+0100\n" "Last-Translator: René 'Necoro' Neumann <necoro@necoro.net>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -275,7 +275,7 @@ msgstr "Speichere _Flags" #: portato/gui/templates/MainWindow.glade:221 #: portato/gui/templates/MainWindow.glade:1167 -#: portato/gui/windows/main.py:846 +#: portato/gui/windows/main.py:852 msgid "Queue" msgstr "Queue" @@ -285,8 +285,8 @@ msgstr "Oneshot" #: portato/gui/templates/MainWindow.glade:240 #: portato/gui/templates/MainWindow.glade:1192 -#: portato/gui/windows/main.py:1159 -#: portato/gui/windows/main.py:1161 +#: portato/gui/windows/main.py:1165 +#: portato/gui/windows/main.py:1167 msgid "Console" msgstr "Konsole" @@ -338,26 +338,26 @@ msgid "<b>Use Flags:</b>" msgstr "<b>Use Flags:</b>" #: portato/gui/templates/MainWindow.glade:656 -#: portato/gui/windows/main.py:518 -#: portato/gui/windows/main.py:521 -#: portato/gui/windows/main.py:581 -#: portato/gui/windows/main.py:585 +#: portato/gui/windows/main.py:524 +#: portato/gui/windows/main.py:527 +#: portato/gui/windows/main.py:587 +#: portato/gui/windows/main.py:591 msgid "Testing" msgstr "Testing" #: portato/gui/templates/MainWindow.glade:689 -#: portato/gui/windows/main.py:501 -#: portato/gui/windows/main.py:504 #: portato/gui/windows/main.py:507 -#: portato/gui/windows/main.py:608 -#: portato/gui/windows/main.py:612 -#: portato/gui/windows/main.py:619 -#: portato/gui/windows/main.py:623 +#: portato/gui/windows/main.py:510 +#: portato/gui/windows/main.py:513 +#: portato/gui/windows/main.py:614 +#: portato/gui/windows/main.py:618 +#: portato/gui/windows/main.py:625 +#: portato/gui/windows/main.py:629 msgid "Masked" msgstr "Masked" #: portato/gui/templates/MainWindow.glade:708 -#: portato/gui/windows/main.py:338 +#: portato/gui/windows/main.py:344 msgid "Installed" msgstr "Installiert" @@ -371,7 +371,7 @@ msgstr "<b>Overlay:</b>" #: portato/gui/templates/MainWindow.glade:792 msgid "<b>Description:</b>" -msgstr "<b>Beschreibung</b>" +msgstr "<b>Beschreibung:</b>" #: portato/gui/templates/MainWindow.glade:824 msgid "<span foreground='red'><b>MISSING KEYWORD</b></span>" @@ -605,7 +605,7 @@ msgid "Do you really want to clear the whole queue?" msgstr "Wirklich die gesamte Queue löschen?" #: portato/gui/windows/update.py:47 -#: portato/gui/windows/main.py:337 +#: portato/gui/windows/main.py:343 #: portato/gui/windows/plugin.py:24 msgid "Enabled" msgstr "Aktiviert" @@ -631,111 +631,115 @@ msgstr "Der erste Teil der Homepage startet nicht mit 'http' oder 'ftp'." msgid "Blank inside homepage." msgstr "Leerzeichen innerhalb der Homepage-URL." -#: portato/gui/windows/main.py:244 +#: portato/gui/windows/main.py:243 #, python-format msgid "If '%s' is disabled" msgstr "Wenn '%s' deaktiviert ist" -#: portato/gui/windows/main.py:246 +#: portato/gui/windows/main.py:245 #, python-format msgid "If '%s' is enabled" msgstr "Wenn '%s' aktiviert ist" -#: portato/gui/windows/main.py:254 +#: portato/gui/windows/main.py:253 msgid "One of the following" msgstr "Eins der folgenden" -#: portato/gui/windows/main.py:258 +#: portato/gui/windows/main.py:257 msgid "All of the following" msgstr "Alle folgenden" -#: portato/gui/windows/main.py:298 +#: portato/gui/windows/main.py:280 +msgid "Can't display dependencies: This package has an unsupported dependency string." +msgstr "Kann Abhängigkeiten nicht anzeigen: Format der Abhängigkeiten des Pakets wird nicht unterstützt." + +#: portato/gui/windows/main.py:304 msgid "This is an expanded use flag and cannot be selected" msgstr "Dies ist ein \"Expanded Use Flag\" und kann daher nicht ausgewählt werden." -#: portato/gui/windows/main.py:339 +#: portato/gui/windows/main.py:345 msgid "Flag" msgstr "Flag" -#: portato/gui/windows/main.py:340 +#: portato/gui/windows/main.py:346 msgid "Description" msgstr "Beschreibung" -#: portato/gui/windows/main.py:351 +#: portato/gui/windows/main.py:357 msgid "Versions" msgstr "Versionen" -#: portato/gui/windows/main.py:354 +#: portato/gui/windows/main.py:360 msgid "Slot" msgstr "Slot" -#: portato/gui/windows/main.py:448 +#: portato/gui/windows/main.py:454 #, python-format msgid "Package could not be found: %s" msgstr "Paket konnte nicht gefunden werden: %s" -#: portato/gui/windows/main.py:510 -#: portato/gui/windows/main.py:610 +#: portato/gui/windows/main.py:516 +#: portato/gui/windows/main.py:616 msgid "Masked by user" msgstr "Vom Benutzer maskiert" -#: portato/gui/windows/main.py:693 +#: portato/gui/windows/main.py:699 msgid "Loading Config" msgstr "Lade Konfiguration" -#: portato/gui/windows/main.py:705 +#: portato/gui/windows/main.py:711 msgid "Creating Database" msgstr "Erstelle Datenbank" -#: portato/gui/windows/main.py:710 +#: portato/gui/windows/main.py:716 msgid "Loading Plugins" msgstr "Lade Plugins" -#: portato/gui/windows/main.py:723 +#: portato/gui/windows/main.py:729 msgid "Building frontend" msgstr "Erstelle Oberfläche" -#: portato/gui/windows/main.py:766 +#: portato/gui/windows/main.py:772 #: portato/gui/views.py:115 #, python-format msgid "Error: %s" msgstr "Fehler: %s" -#: portato/gui/windows/main.py:805 +#: portato/gui/windows/main.py:811 msgid "Restoring Session" msgstr "Lade Session" -#: portato/gui/windows/main.py:814 +#: portato/gui/windows/main.py:820 msgid "Finishing startup" msgstr "Erledige letzte Handgriffe :)" -#: portato/gui/windows/main.py:849 +#: portato/gui/windows/main.py:855 msgid "Options" msgstr "Optionen" -#: portato/gui/windows/main.py:861 +#: portato/gui/windows/main.py:867 msgid "Categories" msgstr "Kategorien" -#: portato/gui/windows/main.py:897 +#: portato/gui/windows/main.py:903 msgid "Packages" msgstr "Pakete" -#: portato/gui/windows/main.py:965 +#: portato/gui/windows/main.py:971 #, python-format msgid "Translating session from version %d to %d." msgstr "Upgrade Session von Version %d auf Version %d." -#: portato/gui/windows/main.py:968 +#: portato/gui/windows/main.py:974 #, python-format msgid "Cannot translate session from version %d to %d." msgstr "Kann Session nicht von Version %d nach %d upgraden." -#: portato/gui/windows/main.py:1290 +#: portato/gui/windows/main.py:1296 msgid "use flags" msgstr "Use Flags" -#: portato/gui/windows/main.py:1301 +#: portato/gui/windows/main.py:1307 msgid "masking keywords" msgstr "Masking Keywords" @@ -800,16 +804,16 @@ msgstr "Das aktuelle Sessionformat ist zu alt." msgid "Current session format is newer than this version supports." msgstr "Das aktuelle Sessionformat ist neuer, als diese Portato-Version unterstützt." -#: portato/gui/utils.py:116 +#: portato/gui/utils.py:135 msgid "ALL" msgstr "ALLE" -#: portato/gui/utils.py:192 +#: portato/gui/utils.py:222 #, python-format msgid "Catched KeyError => %s seems not to be an available category. Have you played with rsync-excludes?" msgstr "Catched KeyError => %s scheint keine valide Kategorie zu sein. Hast du mit rsync-excludes gespielt?" -#: portato/gui/utils.py:248 +#: portato/gui/utils.py:283 #, python-format msgid "Error while compiling search expression: '%s'." msgstr "Fehler beim erstellen des Suchausdrucks: '%s'." diff --git a/i18n/messages.pot b/i18n/messages.pot index 3fd1c01..0bf4561 100644 --- a/i18n/messages.pot +++ b/i18n/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-04-07 20:05+0200\n" +"POT-Creation-Date: 2008-04-09 00:53+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -271,7 +271,7 @@ msgid "Save _Flags" msgstr "" #: portato/gui/templates/MainWindow.glade:221 -#: portato/gui/templates/MainWindow.glade:1167 portato/gui/windows/main.py:846 +#: portato/gui/templates/MainWindow.glade:1167 portato/gui/windows/main.py:852 msgid "Queue" msgstr "" @@ -281,7 +281,7 @@ msgstr "" #: portato/gui/templates/MainWindow.glade:240 #: portato/gui/templates/MainWindow.glade:1192 -#: portato/gui/windows/main.py:1159 portato/gui/windows/main.py:1161 +#: portato/gui/windows/main.py:1165 portato/gui/windows/main.py:1167 msgid "Console" msgstr "" @@ -332,20 +332,20 @@ msgstr "" msgid "<b>Use Flags:</b>" msgstr "" -#: portato/gui/templates/MainWindow.glade:656 portato/gui/windows/main.py:518 -#: portato/gui/windows/main.py:521 portato/gui/windows/main.py:581 -#: portato/gui/windows/main.py:585 +#: portato/gui/templates/MainWindow.glade:656 portato/gui/windows/main.py:524 +#: portato/gui/windows/main.py:527 portato/gui/windows/main.py:587 +#: portato/gui/windows/main.py:591 msgid "Testing" msgstr "" -#: portato/gui/templates/MainWindow.glade:689 portato/gui/windows/main.py:501 -#: portato/gui/windows/main.py:504 portato/gui/windows/main.py:507 -#: portato/gui/windows/main.py:608 portato/gui/windows/main.py:612 -#: portato/gui/windows/main.py:619 portato/gui/windows/main.py:623 +#: portato/gui/templates/MainWindow.glade:689 portato/gui/windows/main.py:507 +#: portato/gui/windows/main.py:510 portato/gui/windows/main.py:513 +#: portato/gui/windows/main.py:614 portato/gui/windows/main.py:618 +#: portato/gui/windows/main.py:625 portato/gui/windows/main.py:629 msgid "Masked" msgstr "" -#: portato/gui/templates/MainWindow.glade:708 portato/gui/windows/main.py:338 +#: portato/gui/templates/MainWindow.glade:708 portato/gui/windows/main.py:344 msgid "Installed" msgstr "" @@ -587,7 +587,7 @@ msgstr "" msgid "Do you really want to clear the whole queue?" msgstr "" -#: portato/gui/windows/update.py:47 portato/gui/windows/main.py:337 +#: portato/gui/windows/update.py:47 portato/gui/windows/main.py:343 #: portato/gui/windows/plugin.py:24 msgid "Enabled" msgstr "" @@ -613,109 +613,115 @@ msgstr "" msgid "Blank inside homepage." msgstr "" -#: portato/gui/windows/main.py:244 +#: portato/gui/windows/main.py:243 #, python-format msgid "If '%s' is disabled" msgstr "" -#: portato/gui/windows/main.py:246 +#: portato/gui/windows/main.py:245 #, python-format msgid "If '%s' is enabled" msgstr "" -#: portato/gui/windows/main.py:254 +#: portato/gui/windows/main.py:253 msgid "One of the following" msgstr "" -#: portato/gui/windows/main.py:258 +#: portato/gui/windows/main.py:257 msgid "All of the following" msgstr "" -#: portato/gui/windows/main.py:298 +#: portato/gui/windows/main.py:280 +msgid "" +"Can't display dependencies: This package has an unsupported dependency " +"string." +msgstr "" + +#: portato/gui/windows/main.py:304 msgid "This is an expanded use flag and cannot be selected" msgstr "" -#: portato/gui/windows/main.py:339 +#: portato/gui/windows/main.py:345 msgid "Flag" msgstr "" -#: portato/gui/windows/main.py:340 +#: portato/gui/windows/main.py:346 msgid "Description" msgstr "" -#: portato/gui/windows/main.py:351 +#: portato/gui/windows/main.py:357 msgid "Versions" msgstr "" -#: portato/gui/windows/main.py:354 +#: portato/gui/windows/main.py:360 msgid "Slot" msgstr "" -#: portato/gui/windows/main.py:448 +#: portato/gui/windows/main.py:454 #, python-format msgid "Package could not be found: %s" msgstr "" -#: portato/gui/windows/main.py:510 portato/gui/windows/main.py:610 +#: portato/gui/windows/main.py:516 portato/gui/windows/main.py:616 msgid "Masked by user" msgstr "" -#: portato/gui/windows/main.py:693 +#: portato/gui/windows/main.py:699 msgid "Loading Config" msgstr "" -#: portato/gui/windows/main.py:705 +#: portato/gui/windows/main.py:711 msgid "Creating Database" msgstr "" -#: portato/gui/windows/main.py:710 +#: portato/gui/windows/main.py:716 msgid "Loading Plugins" msgstr "" -#: portato/gui/windows/main.py:723 +#: portato/gui/windows/main.py:729 msgid "Building frontend" msgstr "" -#: portato/gui/windows/main.py:766 portato/gui/views.py:115 +#: portato/gui/windows/main.py:772 portato/gui/views.py:115 #, python-format msgid "Error: %s" msgstr "" -#: portato/gui/windows/main.py:805 +#: portato/gui/windows/main.py:811 msgid "Restoring Session" msgstr "" -#: portato/gui/windows/main.py:814 +#: portato/gui/windows/main.py:820 msgid "Finishing startup" msgstr "" -#: portato/gui/windows/main.py:849 +#: portato/gui/windows/main.py:855 msgid "Options" msgstr "" -#: portato/gui/windows/main.py:861 +#: portato/gui/windows/main.py:867 msgid "Categories" msgstr "" -#: portato/gui/windows/main.py:897 +#: portato/gui/windows/main.py:903 msgid "Packages" msgstr "" -#: portato/gui/windows/main.py:965 +#: portato/gui/windows/main.py:971 #, python-format msgid "Translating session from version %d to %d." msgstr "" -#: portato/gui/windows/main.py:968 +#: portato/gui/windows/main.py:974 #, python-format msgid "Cannot translate session from version %d to %d." msgstr "" -#: portato/gui/windows/main.py:1290 +#: portato/gui/windows/main.py:1296 msgid "use flags" msgstr "" -#: portato/gui/windows/main.py:1301 +#: portato/gui/windows/main.py:1307 msgid "masking keywords" msgstr "" @@ -780,18 +786,18 @@ msgstr "" msgid "Current session format is newer than this version supports." msgstr "" -#: portato/gui/utils.py:116 +#: portato/gui/utils.py:135 msgid "ALL" msgstr "" -#: portato/gui/utils.py:192 +#: portato/gui/utils.py:222 #, python-format msgid "" "Catched KeyError => %s seems not to be an available category. Have you " "played with rsync-excludes?" msgstr "" -#: portato/gui/utils.py:248 +#: portato/gui/utils.py:283 #, python-format msgid "Error while compiling search expression: '%s'." msgstr "" diff --git a/portato/backend/package.py b/portato/backend/package.py index 0ac22d3..1e17b1f 100644 --- a/portato/backend/package.py +++ b/portato/backend/package.py @@ -181,21 +181,21 @@ class Package (_Package): tree = DependencyTree() def add (tree, deps): - iter = (x for x in deps) - for dep in iter: + it = iter(deps) + for dep in it: if hasattr(dep, "__iter__"): debug("Following dep is an unsupposed list: %s", dep) assert(len(dep) == 1) dep = dep[0] if dep.endswith("?"): ntree = tree.add_flag(dep[:-1]) - n = iter.next() + n = it.next() if not hasattr(n, "__iter__"): n = (n,) add(ntree, n) elif dep == "||": - n = iter.next() # skip + n = it.next() # skip if not hasattr(n, "__iter__"): n = [n] else: diff --git a/portato/dependency.py b/portato/dependency.py index cefc6ad..cce7360 100644 --- a/portato/dependency.py +++ b/portato/dependency.py @@ -63,10 +63,10 @@ class Dependency (object): __repr__ = __str__ - def _get_dep (self): + @property + def dep (self): return self._dep - dep = property(_get_dep) satisfied = property(is_satisfied) class OrDependency (Dependency): @@ -92,6 +92,7 @@ class OrDependency (Dependency): _dep = [] for dep in deps: if not hasattr(dep, "__iter__"): + assert not dep.endswith("?") _dep.append(Dependency(dep)) else: _dep.append(AllOfDependency(dep)) diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index cde7461..14a0181 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -193,7 +193,7 @@ class PackageTable: ftexts = [] for count, t in enumerate(texts): - if not t.startswith(("http:", "ftp:")): + if not t.startswith(("http", "ftp")): if count == 0: error(_("The first homepage part does not start with 'http' or 'ftp'.")) ftexts.append(t) @@ -225,9 +225,8 @@ class PackageTable: def fill_dep_list(self): - deptree = self.actual_package().get_dependencies() store = self.depList.get_model() - + def add (tree, it): def get_icon (dep): @@ -274,8 +273,15 @@ class PackageTable: ndeps.sort(key = sort_key) for dep in ndeps: store.append(it, [get_icon(dep), dep.dep]) - - add (deptree, None) + + try: + deptree = self.actual_package().get_dependencies() + except AssertionError: + w = _("Can't display dependencies: This package has an unsupported dependency string.") + error(w) + store.append(None, [None, w]) + else: + add(deptree, None) def fill_use_list(self): |