bug 7368 : Geography gramplet does not communicate over proxy server with autorisation.

This commit is contained in:
noirauds 2014-02-08 13:11:16 +01:00
parent cab29ca2b6
commit 32d2ef4b5e

View File

@ -133,11 +133,18 @@ class OsmGps():
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']
if 0: if 0:
self.osm = DummyMapNoGpsPoint() self.osm = DummyMapNoGpsPoint()
else: else:
self.osm = osmgpsmap.Map(tile_cache=tiles_path, if http_proxy == "":
map_source=constants.map_type[map_type]) self.osm = osmgpsmap.Map(tile_cache=tiles_path,
map_source=constants.map_type[map_type])
else:
self.osm = osmgpsmap.Map(tile_cache=tiles_path,
proxy_uri=http_proxy,
map_source=constants.map_type[map_type])
self.osm.props.tile_cache = osmgpsmap.MAP_CACHE_AUTO
current_map = osmgpsmap.MapOsd( show_dpad=False, show_zoom=True) current_map = osmgpsmap.MapOsd( show_dpad=False, show_zoom=True)
self.end_selection = None self.end_selection = None
self.osm.layer_add(current_map) self.osm.layer_add(current_map)