Ejemplo n.º 1
0
 def __getattr__(self, name):
   if name == 'service_period':
     assert self._schedule, "Must be in a schedule to get service_period"
     return self._schedule.GetServicePeriod(self.service_id)
   elif name == 'pattern_id':
     if '_pattern_id' not in self.__dict__:
       self.__dict__['_pattern_id'] = hash(self.GetPattern())
     return self.__dict__['_pattern_id']
   else:
     return GtfsObjectBase.__getattr__(self, name)
Ejemplo n.º 2
0
    def __getattr__(self, name):
        """Return None or the default value if name is a known attribute.

    This method overrides GtfsObjectBase.__getattr__ to provide backwards
    compatible access to trips.
    """
        if name == 'trips':
            return self._trips
        else:
            return GtfsObjectBase.__getattr__(self, name)
Ejemplo n.º 3
0
 def __getattr__(self, name):
   if name == 'service_period':
     assert self._schedule, "Must be in a schedule to get service_period"
     return self._schedule.GetServicePeriod(self.service_id)
   elif name == 'pattern_id':
     if '_pattern_id' not in self.__dict__:
       self.__dict__['_pattern_id'] = hash(self.GetPattern())
     return self.__dict__['_pattern_id']
   else:
     return GtfsObjectBase.__getattr__(self, name)
Ejemplo n.º 4
0
  def __getattr__(self, name):
    """Return None or the default value if name is a known attribute.

    This method overrides GtfsObjectBase.__getattr__ to provide backwards
    compatible access to trips.
    """
    if name == 'trips':
      return self._trips
    else:
      return GtfsObjectBase.__getattr__(self, name)