Skip to content

Commit

Permalink
Python2 to Python3 - isogeo.py
Browse files Browse the repository at this point in the history
dict().keys() doesn't return a list() in Python 3 so you need to use list(dict().keys) if you want to use .pop() method on the returned object
  • Loading branch information
SimonSAMPERE committed Jun 14, 2019
1 parent 1a8fda0 commit d13cf4a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions isogeo.py
Expand Up @@ -1039,7 +1039,7 @@ def search(self):
"{}/resources/search?&_limit=0"
.format(plg_api_mngr.api_url_base))
# Refresh the quick searches comboboxes content
search_list = saved_searches.keys()
search_list = list(saved_searches.keys())
search_list.pop(search_list.index('_default'))
search_list.pop(search_list.index('_current'))
self.dockwidget.cbb_quicksearch_use.clear()
Expand Down Expand Up @@ -1302,7 +1302,7 @@ def quicksearch_save(self):
# load all saved quicksearches and populate drop-down (combobox)
with open(self.json_path, "r") as saved_searches_file:
saved_searches = json.load(saved_searches_file)
search_list = saved_searches.keys()
search_list = list(saved_searches.keys())
search_list.pop(search_list.index('_default'))
search_list.pop(search_list.index('_current'))
self.dockwidget.cbb_quicksearch_use.clear()
Expand All @@ -1322,7 +1322,7 @@ def quicksearch_rename(self):
new_name = self.quicksearch_rename_dialog.txt_quicksearch_rename.text()
saved_searches[new_name] = saved_searches[old_name]
saved_searches.pop(old_name)
search_list = saved_searches.keys()
search_list = list(saved_searches.keys())
search_list.pop(search_list.index('_default'))
search_list.pop(search_list.index('_current'))
self.dockwidget.cbb_quicksearch_use.clear()
Expand Down Expand Up @@ -1350,7 +1350,7 @@ def quicksearch_remove(self):
with open(self.json_path, "r") as saved_searches_file:
saved_searches = json.load(saved_searches_file)
saved_searches.pop(to_be_deleted)
search_list = saved_searches.keys()
search_list = list(saved_searches.keys())
search_list.pop(search_list.index('_default'))
search_list.pop(search_list.index('_current'))
self.dockwidget.cbb_quicksearch_use.clear()
Expand Down

0 comments on commit d13cf4a

Please sign in to comment.