Selaa lähdekoodia

Python2 fixes

Anika Bettge 6 vuotta sitten
vanhempi
commit
71754da639
2 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 3 3
      scripts/r.in.wms/wms_base.py
  2. 2 2
      scripts/r.in.wms/wms_gdal_drv.py

+ 3 - 3
scripts/r.in.wms/wms_base.py

@@ -32,7 +32,7 @@ import grass.script as grass
 from grass.exceptions import CalledModuleError
 
 
-class WMSBase:
+class WMSBase(object):
 
     def __init__(self):
         # these variables are information for destructor
@@ -127,7 +127,7 @@ class WMSBase:
         if 'epsg' in target_crs.keys():
             self.target_epsg = target_crs['epsg']
             if self.source_epsg != self.target_epsg:
-                grass.warning(_("SRS differences: WMS source EPSG %s != location EPSG %s (use srs=%s to adjust)") % 
+                grass.warning(_("SRS differences: WMS source EPSG %s != location EPSG %s (use srs=%s to adjust)") %
                               (self.source_epsg, self.target_epsg, self.target_epsg))
 
         self.proj_srs = grass.read_command('g.proj',
@@ -382,7 +382,7 @@ class WMSBase:
         if self.source_epsg is not None and self.target_epsg is not None \
             and self.source_epsg == self.target_epsg:
             do_reproject = False
-        # TODO: correctly compare source and target crs 
+        # TODO: correctly compare source and target crs
         if do_reproject == True and self.proj_srs == self.proj_location:
             do_reproject = False
         if do_reproject:

+ 2 - 2
scripts/r.in.wms/wms_gdal_drv.py

@@ -143,9 +143,9 @@ class WMSGdalDrv(WMSBase):
         xml_file = self._createXML()
 
         if self.proxy:
-            gdal.SetConfigOption('GDAL_HTTP_PROXY', self.proxy)
+            gdal.SetConfigOption('GDAL_HTTP_PROXY', str(self.proxy))
         if self.proxy_user_pw:
-            gdal.SetConfigOption('GDAL_HTTP_PROXYUSERPWD', self.proxy_user_pw)
+            gdal.SetConfigOption('GDAL_HTTP_PROXYUSERPWD', str(self.proxy_user_pw))
         wms_dataset = gdal.Open(xml_file, gdal.GA_ReadOnly)
         grass.try_remove(xml_file)
         if wms_dataset is None: