Merge lp:~mvo/gdebi/click-view-support into lp:gdebi

Proposed by Michael Vogt
Status: Merged
Merged at revision: 460
Proposed branch: lp:~mvo/gdebi/click-view-support
Merge into: lp:gdebi
Diff against target: 45 lines (+17/-2)
2 files modified
GDebi/DebPackage.py (+9/-0)
GDebi/GDebiCommon.py (+8/-2)
To merge this branch: bzr merge lp:~mvo/gdebi/click-view-support
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Review via email: mp+175808@code.launchpad.net

Description of the change

Tiny branch that allows viewing the new "click" format that ubuntu uses, some examples can be found here http://people.canonical.com/~sergiusens/click_packages/

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Looks good. Albeit indeed, very basic support =)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'GDebi/DebPackage.py'
--- GDebi/DebPackage.py 2012-10-12 10:02:16 +0000
+++ GDebi/DebPackage.py 2013-07-19 11:25:32 +0000
@@ -42,3 +42,12 @@
42# just for compatibility42# just for compatibility
43class DscSrcPackage(apt.debfile.DscSrcPackage):43class DscSrcPackage(apt.debfile.DscSrcPackage):
44 pass44 pass
45
46
47class ClickPackage(DebPackage):
48 """Basic support to view the new ubuntu click packages, more to come"""
49
50 def check(self):
51 self._failure_string = _(
52 "Click packages can currently only be inspected with this tool")
53 return False
4554
=== modified file 'GDebi/GDebiCommon.py'
--- GDebi/GDebiCommon.py 2013-03-22 19:58:44 +0000
+++ GDebi/GDebiCommon.py 2013-07-19 11:25:32 +0000
@@ -30,7 +30,10 @@
30import apt_pkg30import apt_pkg
31from apt.cache import Cache31from apt.cache import Cache
3232
33from .DebPackage import DebPackage33from .DebPackage import (
34 ClickPackage,
35 DebPackage,
36)
3437
3538
36if sys.version_info[0] == 2:39if sys.version_info[0] == 2:
@@ -84,8 +87,11 @@
8487
85 def open(self, file, downloaded=False):88 def open(self, file, downloaded=False):
86 file = os.path.abspath(file)89 file = os.path.abspath(file)
90 klass = DebPackage
91 if file.endswith(".click"):
92 klass = ClickPackage
87 try:93 try:
88 self._deb = DebPackage(file, self._cache, downloaded)94 self._deb = klass(file, {}, downloaded)
89 except (IOError, SystemError, ValueError) as e:95 except (IOError, SystemError, ValueError) as e:
90 logging.debug("open failed with %s" % e)96 logging.debug("open failed with %s" % e)
91 mimetype=guess_type(file)97 mimetype=guess_type(file)

Subscribers

People subscribed via source and target branches

to status/vote changes: