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
1=== modified file 'GDebi/DebPackage.py'
2--- GDebi/DebPackage.py 2012-10-12 10:02:16 +0000
3+++ GDebi/DebPackage.py 2013-07-19 11:25:32 +0000
4@@ -42,3 +42,12 @@
5 # just for compatibility
6 class DscSrcPackage(apt.debfile.DscSrcPackage):
7 pass
8+
9+
10+class ClickPackage(DebPackage):
11+ """Basic support to view the new ubuntu click packages, more to come"""
12+
13+ def check(self):
14+ self._failure_string = _(
15+ "Click packages can currently only be inspected with this tool")
16+ return False
17
18=== modified file 'GDebi/GDebiCommon.py'
19--- GDebi/GDebiCommon.py 2013-03-22 19:58:44 +0000
20+++ GDebi/GDebiCommon.py 2013-07-19 11:25:32 +0000
21@@ -30,7 +30,10 @@
22 import apt_pkg
23 from apt.cache import Cache
24
25-from .DebPackage import DebPackage
26+from .DebPackage import (
27+ ClickPackage,
28+ DebPackage,
29+)
30
31
32 if sys.version_info[0] == 2:
33@@ -84,8 +87,11 @@
34
35 def open(self, file, downloaded=False):
36 file = os.path.abspath(file)
37+ klass = DebPackage
38+ if file.endswith(".click"):
39+ klass = ClickPackage
40 try:
41- self._deb = DebPackage(file, self._cache, downloaded)
42+ self._deb = klass(file, {}, downloaded)
43 except (IOError, SystemError, ValueError) as e:
44 logging.debug("open failed with %s" % e)
45 mimetype=guess_type(file)

Subscribers

People subscribed via source and target branches

to status/vote changes: