Esempio n. 1
0
 def ValidateStopLocationType(self, problems):
   self.location_type = util.ValidateAndReturnIntValue(
       self.location_type, [0, 1, 2], 0, True, 'location_type', problems)
   # Entrances must have a parent_station.
   if self.location_type == 2 and util.IsEmpty(self.parent_station):
     problems.InvalidValue('location_type', self.location_type,
         reason='an entrance must have a parent_station')
Esempio n. 2
0
 def ValidateVehicleType(self, problems):
     self.vehicle_type = util.ValidateAndReturnIntValue(
         self.vehicle_type,
         self._gtfs_factory.Route._ROUTE_TYPE_IDS,
         None,
         True,
         "vehicle_type",
         problems,
     )
     # Entrances must not have a vehicle type, in general google transit does not
     # read vehicle types from stops with a parent station.
     if self.vehicle_type:
         if self.location_type == 2:
             problems.InvalidValue(
                 "vehicle_type",
                 self.location_type,
                 reason="an entrance must not have a vehicle type",
             )
         elif not util.IsEmpty(self.parent_station):
             problems.InvalidValue(
                 "vehicle_type",
                 self.location_type,
                 reason="Google Transit does not read vehicle types for stops "
                 "having a parent station",
                 type=problems_module.TYPE_WARNING,
             )
Esempio n. 3
0
 def ValidateWheelchairBoarding(self, problems):
     self.wheelchair_boarding = util.ValidateAndReturnIntValue(
         self.wheelchair_boarding, [0, 1, 2], 0, True,
         'wheelchair_boarding', problems)