Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksMat committed Apr 18, 2018
1 parent 3927dc8 commit ce9c616
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SentinelHub/SentinelHub.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ def set_values(self):

def get_plugin_version(self):
try:
for line in open(os.path.join(self.plugin_dir, 'metadata.txt')):
if line.startswith('version'):
return line.split("=")[1].strip()
with open(os.path.join(self.plugin_dir, 'metadata.txt')) as metadata_file:
for line in metadata_file:
if line.startswith('version'):
return line.split("=")[1].strip()
except IOError:
return '?'

Expand Down Expand Up @@ -315,7 +316,7 @@ def update_current_wms_layers(self, selected_layer=None):

def get_qgis_layers(self):
if is_qgis_version_3():
return list(QgsProject.instance().layerTreeRoot().findLayers())
return [tree_layer.layer() for tree_layer in QgsProject.instance().layerTreeRoot().findLayers()]
return self.iface.legendInterface().layers()

# --------------------------------------------------------------------------
Expand Down

0 comments on commit ce9c616

Please sign in to comment.