1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 """
22 Handle converting SABX point data into a basic HTML file.
23 """
24
25 from sabx10.oxm import parse_no_def_namespaces, parse_tree
26 from sabx10.templating import SabxProcessor
27
29 """
30 Process an SABX 1.0 file, pulling out all its point data for processing.
31 """
32
33 - def __init__(self, template_file=None, man=None):
34 """
35 Add C{optparse} options for the index.
36
37 @param template_file: (optional) file name of template file
38 @type template_file: C{string}
39 @param man: (optional) extended program help
40 @type man: C{string}
41 """
42 SabxProcessor.__init__(self, template_file, man)
43
44 self.parser.add_option("-n", "--index", dest="ride_index",
45 default="1",
46 help="ride index")
47
49 """
50 Add the points to the SABX 1.0 data.
51 """
52 SabxProcessor.get_template_data(self)
53
54 points = []
55 for seg_id in \
56 self.template_data['ride_dict'][self.options.ride_index].segs:
57 for pt in self.template_data['seg_dict'][seg_id].waypoints:
58 points.append( {'index': pt.id,
59 'lat': pt.lat,
60 'lon': pt.lon,
61 'ele': pt.ele} )
62 self.template_data['points'] = points
63