Merge lp:~curucu-hackers/unity-scope-askubuntu/get-gtk-out into lp:unity-scope-askubuntu

Proposed by Facundo Batista
Status: Merged
Approved by: David Callé
Approved revision: 13
Merged at revision: 10
Proposed branch: lp:~curucu-hackers/unity-scope-askubuntu/get-gtk-out
Merge into: lp:unity-scope-askubuntu
Diff against target: 87 lines (+7/-25)
2 files modified
debian/control (+2/-1)
src/unity_askubuntu_daemon.py (+5/-24)
To merge this branch: bzr merge lp:~curucu-hackers/unity-scope-askubuntu/get-gtk-out
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Guillermo Gonzalez Approve
Review via email: mp+185918@code.launchpad.net

Commit message

Removed usage of GTK.

Description of the change

Removed usage of GTK.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

+1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
11. By Facundo Batista

Added python-gi dependency.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
12. By Facundo Batista

Py3 :)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
13. By David Callé

Invisible fix attempt

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-03-14 15:07:53 +0000
3+++ debian/control 2013-09-17 13:38:06 +0000
4@@ -10,6 +10,7 @@
5 gir1.2-unity-5.0 (>= 6.8),
6 gir1.2-dee-1.0,
7 gir1.2-glib-2.0,
8+ python3-gi,
9 Standards-Version: 3.9.3
10 Homepage: https://launchpad.net/ubuntu-scopes
11
12@@ -19,7 +20,7 @@
13 ${python3:Depends},
14 python3,
15 gir1.2-unity-5.0 (>= 6.8),
16-   gir1.2-dee-1.0,
17+ gir1.2-dee-1.0,
18 unity-scopes-runner,
19 gir1.2-glib-2.0
20 Description: askubuntu scope for Unity
21
22=== modified file 'src/unity_askubuntu_daemon.py'
23--- src/unity_askubuntu_daemon.py 2013-02-13 15:22:14 +0000
24+++ src/unity_askubuntu_daemon.py 2013-09-17 13:38:06 +0000
25@@ -14,7 +14,7 @@
26 # You should have received a copy of the GNU General Public License along
27 # with this program. If not, see <http://www.gnu.org/licenses/>.
28
29-from gi.repository import GLib, Gio, Gtk
30+from gi.repository import GLib, Gio
31 from gi.repository import Unity
32 import gettext
33 import urllib.request
34@@ -79,32 +79,20 @@
35 url = "http://www.askubuntu.com/questions/%d" % question["question_id"]
36
37 if question['answer_count'] >= 1:
38- icon = Gio.ThemedIcon.new("/usr/lib/unity-lens-help/icons/askubuntu-unsolved-coloured.svg").to_string()
39+ icon = "/usr/lib/unity-lens-help/icons/askubuntu-unsolved-coloured.svg"
40 if question["answer_count"] == 1:
41 answertext = _("%s answer" % str(question["answer_count"]))
42 else:
43 answertext = _("%s answers" % str(question["answer_count"]))
44 text = answertext
45 else:
46- icon = Gio.ThemedIcon.new("/usr/lib/unity-lens-help/icons/askubuntu-question-coloured.svg").to_string()
47+ icon = "/usr/lib/unity-lens-help/icons/askubuntu-question-coloured.svg"
48 text = ""
49
50 if "accepted_answer_id" in question:
51- icon = Gio.ThemedIcon.new("/usr/lib/unity-lens-help/icons/askubuntu-answer-coloured.svg").to_string()
52+ icon = "/usr/lib/unity-lens-help/icons/askubuntu-answer-coloured.svg"
53 text = _("1 accepted answer")
54
55- # Try and get an application icon based on the tags of the question
56- try:
57- tags = question['tags'][:2]
58- for tag in tags:
59- icon_theme = Gtk.IconTheme()
60- icon_info = icon_theme.lookup_icon(tag, 128, 0)
61- if icon_info:
62- icon = Gio.ThemedIcon.new(tag).to_string()
63- continue
64- except:
65- pass
66-
67 # No need to be including questions marked as [closed] in the results
68 if title.lower().find("[closed]") == -1:
69 results.append({'uri': url,
70@@ -126,16 +114,9 @@
71 print(data)
72 if "tags" in data:
73 for i in data['tags']:
74- icon_theme = Gtk.IconTheme()
75- icon_info = icon_theme.lookup_icon(i['name'], 128, 0)
76- if icon_info:
77- icon_hint = Gio.ThemedIcon.new(i['name']).to_string()
78- else:
79- icon_hint = Gio.ThemedIcon.new('tag').to_string()
80 url = "http://www.askubuntu.com/tags/%s" % i['name']
81-
82 results.append({'uri': url,
83- 'icon_hint': icon_hint,
84+ 'icon_hint': "",
85 'category': 1,
86 'title': i['name'],
87 'comment': "",

Subscribers

People subscribed via source and target branches

to all changes: