bug 7368 : os.environ['http_proxy'] gives an error if http_proxy is not set.

This commit is contained in:
noirauds 2014-02-09 11:02:01 +01:00
parent ca8f2626c4
commit 2c2f42be55

View File

@ -188,16 +188,16 @@ class osmGpsMap():
constants.map_title[map_type]) constants.map_title[map_type])
config.set("geography.map_service", map_type) config.set("geography.map_service", map_type)
self.current_map = map_type self.current_map = map_type
http_proxy = os.environ['http_proxy'] http_proxy = os.environ.get('http_proxy')
if 0: if 0:
self.osm = DummyMapNoGpsPoint() self.osm = DummyMapNoGpsPoint()
else: else:
if http_proxy == "": if http_proxy:
self.osm = osmgpsmap.GpsMap(tile_cache=tiles_path, self.osm = osmgpsmap.GpsMap(tile_cache=tiles_path,
proxy_uri=http_proxy,
map_source=constants.map_type[map_type]) map_source=constants.map_type[map_type])
else: else:
self.osm = osmgpsmap.GpsMap(tile_cache=tiles_path, self.osm = osmgpsmap.GpsMap(tile_cache=tiles_path,
proxy_uri=http_proxy,
map_source=constants.map_type[map_type]) map_source=constants.map_type[map_type])
current_map = osmgpsmap.GpsMapOsd( show_dpad=False, show_zoom=True) current_map = osmgpsmap.GpsMapOsd( show_dpad=False, show_zoom=True)
self.end_selection = None self.end_selection = None