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
=== modified file 'debian/control'
--- debian/control 2013-03-14 15:07:53 +0000
+++ debian/control 2013-09-17 13:38:06 +0000
@@ -10,6 +10,7 @@
10 gir1.2-unity-5.0 (>= 6.8),10 gir1.2-unity-5.0 (>= 6.8),
11 gir1.2-dee-1.0,11 gir1.2-dee-1.0,
12 gir1.2-glib-2.0,12 gir1.2-glib-2.0,
13 python3-gi,
13Standards-Version: 3.9.314Standards-Version: 3.9.3
14Homepage: https://launchpad.net/ubuntu-scopes15Homepage: https://launchpad.net/ubuntu-scopes
1516
@@ -19,7 +20,7 @@
19 ${python3:Depends},20 ${python3:Depends},
20 python3,21 python3,
21 gir1.2-unity-5.0 (>= 6.8),22 gir1.2-unity-5.0 (>= 6.8),
22   gir1.2-dee-1.0,23 gir1.2-dee-1.0,
23 unity-scopes-runner,24 unity-scopes-runner,
24 gir1.2-glib-2.025 gir1.2-glib-2.0
25Description: askubuntu scope for Unity26Description: askubuntu scope for Unity
2627
=== modified file 'src/unity_askubuntu_daemon.py'
--- src/unity_askubuntu_daemon.py 2013-02-13 15:22:14 +0000
+++ src/unity_askubuntu_daemon.py 2013-09-17 13:38:06 +0000
@@ -14,7 +14,7 @@
14# You should have received a copy of the GNU General Public License along14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.15# with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17from gi.repository import GLib, Gio, Gtk17from gi.repository import GLib, Gio
18from gi.repository import Unity18from gi.repository import Unity
19import gettext19import gettext
20import urllib.request20import urllib.request
@@ -79,32 +79,20 @@
79 url = "http://www.askubuntu.com/questions/%d" % question["question_id"]79 url = "http://www.askubuntu.com/questions/%d" % question["question_id"]
8080
81 if question['answer_count'] >= 1:81 if question['answer_count'] >= 1:
82 icon = Gio.ThemedIcon.new("/usr/lib/unity-lens-help/icons/askubuntu-unsolved-coloured.svg").to_string()82 icon = "/usr/lib/unity-lens-help/icons/askubuntu-unsolved-coloured.svg"
83 if question["answer_count"] == 1:83 if question["answer_count"] == 1:
84 answertext = _("%s answer" % str(question["answer_count"]))84 answertext = _("%s answer" % str(question["answer_count"]))
85 else:85 else:
86 answertext = _("%s answers" % str(question["answer_count"]))86 answertext = _("%s answers" % str(question["answer_count"]))
87 text = answertext87 text = answertext
88 else:88 else:
89 icon = Gio.ThemedIcon.new("/usr/lib/unity-lens-help/icons/askubuntu-question-coloured.svg").to_string()89 icon = "/usr/lib/unity-lens-help/icons/askubuntu-question-coloured.svg"
90 text = ""90 text = ""
9191
92 if "accepted_answer_id" in question:92 if "accepted_answer_id" in question:
93 icon = Gio.ThemedIcon.new("/usr/lib/unity-lens-help/icons/askubuntu-answer-coloured.svg").to_string()93 icon = "/usr/lib/unity-lens-help/icons/askubuntu-answer-coloured.svg"
94 text = _("1 accepted answer")94 text = _("1 accepted answer")
9595
96 # Try and get an application icon based on the tags of the question
97 try:
98 tags = question['tags'][:2]
99 for tag in tags:
100 icon_theme = Gtk.IconTheme()
101 icon_info = icon_theme.lookup_icon(tag, 128, 0)
102 if icon_info:
103 icon = Gio.ThemedIcon.new(tag).to_string()
104 continue
105 except:
106 pass
107
108 # No need to be including questions marked as [closed] in the results96 # No need to be including questions marked as [closed] in the results
109 if title.lower().find("[closed]") == -1:97 if title.lower().find("[closed]") == -1:
110 results.append({'uri': url,98 results.append({'uri': url,
@@ -126,16 +114,9 @@
126 print(data)114 print(data)
127 if "tags" in data:115 if "tags" in data:
128 for i in data['tags']:116 for i in data['tags']:
129 icon_theme = Gtk.IconTheme()
130 icon_info = icon_theme.lookup_icon(i['name'], 128, 0)
131 if icon_info:
132 icon_hint = Gio.ThemedIcon.new(i['name']).to_string()
133 else:
134 icon_hint = Gio.ThemedIcon.new('tag').to_string()
135 url = "http://www.askubuntu.com/tags/%s" % i['name']117 url = "http://www.askubuntu.com/tags/%s" % i['name']
136
137 results.append({'uri': url,118 results.append({'uri': url,
138 'icon_hint': icon_hint,119 'icon_hint': "",
139 'category': 1,120 'category': 1,
140 'title': i['name'],121 'title': i['name'],
141 'comment': "",122 'comment': "",

Subscribers

People subscribed via source and target branches

to all changes: