real_time_stop_display.py

changeset 127
2bc0529d44a5
parent 126
369e242edc5d
child 131
13f3a909ac70
--- a/real_time_stop_display.py	Tue Sep 25 22:22:10 2018 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-import buses
-from configparser import ConfigParser
-profile = ConfigParser()
-profile.read('profiles/föli.ini')
-buses.load_buses('gtfs.zip', profile)
-
-def service_start_time():
-	from datetime import date, datetime, timedelta
-	result = datetime.now().replace(hour = 0, minute = 0, second = 0, microsecond = 0)
-	if datetime.now().hour < 4:
-		result -= timedelta(1)
-	return result
-
-def find_halt(data, stop_reference):
-	from datetime import datetime
-	info = (data['blockref'], datetime.fromtimestamp(data['originaimeddeparturetime']) - service_start_time())
-	trip = buses.trips_by_vehicle_info[info]
-	return [halt for halt in buses.trips_by_vehicle_info[info].schedule if halt.stop.reference == stop_reference][0]

mercurial