Exemple #1
0
 def refresh_station(self, station):
     self.left_station = station.get('left')
     self.arrive_station = station.get('arrive')
     self.left_station_code = Station.get_station_key_by_name(
         self.left_station)
     self.arrive_station_code = Station.get_station_key_by_name(
         self.arrive_station)
Exemple #2
0
    def __init__(self, info, query):
        self.left_dates = info.get('left_dates')
        self.left_station = info.get('stations').get('left')
        self.arrive_station = info.get('stations').get('arrive')
        self.left_station_code = Station.get_station_key_by_name(self.left_station)
        self.arrive_station_code = Station.get_station_key_by_name(self.arrive_station)

        self.account_key = info.get('account_key')
        self.allow_seats = info.get('seats')
        self.allow_train_numbers = info.get('train_numbers')
        self.members = info.get('members')
        self.member_num = len(self.members)
        self.member_num_take = self.member_num
        self.allow_less_member = bool(info.get('allow_less_member'))

        self.interval = query.interval
        self.query = query
Exemple #3
0
 def get_info_of_arrive_station(self):
     return Station.get_station_name_by_key(
         self.ticket_info[self.INDEX_ARRIVE_STATION])
Exemple #4
0
 def get_info_of_left_station(self):
     return Station.get_station_name_by_key(
         self.ticket_info[self.INDEX_LEFT_STATION])
Exemple #5
0
 def did_start(cls):
     self = cls()
     from py12306.helpers.station import Station
     Station()  # 防止多线程时初始化出现问题