-
Notifications
You must be signed in to change notification settings - Fork 0
/
Search.py
executable file
·52 lines (34 loc) · 1.06 KB
/
Search.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# © Linus Unnebäck
#
from GeoCaching import GeoCaching
from GeoForm import GeoForm
from GeoResult import GeoResult
from gtk import main, main_quit
from gtk import Window, VBox
class Search(VBox):
def __init__(self):
VBox.__init__(self)
self.form = GeoForm()
self.result = GeoResult()
self.pack_start(self.form, False)
self.pack_start(self.result)
self.login = GeoCaching()
self.search = None
self.form.connect('search', self.do_search)
def do_search(self, widget, lat, long):
self.search = self.login.search_lat_long(lat, long)
for row in self.search.results:
self.result.add_cache(row)
self.result.show_all()
if __name__ == '__main__':
W = Window()
S = Search()
W.connect('destroy', main_quit)
W.set_title("Search for caches")
W.set_size_request(300,200)
W.add(S)
W.show_all()
main()