4141from mslib .utils import config_loader
4242from PyQt5 import QtCore , QtGui , QtWidgets
4343
44- import mslib .ogcwms
4544import owslib .util
4645from owslib .crs import axisorder_yx
4746from PIL import Image , ImageOps
4847
48+ from mslib .msui import constants , wms_capabilities
4949from mslib .msui .mss_qt import ui_wms_dockwidget as ui
5050from mslib .msui .mss_qt import ui_wms_password_dialog as ui_pw
51- from mslib .msui import wms_capabilities
52- from mslib .msui import constants
53- from mslib .utils import parse_iso_datetime , parse_iso_duration , load_settings_qsettings , save_settings_qsettings , Worker
54- from mslib .ogcwms import openURL , removeXMLNamespace
5551from mslib .msui .multilayers import Multilayers , Layer
52+ from mslib .utils import (
53+ ogcwms , parse_iso_datetime , parse_iso_duration , load_settings_qsettings ,
54+ save_settings_qsettings , Worker )
5655
5756
5857WMS_SERVICE_CACHE = {}
@@ -65,7 +64,7 @@ def add_wms_urls(combo_box, url_list):
6564 combo_box .addItem (url )
6665
6766
68- class MSSWebMapService (mslib . ogcwms .WebMapService ):
67+ class MSSWebMapService (ogcwms .WebMapService ):
6968 """Overloads the getmap() method of owslib.wms.WebMapService:
7069
7170 added parameters are
@@ -201,8 +200,8 @@ def getmap(self, layers=None, styles=None, srs=None, bbox=None,
201200 # not considered. For some reason, the check below doesn't work, though..
202201 proxies = config_loader (dataset = "proxies" )
203202
204- u = openURL (base_url , data , method ,
205- username = self .auth .username , password = self .auth .password , proxies = proxies )
203+ u = ogcwms . openURL (base_url , data , method ,
204+ username = self .auth .username , password = self .auth .password , proxies = proxies )
206205
207206 # check for service exceptions, and return
208207 # NOTE: There is little bug in owslib.util.openURL -- if the file
@@ -215,7 +214,8 @@ def getmap(self, layers=None, styles=None, srs=None, bbox=None,
215214 se_xml = u .read ()
216215 se_tree = etree .fromstring (se_xml )
217216 # Remove namespaces in the response, otherwise this code might fail
218- removeXMLNamespace (se_tree )
217+ # (mslib) add ogcwms
218+ ogcwms .removeXMLNamespace (se_tree )
219219 err_message = str (se_tree .find ('ServiceException' ).text ).strip ()
220220 raise owslib .util .ServiceException (err_message , se_xml )
221221 return u
0 commit comments