Upgrade origin-src to google transit feed 1.2.6
[bus.git] / origin-src / transitfeed-1.2.6 / examples / small_builder.py
blob:a/origin-src/transitfeed-1.2.6/examples/small_builder.py -> blob:b/origin-src/transitfeed-1.2.6/examples/small_builder.py
--- a/origin-src/transitfeed-1.2.6/examples/small_builder.py
+++ b/origin-src/transitfeed-1.2.6/examples/small_builder.py
@@ -21,7 +21,11 @@
 service_period.SetWeekdayService(True)
 service_period.SetDateHasService('20070704')
 
-stop1 = schedule.AddStop(lng=-122, lat=37.2, name="Suburbia")
+field_d = {'lng': -122, 'lat': 37.2, 'name':"Suburbia", 'stop_code': "AAAZZ"}
+stop1 = transitfeed.Stop(field_dict=field_d)
+print stop1.__dict__
+print stop1.__getattr__('stop_code')
+schedule.AddStopObject(stop1)
 stop2 = schedule.AddStop(lng=-122.001, lat=37.201, name="Civic Center")
 
 route = schedule.AddRoute(short_name="22", long_name="Civic Center Express",
@@ -35,6 +39,15 @@
 trip.AddStopTime(stop1, stop_time='17:30:00')
 trip.AddStopTime(stop2, stop_time='17:45:00')
 
-schedule.Validate()
+for s in schedule.GetStopList():
+      #wtf, stop_code changes into stop_name after .find()
+      virginstopCode = s.stop_code
+      print s
+      print s.stop_code
+      #if s.stop_code.find("Wj") == -1:
+     #   print (stop.stop_id, stop.stop_name, float(stop.stop_lat),
+      #    float(stop.stop_lon), stop.location_type, s.stop_code)
+
+#schedule.Validate()
 schedule.WriteGoogleTransitFeed(options.output)