Merge lp:~frederik-elwert/lens-cooking/chefkoch-scope into lp:lens-cooking
- chefkoch-scope
- Merge into lens-cooking
Proposed by
Frederik Elwert
Status: | Merged |
---|---|
Approved by: | Eduard Gotwig |
Approved revision: | 44 |
Merge reported by: | Eduard Gotwig |
Merged at revision: | not available |
Proposed branch: | lp:~frederik-elwert/lens-cooking/chefkoch-scope |
Merge into: | lp:lens-cooking |
Diff against target: |
331 lines (+233/-13) 8 files modified
chefkoch.scope (+3/-0) chefkoch.svg (+71/-0) debian/unity-lens-cooking.install (+7/-4) setup.py (+9/-2) unity-lens-cooking (+7/-5) unity-scope-chefkoch (+131/-0) unity-scope-chefkoch.service (+3/-0) unity-scope-gourmet (+2/-2) |
To merge this branch: | bzr merge lp:~frederik-elwert/lens-cooking/chefkoch-scope |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eduard Gotwig | Approve | ||
Review via email: mp+106897@code.launchpad.net |
Commit message
Description of the change
Added scope for chefkoch.de and added this as a new category to the lens.
To post a comment you must log in.
Revision history for this message
Eduard Gotwig (gotwig) wrote : | # |
I am going to merge this in 5 hours.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'chefkoch.scope' | |||
2 | --- chefkoch.scope 1970-01-01 00:00:00 +0000 | |||
3 | +++ chefkoch.scope 2012-05-22 20:35:21 +0000 | |||
4 | @@ -0,0 +1,3 @@ | |||
5 | 1 | [Scope] | ||
6 | 2 | DBusName=net.launchpad.scope.cooking.chefkoch | ||
7 | 3 | DBusPath=/net/launchpad/scope/cooking/chefkoch | ||
8 | 0 | 4 | ||
9 | === added file 'chefkoch.svg' | |||
10 | --- chefkoch.svg 1970-01-01 00:00:00 +0000 | |||
11 | +++ chefkoch.svg 2012-05-22 20:35:21 +0000 | |||
12 | @@ -0,0 +1,71 @@ | |||
13 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
14 | 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
15 | 3 | |||
16 | 4 | <svg | ||
17 | 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
18 | 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
19 | 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
20 | 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
21 | 9 | xmlns="http://www.w3.org/2000/svg" | ||
22 | 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
23 | 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
24 | 12 | width="32.625004" | ||
25 | 13 | height="28.500004" | ||
26 | 14 | id="svg3018" | ||
27 | 15 | version="1.1" | ||
28 | 16 | inkscape:version="0.48.3.1 r9886" | ||
29 | 17 | sodipodi:docname="chefkoch.svg"> | ||
30 | 18 | <defs | ||
31 | 19 | id="defs3020" /> | ||
32 | 20 | <sodipodi:namedview | ||
33 | 21 | id="base" | ||
34 | 22 | pagecolor="#ffffff" | ||
35 | 23 | bordercolor="#666666" | ||
36 | 24 | borderopacity="1.0" | ||
37 | 25 | inkscape:pageopacity="0.0" | ||
38 | 26 | inkscape:pageshadow="2" | ||
39 | 27 | inkscape:zoom="2.8" | ||
40 | 28 | inkscape:cx="0.096507634" | ||
41 | 29 | inkscape:cy="4.5050419" | ||
42 | 30 | inkscape:document-units="px" | ||
43 | 31 | inkscape:current-layer="layer1" | ||
44 | 32 | showgrid="false" | ||
45 | 33 | fit-margin-top="0" | ||
46 | 34 | fit-margin-left="0" | ||
47 | 35 | fit-margin-right="0" | ||
48 | 36 | fit-margin-bottom="0" | ||
49 | 37 | inkscape:window-width="1301" | ||
50 | 38 | inkscape:window-height="744" | ||
51 | 39 | inkscape:window-x="65" | ||
52 | 40 | inkscape:window-y="24" | ||
53 | 41 | inkscape:window-maximized="1" /> | ||
54 | 42 | <metadata | ||
55 | 43 | id="metadata3023"> | ||
56 | 44 | <rdf:RDF> | ||
57 | 45 | <cc:Work | ||
58 | 46 | rdf:about=""> | ||
59 | 47 | <dc:format>image/svg+xml</dc:format> | ||
60 | 48 | <dc:type | ||
61 | 49 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
62 | 50 | <dc:title></dc:title> | ||
63 | 51 | </cc:Work> | ||
64 | 52 | </rdf:RDF> | ||
65 | 53 | </metadata> | ||
66 | 54 | <g | ||
67 | 55 | inkscape:label="Ebene 1" | ||
68 | 56 | inkscape:groupmode="layer" | ||
69 | 57 | id="layer1" | ||
70 | 58 | transform="translate(-335.3125,-518.46875)"> | ||
71 | 59 | <path | ||
72 | 60 | inkscape:connector-curvature="0" | ||
73 | 61 | id="path3219" | ||
74 | 62 | d="m 342.15481,519.26909 c -3.31663,-0.003 -6.00944,2.58203 -6.01217,5.77118 -0.002,2.7707 2.02629,5.09149 4.7339,5.65418 l -0.0132,15.43625 21.50651,0.0183 0.0132,-15.43622 c 2.70857,-0.55807 4.74117,-2.8754 4.74353,-5.64609 0.003,-3.18916 -2.68563,-5.77862 -6.00229,-5.78146 -1.9333,-0.002 -3.65477,0.87481 -4.75521,2.23917 -1.09836,-1.36232 -2.80673,-2.24563 -4.73683,-2.24728 -1.92681,-0.002 -3.63969,0.86865 -4.74061,2.22516 -1.09859,-1.35838 -2.80999,-2.23161 -4.73683,-2.23325 z" | ||
75 | 63 | style="fill:#eef4f3;fill-opacity:1;fill-rule:evenodd;stroke:#4c6f0f;stroke-width:1.62983214999999992;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> | ||
76 | 64 | <path | ||
77 | 65 | style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#4c6f0f;stroke-width:1.62999999999999967;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" | ||
78 | 66 | d="m 340.73707,540.8274 21.38024,0.0183" | ||
79 | 67 | id="path4436" | ||
80 | 68 | inkscape:connector-curvature="0" | ||
81 | 69 | sodipodi:nodetypes="cc" /> | ||
82 | 70 | </g> | ||
83 | 71 | </svg> | ||
84 | 0 | 72 | ||
85 | === modified file 'debian/unity-lens-cooking.install' | |||
86 | --- debian/unity-lens-cooking.install 2012-04-06 14:37:30 +0000 | |||
87 | +++ debian/unity-lens-cooking.install 2012-05-22 20:35:21 +0000 | |||
88 | @@ -1,15 +1,18 @@ | |||
89 | 1 | build/share/unity/lenses/cooking/cooking.lens /usr/share/unity/lenses/cooking | 1 | build/share/unity/lenses/cooking/cooking.lens /usr/share/unity/lenses/cooking |
90 | 2 | cooking.svg /usr/share/unity/lenses/cooking | 2 | cooking.svg /usr/share/unity/lenses/cooking |
91 | 3 | recipefy.png /usr/share/unity/lenses/cooking/icons | 3 | recipefy.png /usr/share/unity/lenses/cooking/icons |
92 | 4 | chefkoch.svg /usr/share/unity/lenses/cooking/icons | ||
93 | 4 | gourmet.png /usr/share/unity/lenses/cooking/icons | 5 | gourmet.png /usr/share/unity/lenses/cooking/icons |
94 | 5 | cuisine.png /usr/share/unity/lenses/cooking/icons | 6 | cuisine.png /usr/share/unity/lenses/cooking/icons |
95 | 7 | unity-lens-cooking /usr/share/unity/lenses/cooking | ||
96 | 8 | unity-lens-cooking.service /usr/share/dbus-1/services | ||
97 | 6 | recipefy.scope /usr/share/unity/lenses/cooking | 9 | recipefy.scope /usr/share/unity/lenses/cooking |
98 | 7 | unity-lens-cooking /usr/share/unity/lenses/cooking | ||
99 | 8 | unity-scope-recipefy /usr/share/unity/lenses/cooking | 10 | unity-scope-recipefy /usr/share/unity/lenses/cooking |
100 | 9 | unity-lens-cooking.service /usr/share/dbus-1/services | ||
101 | 10 | unity-scope-recipefy.service /usr/share/dbus-1/services | 11 | unity-scope-recipefy.service /usr/share/dbus-1/services |
102 | 12 | chefkoch.scope /usr/share/unity/lenses/cooking | ||
103 | 13 | unity-scope-chefkoch /usr/share/unity/lenses/cooking | ||
104 | 14 | unity-scope-chefkoch.service /usr/share/dbus-1/services | ||
105 | 15 | gourmet.scope /usr/share/unity/lenses/cooking | ||
106 | 11 | unity-scope-gourmet /usr/share/unity/lenses/cooking | 16 | unity-scope-gourmet /usr/share/unity/lenses/cooking |
107 | 12 | unity-scope-gourmet.service /usr/share/dbus-1/services | 17 | unity-scope-gourmet.service /usr/share/dbus-1/services |
108 | 13 | gourmet.scope /usr/share/unity/lenses/cooking | ||
109 | 14 | build/mo/* /usr/share/locale | 18 | build/mo/* /usr/share/locale |
110 | 15 | |||
111 | 16 | 19 | ||
112 | === modified file 'setup.py' | |||
113 | --- setup.py 2012-04-04 20:42:32 +0000 | |||
114 | +++ setup.py 2012-05-22 20:35:21 +0000 | |||
115 | @@ -14,10 +14,17 @@ | |||
116 | 14 | ['unity-lens-cooking', | 14 | ['unity-lens-cooking', |
117 | 15 | 'unity-scope-gourmet', | 15 | 'unity-scope-gourmet', |
118 | 16 | 'unity-scope-recipefy', | 16 | 'unity-scope-recipefy', |
120 | 17 | 'cooking.svg',]), | 17 | 'unity-scope-chefkoch', |
121 | 18 | 'chefkoch.svg', | ||
122 | 19 | 'cooking.svg', | ||
123 | 20 | 'cuisine.png', | ||
124 | 21 | 'gourmet.png', | ||
125 | 22 | ]), | ||
126 | 18 | ('share/dbus-1/services', | 23 | ('share/dbus-1/services', |
127 | 19 | ['unity-lens-cooking.service', | 24 | ['unity-lens-cooking.service', |
128 | 20 | 'unity-scope-gourmet.service', | 25 | 'unity-scope-gourmet.service', |
130 | 21 | 'unity-scope-recipefy.service',]), | 26 | 'unity-scope-recipefy.service', |
131 | 27 | 'unity-scope-chefkoch.service', | ||
132 | 28 | ]), | ||
133 | 22 | ], cmdclass={"build": build_extra.build_extra, | 29 | ], cmdclass={"build": build_extra.build_extra, |
134 | 23 | "build_i18n": build_i18n.build_i18n,}) | 30 | "build_i18n": build_i18n.build_i18n,}) |
135 | 24 | 31 | ||
136 | === modified file 'unity-lens-cooking' | |||
137 | --- unity-lens-cooking 2012-04-05 14:39:09 +0000 | |||
138 | +++ unity-lens-cooking 2012-05-22 20:35:21 +0000 | |||
139 | @@ -1,6 +1,6 @@ | |||
140 | 1 | #! /usr/bin/python | 1 | #! /usr/bin/python |
141 | 2 | # -*- coding: utf-8 -*- | 2 | # -*- coding: utf-8 -*- |
143 | 3 | # Copyright 2012 Eduard Gotwig | 3 | # Copyright 2012 Eduard Gotwig, Frederik Elwert <frederik.elwert@web.de> |
144 | 4 | # License: GPLv3 | 4 | # License: GPLv3 |
145 | 5 | 5 | ||
146 | 6 | from gi.repository import GLib, GObject, Gio | 6 | from gi.repository import GLib, GObject, Gio |
147 | @@ -23,8 +23,9 @@ | |||
148 | 23 | # Translatable strings | 23 | # Translatable strings |
149 | 24 | 24 | ||
150 | 25 | 25 | ||
153 | 26 | ONLINE = _("Recipefy Recipes") | 26 | RECIPEFY = _("Recipefy Recipes") |
154 | 27 | LOCAL = _("Gourmet Recipes") | 27 | CHEFKOCH = _("Chefkoch Recipes") |
155 | 28 | GOURMET = _("Gourmet Recipes") | ||
156 | 28 | 29 | ||
157 | 29 | LIKES = _("Likes") | 30 | LIKES = _("Likes") |
158 | 30 | TIME = _("Time") | 31 | TIME = _("Time") |
159 | @@ -60,8 +61,9 @@ | |||
160 | 60 | ### Then, we populate the categories | 61 | ### Then, we populate the categories |
161 | 61 | cats = [] | 62 | cats = [] |
162 | 62 | # A category is a display name, an icon and a renderer | 63 | # A category is a display name, an icon and a renderer |
165 | 63 | cats.append (Unity.Category.new (ONLINE,Gio.ThemedIcon.new("/usr/share/unity/lenses/cooking/icons/recipefy.png"),Unity.CategoryRenderer.HORIZONTAL_TILE)) | 64 | cats.append (Unity.Category.new (RECIPEFY,Gio.ThemedIcon.new("/usr/share/unity/lenses/cooking/icons/recipefy.png"),Unity.CategoryRenderer.HORIZONTAL_TILE)) |
166 | 64 | cats.append (Unity.Category.new (LOCAL,Gio.ThemedIcon.new("/usr/share/unity/lenses/cooking/icons/gourmet.png"),Unity.CategoryRenderer.HORIZONTAL_TILE)) | 65 | cats.append (Unity.Category.new (CHEFKOCH,Gio.ThemedIcon.new("/usr/share/unity/lenses/cooking/icons/chefkoch.svg"),Unity.CategoryRenderer.HORIZONTAL_TILE)) |
167 | 66 | cats.append (Unity.Category.new (GOURMET,Gio.ThemedIcon.new("/usr/share/unity/lenses/cooking/icons/gourmet.png"),Unity.CategoryRenderer.HORIZONTAL_TILE)) | ||
168 | 65 | self._lens.props.categories = cats | 67 | self._lens.props.categories = cats |
169 | 66 | ### Populate filters NOT IN USE FOR NOW | 68 | ### Populate filters NOT IN USE FOR NOW |
170 | 67 | """filters = [] | 69 | """filters = [] |
171 | 68 | 70 | ||
172 | === added file 'unity-scope-chefkoch' | |||
173 | --- unity-scope-chefkoch 1970-01-01 00:00:00 +0000 | |||
174 | +++ unity-scope-chefkoch 2012-05-22 20:35:21 +0000 | |||
175 | @@ -0,0 +1,131 @@ | |||
176 | 1 | #! /usr/bin/python | ||
177 | 2 | # -*- coding: utf-8 -*- | ||
178 | 3 | # Copyright 2012 Eduard Gotwig, Frederik Elwert <frederik.elwert@web.de> | ||
179 | 4 | # License: GPLv3 | ||
180 | 5 | |||
181 | 6 | from gi.repository import GLib, GObject, Gio | ||
182 | 7 | from gi.repository import Dee | ||
183 | 8 | from gi.repository import Unity | ||
184 | 9 | import lxml.html | ||
185 | 10 | import os | ||
186 | 11 | import re | ||
187 | 12 | import gettext | ||
188 | 13 | import locale | ||
189 | 14 | import sys | ||
190 | 15 | |||
191 | 16 | APP_NAME="unity-lens-cooking" | ||
192 | 17 | LOCAL_PATH="/usr/share/locale" | ||
193 | 18 | |||
194 | 19 | gettext.bindtextdomain(APP_NAME, LOCAL_PATH) | ||
195 | 20 | gettext.textdomain(APP_NAME) | ||
196 | 21 | _ = gettext.gettext | ||
197 | 22 | |||
198 | 23 | RUNNING = _("Failed to own name %s. Bailing out. An other instance is already running!") | ||
199 | 24 | |||
200 | 25 | FULLSTAR_RE = re.compile(r'suche-scrore-(\d).gif') | ||
201 | 26 | HALFSTAR_RE = re.compile(r'suche-scrore-(\d)_(\d).gif') | ||
202 | 27 | |||
203 | 28 | # The scope dbus id | ||
204 | 29 | BUS_NAME = "net.launchpad.scope.cooking.chefkoch" | ||
205 | 30 | |||
206 | 31 | class Daemon: | ||
207 | 32 | def __init__ (self): | ||
208 | 33 | # Create the scope (this matches the path defined in the .scope file) | ||
209 | 34 | self.scope = Unity.Scope.new ("/net/launchpad/scope/cooking/chefkoch") | ||
210 | 35 | # Is the scope searchable from the home dash? | ||
211 | 36 | self.scope.search_in_global = False | ||
212 | 37 | # Connect to the search changed signal (it is fired when the lens is opened for the first time, then for each search change) | ||
213 | 38 | self.scope.connect ("search-changed", self.on_search_changed) | ||
214 | 39 | # Listen to the lens filters | ||
215 | 40 | self.scope.connect ("filters-changed", lambda scope : scope.queue_search_changed(Unity.SearchType.DEFAULT)) | ||
216 | 41 | # The scope is ready | ||
217 | 42 | self.scope.export() | ||
218 | 43 | # On each search change, this method is called | ||
219 | 44 | def on_search_changed (self, scope, search, search_type, cancellable): | ||
220 | 45 | # Get the search string | ||
221 | 46 | search_string = search.props.search_string.strip() | ||
222 | 47 | print "Search changed to \"%s\"" % search_string | ||
223 | 48 | # Get the Dee model (the database used by the lens to store and display search results) | ||
224 | 49 | model = search.props.results_model | ||
225 | 50 | # Empty the model | ||
226 | 51 | model.clear() | ||
227 | 52 | # Update the model | ||
228 | 53 | self.update_results_model (search_string, model) | ||
229 | 54 | # Signal to the lens that the search is finished (the spinning search icon stops) | ||
230 | 55 | search.finished() | ||
231 | 56 | |||
232 | 57 | # Update the model | ||
233 | 58 | def update_results_model(self, search, model): | ||
234 | 59 | self.chefkoch(search, model) | ||
235 | 60 | |||
236 | 61 | # This method sends the search string to chefkoch and brings back results | ||
237 | 62 | def chefkoch_search(self,search): | ||
238 | 63 | # Search for recipes over GET | ||
239 | 64 | url = ("http://www.chefkoch.de/rs/s0/%s/Rezepte.html" % (search)) | ||
240 | 65 | print "Searching for Recipes at %s" % url | ||
241 | 66 | tree = lxml.html.parse(url) | ||
242 | 67 | tree.getroot().make_links_absolute() | ||
243 | 68 | items = tree.xpath("//table[@class='result']//tr[@bgcolor]") | ||
244 | 69 | print 'Got %d results' % len(items) | ||
245 | 70 | return items | ||
246 | 71 | # This method parses the results and adds them to the model | ||
247 | 72 | def chefkoch(self, search, model): | ||
248 | 73 | # Skip empty search | ||
249 | 74 | if not search: | ||
250 | 75 | print 'Empty search, skipping.' | ||
251 | 76 | return | ||
252 | 77 | # We iterate through each of the returned results | ||
253 | 78 | for i, item in enumerate(self.chefkoch_search(search)): | ||
254 | 79 | title = item.xpath("string(td[2]/a)") | ||
255 | 80 | icon = item.xpath("td[1]/img/@src")[0] | ||
256 | 81 | if icon == 'http://cdn.chefkoch.de/img/no-image-rsmain.gif': | ||
257 | 82 | icon = '/usr/share/unity/lenses/cooking/icons/cuisine.png' | ||
258 | 83 | uri = item.xpath("td[2]/a/@href")[0] | ||
259 | 84 | stars = {0: '☆☆☆☆☆', 1: '✮☆☆☆☆', 2: '★☆☆☆☆', 3: '★✮☆☆☆', 4: '★★☆☆☆', 5: '★★✮☆☆', 6: '★★★☆☆', 7: '★★★✮☆', 8: '★★★★☆', 9: '★★★★✮', 10: '★★★★★'} | ||
260 | 85 | likes = 0 | ||
261 | 86 | stars_img = item.xpath("td[3]/img/@src")[0] | ||
262 | 87 | result = FULLSTAR_RE.search(stars_img) | ||
263 | 88 | if result: | ||
264 | 89 | likes = int(result.group(1)) * 2 | ||
265 | 90 | else: | ||
266 | 91 | result = HALFSTAR_RE.search(stars_img) | ||
267 | 92 | if result: | ||
268 | 93 | likes = int(result.group(1)) * 2 + 1 | ||
269 | 94 | time = item[3].text | ||
270 | 95 | difficulty = item[3].find('br').tail | ||
271 | 96 | comments = [stars[likes], time + ' ⌚ ', difficulty] | ||
272 | 97 | comment = ' | '.join(comments) | ||
273 | 98 | |||
274 | 99 | # If the uri seems valid, we add the results to the Dee model | ||
275 | 100 | if (uri.startswith("http://")): | ||
276 | 101 | # uri, icon, category (matching the order of the categories in the lens), mimetype, title, comment, drag and drop uri | ||
277 | 102 | model.append(uri, icon, 1, "text/html", title, comment, uri) | ||
278 | 103 | # We can append the same result to multiple models, just by changing the category | ||
279 | 104 | |||
280 | 105 | if __name__ == "__main__": | ||
281 | 106 | # Check if we are running in a German locale. Otherwise, the results are | ||
282 | 107 | # rather useless, so don't create the daemon. | ||
283 | 108 | lang = locale.getdefaultlocale()[0] | ||
284 | 109 | if '_' in lang: | ||
285 | 110 | lang = lang.split('_', 1)[0] | ||
286 | 111 | if not lang == 'de': | ||
287 | 112 | raise SystemExit('No German locale, exiting chefkoch scope') | ||
288 | 113 | # The following lines take care of the Bus connexion. | ||
289 | 114 | session_bus_connection = Gio.bus_get_sync (Gio.BusType.SESSION, None) | ||
290 | 115 | session_bus = Gio.DBusProxy.new_sync (session_bus_connection, 0, None, | ||
291 | 116 | 'org.freedesktop.DBus', | ||
292 | 117 | '/org/freedesktop/DBus', | ||
293 | 118 | 'org.freedesktop.DBus', None) | ||
294 | 119 | result = session_bus.call_sync('RequestName', | ||
295 | 120 | GLib.Variant ("(su)", (BUS_NAME, 0x4)), | ||
296 | 121 | 0, -1, None) | ||
297 | 122 | |||
298 | 123 | # Unpack variant response with signature "(u)". 1 means we got it. | ||
299 | 124 | result = result.unpack()[0] | ||
300 | 125 | |||
301 | 126 | if result != 1 : | ||
302 | 127 | print >> sys.stderr, RUNNING % BUS_NAME | ||
303 | 128 | raise SystemExit (1) | ||
304 | 129 | |||
305 | 130 | daemon = Daemon() | ||
306 | 131 | GObject.MainLoop().run() | ||
307 | 0 | 132 | ||
308 | === added file 'unity-scope-chefkoch.service' | |||
309 | --- unity-scope-chefkoch.service 1970-01-01 00:00:00 +0000 | |||
310 | +++ unity-scope-chefkoch.service 2012-05-22 20:35:21 +0000 | |||
311 | @@ -0,0 +1,3 @@ | |||
312 | 1 | [D-BUS Service] | ||
313 | 2 | Name=net.launchpad.scope.cooking.chefkoch | ||
314 | 3 | Exec=/usr/share/unity/lenses/cooking/unity-scope-chefkoch | ||
315 | 0 | 4 | ||
316 | === modified file 'unity-scope-gourmet' | |||
317 | --- unity-scope-gourmet 2012-04-07 23:41:13 +0000 | |||
318 | +++ unity-scope-gourmet 2012-05-22 20:35:21 +0000 | |||
319 | @@ -128,10 +128,10 @@ | |||
320 | 128 | # uri, icon, category (matching the order of the categories in the lens), mimetype, title, comment, drag and drop uri | 128 | # uri, icon, category (matching the order of the categories in the lens), mimetype, title, comment, drag and drop uri |
321 | 129 | if row[14]: | 129 | if row[14]: |
322 | 130 | open('/tmp/unity-scope-gourmet/icon' + str(i), 'wb').write(row[14]) | 130 | open('/tmp/unity-scope-gourmet/icon' + str(i), 'wb').write(row[14]) |
324 | 131 | model.append(uri, '/tmp/unity-scope-gourmet/icon' + str(i), 1, "text/html", title, comment, uri) | 131 | model.append(uri, '/tmp/unity-scope-gourmet/icon' + str(i), 2, "text/html", title, comment, uri) |
325 | 132 | else: | 132 | else: |
326 | 133 | if os.path.exists('/tmp/unity-scope-gourmet/icon' + str(i)): os.remove('/tmp/unity-scope-gourmet/icon' + str(i)) | 133 | if os.path.exists('/tmp/unity-scope-gourmet/icon' + str(i)): os.remove('/tmp/unity-scope-gourmet/icon' + str(i)) |
328 | 134 | model.append(uri, '/usr/share/unity/lenses/cooking/icons/cuisine.png', 1, "text/html", title, comment, uri) | 134 | model.append(uri, '/usr/share/unity/lenses/cooking/icons/cuisine.png', 2, "text/html", title, comment, uri) |
329 | 135 | # We can append the same result to multiple models, just by changing the category | 135 | # We can append the same result to multiple models, just by changing the category |
330 | 136 | 136 | ||
331 | 137 | # The following lines take care of the Bus connexion. | 137 | # The following lines take care of the Bus connexion. |
Approved, thank you for your big help :-)!