kbgg / qgis-stac-browser

Plugin for QGIS to browse and download assets from STAC APIs
Apache License 2.0
26 stars 9 forks source link

strip slash from url when adding new endpoint #87

Open volaya opened 3 years ago

koyo-jakanees commented 3 years ago

Victor i tried the quick fix for urls. (dev branch) got this.

Traceback (most recent call last):
              File "/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins/stac_browser/controllers/add_edit_api_dialog.py", line 75, in on_api_success
              self.hooks['add_api'](api)
              File "/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins/stac_browser/controllers/configure_apis_dialog.py", line 77, in add_api
              api = api.strip("/")
             AttributeError: 'API' object has no attribute 'strip'

I have noticed the same issue with most urls if trailing slash is included. Quick Fix: controller/add_edit_api_dialog.py

    def on_save_add_clicked(self):
        self.set_all_enabled(False)
        .............
        api = API({'id': api_id, 'href': self.urlEditBox.text().strip("/")})

works fine

volaya commented 3 years ago

right, my fault. Thanks for the fix