--- a/eric6/Sessions/SessionFile.py Wed Jan 27 18:27:52 2021 +0100 +++ b/eric6/Sessions/SessionFile.py Wed Jan 27 18:29:25 2021 +0100 @@ -9,7 +9,6 @@ """ import json -import os import time from PyQt5.QtCore import QObject @@ -29,8 +28,8 @@ """ Constructor - @param project reference to the project object - @type Project + @param isGlobal flag indicating a file for a global session + @type bool @param parent reference to the parent object @type QObject (optional) """ @@ -40,10 +39,9 @@ def writeFile(self, filename: str) -> bool: """ - Public method to write the project debugger properties data to a - project debugger properties JSON file. + Public method to write the session data to a session JSON file. - @param filename name of the user project file + @param filename name of the session file @type str @return flag indicating a successful write @rtype bool @@ -56,16 +54,15 @@ dbg = e5App().getObject("DebugUI") dbs = e5App().getObject("DebugServer") - name = os.path.splitext(os.path.basename(filename))[0] - # prepare the session data dictionary # step 0: header sessionDict = {} sessionDict["header"] = {} if not self.__isGlobal: sessionDict["header"]["comment"] = ( - f"eric session file for project {name}" - ) + "eric session file for project {0}" + .format(project.getProjectName()) + ) sessionDict["header"]["warning"] = ( "This file was generated automatically, do not edit." ) @@ -259,10 +256,10 @@ except (EnvironmentError, json.JSONDecodeError) as err: E5MessageBox.critical( None, - self.tr("Read Debugger Properties"), + self.tr("Read Session"), self.tr( - "<p>The project debugger properties file <b>{0}</b>" - " could not be read.</p><p>Reason: {1}</p>" + "<p>The session file <b>{0}</b> could not be read.</p>" + "<p>Reason: {1}</p>" ).format(filename, str(err)) ) return False