示例#1
0
文件: weather.py 项目: michlikv/alex
    def __init__(self, cfg):
        WeatherFinder.__init__(self)
        APIRequest.__init__(self, cfg, 'openweathermap', 'OpenWeatherMap query')
        self.weather_url = 'http://api.openweathermap.org/data/2.5/'

        self.celsius = True if cfg['weather']['units'] == 'celsius' else False
        self.suffix = cfg['weather']['suffix']
        self.load(cfg['weather']['dictionary'])
示例#2
0
 def __init__(self, cfg):
     DirectionsFinder.__init__(self)
     APIRequest.__init__(self, cfg, 'google-directions', 'Google directions query')
     self.directions_url = 'https://maps.googleapis.com/maps/api/directions/json'
     if 'key' in cfg['DM']['directions'].keys():
         self.api_key = cfg['DM']['directions']['key']
     else:
         self.api_key = None
示例#3
0
文件: weather.py 项目: vikrantt/alex
    def __init__(self, cfg):
        WeatherFinder.__init__(self)
        APIRequest.__init__(self, cfg, "openweathermap", "OpenWeatherMap query")
        self.weather_url = "http://api.openweathermap.org/data/2.5/"

        self.celsius = True if cfg["weather"]["units"] == "celsius" else False
        self.suffix = cfg["weather"]["suffix"]
        self.load(cfg["weather"]["dictionary"])
示例#4
0
    def __init__(self, cfg):
        WeatherFinder.__init__(self)
        APIRequest.__init__(self, cfg, 'openweathermap',
                            'OpenWeatherMap query')
        self.weather_url = 'http://api.openweathermap.org/data/2.5/'

        self.celsius = True if cfg['weather']['units'] == 'celsius' else False
        self.suffix = cfg['weather']['suffix']
        self.load(cfg['weather']['dictionary'])
示例#5
0
文件: directions.py 项目: AoJ/alex
 def __init__(self, cfg):
     DirectionsFinder.__init__(self)
     APIRequest.__init__(self, cfg, 'crws-directions', 'CRWS directions query')
     # create the client
     self.client = Client("http://crws.timetable.cz/CR.svc?wsdl")
     # obtain user information
     self.user_id = cfg['CRWS']['user_id']
     self.user_desc = cfg['CRWS']['user_desc']
     self.max_connections_count = cfg['CRWS']['max_connections_count']
     self.file_dir = os.path.dirname(os.path.abspath(__file__))
     # renew list of lists
     self.combinations = self._load_combination_info()
     self.default_comb_id = self.combinations[0]['_sID']
     # parse list of lists and get ID of cities list and stop names list
     self.city_list_id, self.stops_list_for_city = self._get_stop_list_ids()
     # load mapping from ALEX stops to IDOS stops and back
     self.mapping, self.reverse_mapping = self._load_stops_mapping()
示例#6
0
 def __init__(self, cfg):
     DirectionsFinder.__init__(self)
     APIRequest.__init__(self, cfg, 'crws-directions',
                         'CRWS directions query')
     # create the client
     self.client = Client("http://crws.timetable.cz/CR.svc?wsdl")
     # obtain user information
     self.user_id = cfg['CRWS']['user_id']
     self.user_desc = cfg['CRWS']['user_desc']
     self.max_connections_count = cfg['CRWS']['max_connections_count']
     self.file_dir = os.path.dirname(os.path.abspath(__file__))
     # renew list of lists
     self.combinations = self._load_combination_info()
     self.default_comb_id = self.combinations[0]['_sID']
     # parse list of lists and get ID of cities list and stop names list
     self.city_list_id, self.stops_list_for_city = self._get_stop_list_ids()
     # load mapping from ALEX stops to IDOS stops and back
     self.mapping, self.reverse_mapping = self._load_stops_mapping()
示例#7
0
 def __init__(self, cfg):
     APIRequest.__init__(self, cfg, 'openweathermap', 'OpenWeatherMap query')
示例#8
0
 def __init__(self, cfg):
     DirectionsFinder.__init__(self)
     APIRequest.__init__(self, cfg, 'google-directions',
                         'Google directions query')
     self.directions_url = 'http://maps.googleapis.com/maps/api/directions/json'
示例#9
0
 def __init__(self, cfg):
     DirectionsFinder.__init__(self)
     APIRequest.__init__(self, cfg, 'google-directions', 'Google directions query')
     self.directions_url = 'http://maps.googleapis.com/maps/api/directions/json'
示例#10
0
 def __init__(self, cfg):
     APIRequest.__init__(self, cfg, 'openweathermap',
                         'OpenWeatherMap query')
示例#11
0
文件: weather.py 项目: tkraut/alex
 def __init__(self, cfg):
     WeatherFinder.__init__(self)
     APIRequest.__init__(self, cfg, 'openweathermap', 'OpenWeatherMap query')
     self.weather_url = 'http://api.openweathermap.org/data/2.5/'