src/eric7/Sessions/SessionFile.py

branch
eric7
changeset 10969
705b71b3fde6
parent 10968
b462c3d33ca0
child 11090
f5f5f5803935
--- a/src/eric7/Sessions/SessionFile.py	Sat Oct 12 13:00:39 2024 +0200
+++ b/src/eric7/Sessions/SessionFile.py	Sat Oct 12 16:41:06 2024 +0200
@@ -38,12 +38,15 @@
 
         self.__isGlobal = isGlobal
 
-    def writeFile(self, filename: str) -> bool:
+    def writeFile(self, filename: str, withServer: bool = True) -> bool:
         """
         Public method to write the session data to a session JSON file.
 
         @param filename name of the session file
         @type str
+        @param withServer flag indicating to save the current server connection
+            (defaults to True)
+        @type bool (optional)
         @return flag indicating a successful write
         @rtype bool
         """
@@ -74,9 +77,10 @@
 
         # step 1: eric-ide Server Connection
         # ==================================
-        sessionDict["RemoteServer"] = (
-            serverInterface.getHost() if serverInterface.isServerConnected() else ""
-        )
+        if withServer:
+            sessionDict["RemoteServer"] = (
+                serverInterface.getHost() if serverInterface.isServerConnected() else ""
+            )
 
         # step 2: open multi project and project for global session
         # =========================================================

eric ide

mercurial