(self, file_name: str, timezone_adjuster: typing.Optional[TimezoneAdjuster])
Load the GPX file into self.

        Args:
            file_name: GPX file to be loaded.
            timezone_adjuster: timezone adjuster

        Raises:
            TrackLoadError: An error occurred while parsing the GPX file (empty or bad format).
            PermissionError: An error occurred while opening the GPX file.
Load the GPX file into self.
Load the GPX file into self .
def load_gpx(self, file_name: str, timezone_adjuster: typing.Optional[TimezoneAdjuster]) -> None:
        """Load the GPX file into self.

        Args:
            file_name: GPX file to be loaded.
            timezone_adjuster: timezone adjuster

        Raises:
            TrackLoadError: An error occurred while parsing the GPX file (empty or bad format).
            PermissionError: An error occurred while opening the GPX file.
        """
        try:
            self.file_names = [os.path.basename(file_name)]
            # Handle empty gpx files
            # (for example, treadmill runs pulled via garmin-connect-export)
            if os.path.getsize(file_name) == 0:
                raise TrackLoadError("Empty GPX file")
            with open(file_name, "r", encoding="utf8") as file:
                self._load_gpx_data(gpxpy.parse(file), timezone_adjuster)
        except TrackLoadError as e:
            raise e
        except gpxpy.gpx.GPXXMLSyntaxException as e:
            raise TrackLoadError("Failed to parse GPX.") from e
        except PermissionError as e:
            raise TrackLoadError("Cannot load GPX (bad permissions)") from e
        except Exception as e:
            raise TrackLoadError("Something went wrong when loading GPX.") from e
def load_gpx ( self , file_name : str , timezone_adjuster : typing . Optional [ TimezoneAdjuster ] ) -> None : try : self . file_names = [ os . path . basename ( file_name ) ] # Handle empty gpx files # (for example, treadmill runs pulled via garmin-connect-export) if os . path . getsize ( file_name ) == 0 : raise TrackLoadError ( "Empty GPX file" ) with open ( file_name , "r" , encoding = "utf8" ) as file : self . _load_gpx_data ( gpxpy . parse ( file ) , timezone_adjuster ) except TrackLoadError as e : raise e except gpxpy . gpx . GPXXMLSyntaxException as e : raise TrackLoadError ( "Failed to parse GPX." ) from e except PermissionError as e : raise TrackLoadError ( "Cannot load GPX (bad permissions)" ) from e except Exception as e : raise TrackLoadError ( "Something went wrong when loading GPX." ) from e