~davidc3/onehundredscopes/cities

« back to all changes in this revision

Viewing changes to src/unity-scope-cities

  • Committer: David Callé
  • Date: 2011-12-03 00:39:44 UTC
  • Revision ID: davidc@framli.eu-20111203003944-wt7jowu3apidoxyy
Create a /tmp/unity-scope-cities folder to store clock icons

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from gi.repository import Unity
22
22
import socket, urllib, urllib2, simplejson
23
23
import locale
 
24
import os
24
25
 
25
26
socket.setdefaulttimeout(1)
26
27
BUS_NAME = "net.launchpad.scope.information.cities"
27
28
 
 
29
 
 
30
if not os.path.isdir('/tmp/unity-scope-cities'):
 
31
        os.makedirs('/tmp/unity-scope-cities')
 
32
 
28
33
locale.setlocale(locale.LC_NUMERIC, '')
29
34
global session_locale
30
35
#session_locale = locale.getlocale(locale.LC_MESSAGES)[0].split("_")[0]
58
63
                        self.timezone(search, model)
59
64
                        self.weather(search, model)
60
65
                        self.scope.props.active_global_search.emit("finished")
61
 
 
 
66
                        
62
67
        #
63
68
        # Time Zone search
64
69
        # <http://www.worldweatheronline.com/time-zone-api.aspx>
184
189
                                                i
185
190
                                                clock_back.paste(clock_hours, (0, 0), clock_hours)
186
191
                                                clock_back.paste(clock_minutes, (0, 0), clock_minutes)
187
 
                                                clock_back.save('/tmp/%s.png' % comment)
188
 
                                                
189
 
                                                model.append('', '/tmp/%s.png' % comment, 0, "text/html", comment, '', '')
 
192
                                                clock_back.save('/tmp/unity-scope-cities/%s.png' % comment)
 
193
                                                
 
194
                                                model.append('', '/tmp/unity-scope-cities/%s.png' % comment, 0, "text/html", comment, '', '')
 
195
                                                
 
196
                                                
190
197
                                                
191
198
                                except (KeyError):
192
199
                                        pass