planetfederal / qgis-geoserver-plugin

GNU General Public License v2.0
63 stars 52 forks source link

Python error when clicking "edit" on style #54

Open gioman opened 7 years ago

gioman commented 7 years ago

This happens if the layer (for example a point one) has been imported with a SVG symbology:

IOError: [Errno 22] invalid mode ('r') or filename: u'' 
Traceback (most recent call last):
  File "C:/Users/qgis/.qgis2/python/plugins\geoserverexplorer\gui\gsexploreritems.py", line 1112, in 
    editStyleAction.triggered.connect(lambda: self.editStyle(tree, explorer, self.parent().element))
  File "C:/Users/qgis/.qgis2/python/plugins\geoserverexplorer\gui\gsexploreritems.py", line 1177, in editStyle
    oldSld = getGsCompatibleSld(layer)[0]
  File "C:/Users/qgis/.qgis2/python/plugins\geoserverexplorer\qgis\sldadapter.py", line 212, in getGsCompatibleSld
    return adaptQgsToGs(sld, layer)
  File "C:/Users/qgis/.qgis2/python/plugins\geoserverexplorer\qgis\sldadapter.py", line 89, in adaptQgsToGs
    icons = getReadyToUploadSvgIcons(renderer.symbol())
  File "C:/Users/qgis/.qgis2/python/plugins\geoserverexplorer\qgis\sldadapter.py", line 114, in getReadyToUploadSvgIcons
    with open(sl.path()) as f:
IOError: [Errno 22] invalid mode ('r') or filename: u''
gioman commented 7 years ago

cannot check if this is still valid because of https://github.com/boundlessgeo/qgis-geoserver-plugin/issues/68 @volaya

gioman commented 7 years ago

On master revision code against GS 2.11 the error is now

IOError: [Errno 2] No such file or directory: u'' 
Traceback (most recent call last):
  File "/home/giovanni/.qgis2/python/plugins/geoserverexplorer/gui/gsexploreritems.py", line 1130, in 
    editStyleAction.triggered.connect(lambda: self.editStyle(tree, explorer))
  File "/home/giovanni/.qgis2/python/plugins/geoserverexplorer/gui/gsexploreritems.py", line 1186, in editStyle
    oldSld = getGsCompatibleSld(layer)[0]
  File "/home/giovanni/.qgis2/python/plugins/geoserverexplorer/qgis/sldadapter.py", line 219, in getGsCompatibleSld
    return adaptQgsToGs(sld, layer)
  File "/home/giovanni/.qgis2/python/plugins/geoserverexplorer/qgis/sldadapter.py", line 96, in adaptQgsToGs
    icons = getReadyToUploadSvgIcons(renderer.symbol())
  File "/home/giovanni/.qgis2/python/plugins/geoserverexplorer/qgis/sldadapter.py", line 121, in getReadyToUploadSvgIcons
    with open(sl.path()) as f:
IOError: [Errno 2] No such file or directory: u''