51 self.writeDTD('<!DOCTYPE Session SYSTEM "Session-{0}.dtd">'.format( |
51 self.writeDTD('<!DOCTYPE Session SYSTEM "Session-{0}.dtd">'.format( |
52 sessionFileFormatVersion)) |
52 sessionFileFormatVersion)) |
53 |
53 |
54 # add some generation comments |
54 # add some generation comments |
55 if not isGlobal: |
55 if not isGlobal: |
56 self.writeComment(" eric5 session file for project {0} ".format(self.name)) |
56 self.writeComment( |
57 self.writeComment(" This file was generated automatically, do not edit. ") |
57 " eric5 session file for project {0} ".format(self.name)) |
|
58 self.writeComment( |
|
59 " This file was generated automatically, do not edit. ") |
58 if Preferences.getProject("XMLTimestamp") or isGlobal: |
60 if Preferences.getProject("XMLTimestamp") or isGlobal: |
59 self.writeComment(" Saved: {0} ".format(time.strftime('%Y-%m-%d, %H:%M:%S'))) |
61 self.writeComment( |
|
62 " Saved: {0} ".format(time.strftime('%Y-%m-%d, %H:%M:%S'))) |
60 |
63 |
61 # add the main tag |
64 # add the main tag |
62 self.writeStartElement("Session") |
65 self.writeStartElement("Session") |
63 self.writeAttribute("version", sessionFileFormatVersion) |
66 self.writeAttribute("version", sessionFileFormatVersion) |
64 |
67 |
134 # step 2b: save all watch expressions |
137 # step 2b: save all watch expressions |
135 self.writeStartElement("Watchexpressions") |
138 self.writeStartElement("Watchexpressions") |
136 wpModel = self.dbs.getWatchPointModel() |
139 wpModel = self.dbs.getWatchPointModel() |
137 for row in range(wpModel.rowCount()): |
140 for row in range(wpModel.rowCount()): |
138 index = wpModel.index(row, 0) |
141 index = wpModel.index(row, 0) |
139 cond, temp, enabled, count, special = wpModel.getWatchPointByIndex(index)[:5] |
142 cond, temp, enabled, count, special = \ |
|
143 wpModel.getWatchPointByIndex(index)[:5] |
140 self.writeStartElement("Watchexpression") |
144 self.writeStartElement("Watchexpression") |
141 self.writeTextElement("Condition", str(cond)) |
145 self.writeTextElement("Condition", str(cond)) |
142 self.writeEmptyElement("Temporary") |
146 self.writeEmptyElement("Temporary") |
143 self.writeAttribute("value", str(temp)) |
147 self.writeAttribute("value", str(temp)) |
144 self.writeEmptyElement("Enabled") |
148 self.writeEmptyElement("Enabled") |
181 self.writeAttribute("value", str(self.dbg.autoClearShell)) |
185 self.writeAttribute("value", str(self.dbg.autoClearShell)) |
182 self.writeEmptyElement("TracePython") |
186 self.writeEmptyElement("TracePython") |
183 self.writeAttribute("value", str(self.dbg.tracePython)) |
187 self.writeAttribute("value", str(self.dbg.tracePython)) |
184 self.writeEmptyElement("AutoContinue") |
188 self.writeEmptyElement("AutoContinue") |
185 self.writeAttribute("value", str(self.dbg.autoContinue)) |
189 self.writeAttribute("value", str(self.dbg.autoContinue)) |
186 self.writeEmptyElement("CovexcPattern") # kept for compatibility |
190 self.writeEmptyElement("CovexcPattern") # kept for compatibility |
187 else: |
191 else: |
188 self.writeTextElement("CommandLine", self.project.dbgCmdline) |
192 self.writeTextElement("CommandLine", self.project.dbgCmdline) |
189 self.writeTextElement("WorkingDirectory", self.project.dbgWd) |
193 self.writeTextElement("WorkingDirectory", self.project.dbgWd) |
190 self.writeTextElement("Environment", self.project.dbgEnv) |
194 self.writeTextElement("Environment", self.project.dbgEnv) |
191 self.writeEmptyElement("ReportExceptions") |
195 self.writeEmptyElement("ReportExceptions") |
202 self.writeAttribute("value", str(self.project.dbgAutoClearShell)) |
206 self.writeAttribute("value", str(self.project.dbgAutoClearShell)) |
203 self.writeEmptyElement("TracePython") |
207 self.writeEmptyElement("TracePython") |
204 self.writeAttribute("value", str(self.project.dbgTracePython)) |
208 self.writeAttribute("value", str(self.project.dbgTracePython)) |
205 self.writeEmptyElement("AutoContinue") |
209 self.writeEmptyElement("AutoContinue") |
206 self.writeAttribute("value", str(self.project.dbgAutoContinue)) |
210 self.writeAttribute("value", str(self.project.dbgAutoContinue)) |
207 self.writeEmptyElement("CovexcPattern") # kept for compatibility |
211 self.writeEmptyElement("CovexcPattern") # kept for compatibility |
208 self.writeEndElement() |
212 self.writeEndElement() |
209 |
213 |
210 # step 4: save bookmarks of all open (project) files |
214 # step 4: save bookmarks of all open (project) files |
211 self.writeStartElement("Bookmarks") |
215 self.writeStartElement("Bookmarks") |
212 for of in allOpenFiles: |
216 for of in allOpenFiles: |