From c0fb3a005c5e68d063945a7696364916d05f176b Mon Sep 17 00:00:00 2001
From: ldam <ldam@passcal.nmt.edu>
Date: Mon, 4 Sep 2023 08:50:40 -0600
Subject: [PATCH] fix bug for path's name when saving GPS file

---
 sohstationviewer/view/plotting/gps_plot/gps_dialog.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sohstationviewer/view/plotting/gps_plot/gps_dialog.py b/sohstationviewer/view/plotting/gps_plot/gps_dialog.py
index 006f426f1..b5703c5b1 100644
--- a/sohstationviewer/view/plotting/gps_plot/gps_dialog.py
+++ b/sohstationviewer/view/plotting/gps_plot/gps_dialog.py
@@ -190,7 +190,7 @@ class GPSDialog(QtWidgets.QWidget):
         super().__init__()
         self.parent = parent
 
-        self.data_path: Optional[Path] = None
+        self.data_path: Optional[Path, str] = None
         # The directory the GPS will be exported to. By default, this will be
         # the folder that contains the data set.
         self.export_path: Path = Path.home()
@@ -353,8 +353,10 @@ class GPSDialog(QtWidgets.QWidget):
             msg = 'There is no GPS data to export.'
             display_tracking_info(self.info_text_browser, msg, LogType.ERROR)
             return
-
-        folder_name = self.data_path.name
+        try:
+            folder_name = self.data_path.name
+        except AttributeError:
+            folder_name = self.data_path
         export_file_path = self.export_path / f'{folder_name}.gps.dat'
 
         try:
-- 
GitLab