SGroe / gpx-segment-importer

QGIS GPX Segment Importer Plugin
Apache License 2.0
2 stars 6 forks source link

Python Error on startup #6

Open FlyingEagle opened 2 months ago

FlyingEagle commented 2 months ago

An error has occurred while executing Python code:

TypeError: QgsProcessingParameterFile(): arguments did not match any overloaded call:   overload 1: argument 3 has unexpected type 'int'   overload 2: argument 1 has unexpected type 'str' 
Traceback (most recent call last):
  File "C:\Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GpxSegmentImporter\processing\gpx_segment_importer_algorithm.py", line 91, in initAlgorithm
    self.addParameter(QgsProcessingParameterFile(self.INPUT, self.tr('Input gpx file'),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: QgsProcessingParameterFile(): arguments did not match any overloaded call:
  overload 1: argument 3 has unexpected type 'int'
  overload 2: argument 1 has unexpected type 'str'

Python version: 3.12.3 (main, Apr 14 2024, 17:21:43) [MSC v.1938 64 bit (AMD64)] 
QGIS version: 3.36.2-Maidenhead Maidenhead, 6d250527 

Python Path:
C:\Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgissprp\sprp
C:/OSGeo4W/apps/qgis/./python
C:/Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis/./python/plugins
C:\OSGeo4W\apps\grass\grass83\etc\python
C:\Users\%MYUSERNAME%\Documents
C:\OSGeo4W\bin\python312.zip
C:\OSGeo4W\apps\Python312\DLLs
C:\OSGeo4W\apps\Python312\Lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python312
C:\OSGeo4W\apps\Python312\Lib\site-packages
C:\OSGeo4W\apps\Python312\Lib\site-packages\win32
C:\OSGeo4W\apps\Python312\Lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python312\Lib\site-packages\Pythonwin
C:/Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\%MYUSERNAME%\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
FlyingEagle commented 2 months ago

I correected line 91 to

       self.addParameter(QgsProcessingParameterFile(self.INPUT, self.tr('Input gpx file'),
                                                     QgsProcessingParameterFile.File, 'gpx', None, False))

after trying importing a GPX I got

2024-07-07T22:34:15     WARNING    Traceback (most recent call last):
              File "C:\Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GpxSegmentImporter\gui\gpx_segment_importer.py", line 163, in run
              self.process_gpx_files()
              File "C:\Users/%MYUSERNAME%/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GpxSegmentImporter\gui\gpx_segment_importer.py", line 197, in process_gpx_files
              if self.gpx_file_reader.equal_coordinates > 0:
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             AttributeError: 'SegmentBuilderFromGpx' object has no attribute 'equal_coordinates'. Did you mean: 'equal_coordinates_count'?
SGroe commented 2 months ago

Hi @FlyingEagle, thanks for raising this. Can you please test version 3.1? See my comments in #5 to retrieve it.

I plan to upload the new version to the plugin repository soon.