E5XML/SessionWriter.py

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

eric ide

mercurial