Beispiel #1
0
def get_station_info_list(cfg):
    station_url = cfg.get(
        'config', 'url_base') + '/resources/js/framework/station_name.js'
    station_vars = connection.request_server(station_url, 'get', 'text')
    station_str = station_vars[21:-2]
    _list = station_str.split('@')
    return _list
Beispiel #2
0
 def get_station_info_list(self):
     station_name_file_name = self.config.get('config', 'station_name_file_name')
     if os.path.exists(station_name_file_name):
         with open(station_name_file_name, 'rt', encoding='utf8') as f0:
             station_str = f0.read()
     else:
         station_url = self.config.get('config', 'url_base') + '/resources/js/framework/station_name.js'
         station_vars = connection.request_server(station_url, 'get', 'text')
         station_str = station_vars[21:-2]
         if self.config.getboolean('config', 'save_staion_name_file'):
             with open(station_name_file_name, 'wt', encoding='utf8') as f1:
                 f1.write(station_str)
     return station_str.split('@')
Beispiel #3
0
 def get_station_info_list(self):
     station_name_file_name = self.config.get('config',
                                              'station_name_file_name')
     if os.path.exists(station_name_file_name):
         with open(station_name_file_name, 'rt', encoding='utf8') as f0:
             station_str = f0.read()
     else:
         station_url = self.config.get(
             'config',
             'url_base') + '/resources/js/framework/station_name.js'
         station_vars = connection.request_server(station_url, 'get',
                                                  'text')
         station_str = station_vars[21:-2]
         if self.config.getboolean('config', 'save_staion_name_file'):
             with open(station_name_file_name, 'wt', encoding='utf8') as f1:
                 f1.write(station_str)
     return station_str.split('@')
Beispiel #4
0
def get_railway_info(start_station, end_station, cfg):
    query_uri = cfg.get('config','url_base') + '/lcxxcx/query?purpose_codes=ADULT&queryDate={}&from_station={}&to_station={}'\
        .format(time.strftime('%Y-%m-%d', time.localtime(time.time()+86400)), start_station, end_station)
    return connection.request_server(query_uri)
Beispiel #5
0
 def get_railway_info(self, start_station, end_station, date_time):
     query_uri = self.url_base + '/lcxxcx/query?purpose_codes=ADULT&queryDate={}&from_station={}&to_station={}'\
     .format(date_time, start_station, end_station)
     return connection.request_server(query_uri)
Beispiel #6
0
def get_railway_info(start_station, end_station,cfg):
    query_uri = cfg.get('config','url_base') + '/lcxxcx/query?purpose_codes=ADULT&queryDate={}&from_station={}&to_station={}'\
        .format(time.strftime('%Y-%m-%d', time.localtime(time.time()+86400)), start_station, end_station)
    return connection.request_server(query_uri)
Beispiel #7
0
def get_station_info_list(cfg):
    station_url = cfg.get('config','url_base') + '/resources/js/framework/station_name.js'
    station_vars = connection.request_server(station_url, 'get', 'text')
    station_str = station_vars[21:-2]
    _list = station_str.split('@')
    return _list
Beispiel #8
0
 def get_railway_info(self, start_station, end_station, date_time):
     query_uri = self.url_base + '/lcxxcx/query?purpose_codes=ADULT&queryDate={}&from_station={}&to_station={}'\
     .format(date_time, start_station, end_station)
     return connection.request_server(query_uri)