service.py

changeset 30
a5bfd99bc2a3
parent 29
2c78e68d7363
child 31
60045b362d71
--- a/service.py	Thu Jun 22 19:01:31 2017 +0300
+++ b/service.py	Sat Jun 24 19:38:05 2017 +0300
@@ -7,6 +7,7 @@
 
 from misc import *
 from busroute import reduce_schedule
+import buses
 
 app = Flask(__name__)
 
@@ -220,10 +221,19 @@
 def static_file(path):
 	return send_from_directory(path.join('static', path))
 
+from argparse import ArgumentParser
+parser = ArgumentParser()
+parser.add_argument('gtfs_zip_path')
+parser.add_argument('profile_path')
+
 if __name__ == '__main__':
-	from argparse import ArgumentParser
-	parser = ArgumentParser()
 	parser.add_argument('-p', '--port', type = int, default = 5000)
 	parser.add_argument('-d', '--debug', action = 'store_true')
-	args = parser.parse_args()
+
+args = parser.parse_args()
+profile = ConfigParser()
+profile.read(args.profile_path)
+buses.load_buses(args.gtfs_zip_path, profile = profile)
+
+if __name__ == '__main__':
 	app.run(debug = args.debug, port = args.port)

mercurial