3 from gotovienna.utils import *
4 from gotovienna.realtime import *
9 return categorize_lines(itip.lines)
11 def get_stations(line):
12 return itip.get_stations(line).items()
14 def remove_duplicates(lst):
17 if element not in outlist:
18 outlist.append(element)
21 def get_all_stations():
23 for type, lines in get_lines():
26 for direction in get_stations(line):
27 st[line][direction[0]] = map(lambda x: x[0], direction[1])
30 if __name__ == "__main__":
31 with open('extracted.wki', 'w') as f:
32 for typ, lines in get_lines():
33 f.write('== %s ==\n' % typ)
34 #print (' %s ' % typ).center(79, '*')
36 f.write('=== %s ===\n' % line)
37 for direction in get_stations(line):
39 f.write('==== %s ====\n' % direction[0].encode('utf-8'))
40 #print line + " " + (' %s ' % direction[0]).center(77 - len(line) * 2, '=') + " " + line
41 # use remove_duplicates(direction[1]) if necessary
42 for station, _ in direction[1]:
43 f.write(' * %s\n' % station.encode('utf-8'))
44 #print station.center(79)