E5XML/SessionReader.py

Mon, 25 Mar 2013 03:11:06 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Mon, 25 Mar 2013 03:11:06 +0100
branch
Py2 comp.
changeset 2525
8b507a9a2d40
parent 2302
f29e9405c851
child 3057
10516539f238
permissions
-rw-r--r--

Script changes: Future import added, super calls modified and unicode behavior for str.

599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
2302
f29e9405c851 Updated copyright for 2013.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
3 # Copyright (c) 2010 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a class for reading an XML session file.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
10 from __future__ import unicode_literals # __IGNORE_WARNING__
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2302
diff changeset
11
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from E5Gui.E5Application import e5App
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from .Config import sessionFileFormatVersion
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from .XMLStreamReaderBase import XMLStreamReaderBase
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 938
diff changeset
17
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 class SessionReader(XMLStreamReaderBase):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 Class for reading an XML session file.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 supportedVersions = ["4.3", "4.4"]
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 def __init__(self, device, isGlobal):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Constructor
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param device reference to the I/O device to read from (QIODevice)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param isGlobal flag indicating to read the global session (boolean).
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 XMLStreamReaderBase.__init__(self, device)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.version = ""
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.isGlobal = isGlobal
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 self.project = e5App().getObject("Project")
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 self.multiProject = e5App().getObject("MultiProject")
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.vm = e5App().getObject("ViewManager")
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39 self.dbg = e5App().getObject("DebugUI")
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.dbs = e5App().getObject("DebugServer")
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 # clear all breakpoints and bookmarks first
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 # (in case we are rereading a session file)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 files = self.project.getSources(True)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 for file in files:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 editor = self.vm.getOpenEditor(file)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 if editor is not None:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 editor.clearBookmarks()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 self.dbs.getBreakPointModel().deleteAll()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.dbs.getWatchPointModel().deleteAll()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 938
diff changeset
53 def readXML(self, quiet=False):
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 Public method to read and parse the XML document.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 @param quiet flag indicating quiet operations.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 If this flag is true, no errors are reported.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 if self.name() == "Session":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 self.version = self.attribute("version", sessionFileFormatVersion)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 if self.version not in self.supportedVersions:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 self.raiseUnsupportedFormatVersion(self.version)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 elif self.name() == "MultiProject":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 self.multiProject.openMultiProject(self.readElementText(), False)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 elif self.name() == "Project":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 self.project.openProject(self.readElementText(), False)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 elif self.name() == "Filenames":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 self.__readFilenames()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 elif self.name() == "ActiveWindow":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 cline = int(self.attribute("cline", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 cindex = int(self.attribute("cindex", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 filename = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 self.vm.openFiles(filename)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 ed = self.vm.getOpenEditor(filename)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 if ed is not None:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 ed.setCursorPosition(cline, cindex)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 ed.ensureCursorVisible()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 elif self.name() == "Breakpoints":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 self.__readBreakpoints()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 elif self.name() == "Watchexpressions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 self.__readWatchexpressions()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 elif self.name() == "DebugInfo":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.__readDebugInfo()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 elif self.name() == "Bookmarks":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.__readBookmarks()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 if not quiet:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 self.showErrorMessage()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 def __readFilenames(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 Private method to read the file name infos.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 if self.isEndElement() and self.name() == "Filenames":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 if self.name() == "Filename":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 cline = int(self.attribute("cline", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 cindex = int(self.attribute("cindex", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 folds = self.attribute("folds")
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 if folds:
938
f421f2138c0f Adjusted code to use the QScintilla contractedFolds() and setContractedFolds() methods (as of QScintilla 2.5).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
111 folds = [int(f) - 1 for f in folds.split(',')]
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 folds = []
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 zoom = int(self.attribute("zoom", "-9999"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 filename = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.vm.openFiles(filename)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 ed = self.vm.getOpenEditor(filename)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 if ed is not None:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 if zoom > -9999:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 ed.zoomTo(zoom)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 if folds:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 ed.recolor()
938
f421f2138c0f Adjusted code to use the QScintilla contractedFolds() and setContractedFolds() methods (as of QScintilla 2.5).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
124 ed.setContractedFolds(folds)
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 ed.setCursorPosition(cline, cindex)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 ed.ensureCursorVisible()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 def __readBreakpoints(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 Private method to read the break point infos.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 if self.isEndElement() and self.name() == "Breakpoints":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 if self.name() == "Breakpoint":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 self.__readBreakpoint()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 def __readBreakpoint(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 Private method to read the break point info.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 filename = ""
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 lineno = 0
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151 bpCond = ""
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 bpTemp = False
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 bpEnabled = True
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 bpCount = 0
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 if self.isEndElement() and self.name() == "Breakpoint":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 self.dbs.getBreakPointModel().addBreakPoint(filename, lineno,
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160 (bpCond, bpTemp, bpEnabled, bpCount))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 if self.name() == "BpFilename":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 filename = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 elif self.name() == "Linenumber":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 lineno = int(self.attribute("value", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 elif self.name() == "Condition":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 bpCond = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 if bpCond == 'None':
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 bpCond = ''
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 elif self.name() == "Temporary":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 bpTemp = self.toBool(self.attribute("value", "False"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 elif self.name() == "Enabled":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 bpEnabled = self.toBool(self.attribute("value", "True"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 elif self.name() == "Count":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 bpCount = int(self.attribute("value", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 def __readWatchexpressions(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 Private method to read watch expression infos.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187 if self.isEndElement() and self.name() == "Watchexpressions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 if self.name() == "Watchexpression":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 self.__readWatchexpression()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 def __readWatchexpression(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 Private method to read the watch expression info.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 weCond = ""
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 weTemp = False
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 weEnabled = True
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 weCount = 0
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 weSpecialCond = ""
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 if self.isEndElement() and self.name() == "Watchexpression":
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 938
diff changeset
209 self.dbs.getWatchPointModel().addWatchPoint(weCond,
599
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 (weTemp, weEnabled, weCount, weSpecialCond))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 if self.name() == "Condition":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 weCond = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 if weCond == 'None':
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 weCond = ''
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 elif self.name() == "Temporary":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 weTemp = self.toBool(self.attribute("value", "False"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 elif self.name() == "Enabled":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 weEnabled = self.toBool(self.attribute("value", "True"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 elif self.name() == "Count":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 weCount = int(self.attribute("value", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 elif self.name() == "Special":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 weSpecialCond = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 def __readDebugInfo(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 Private method to read the debug infos.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 dbgExcList = []
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 dbgExcIgnoreList = []
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 if self.isEndElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 if self.name() == "DebugInfo":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 elif self.name() == "Exceptions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 self.dbg.setExcList(dbgExcList)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 self.project.dbgExcList = dbgExcList[:]
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 elif self.name() == "IgnoredExceptions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 self.dbg.setExcIgnoreList(dbgExcIgnoreList)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 self.project.dbgExcIgnoreList = dbgExcIgnoreList[:]
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 if self.name() == "CommandLine":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 txt = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 self.dbg.setArgvHistory(txt)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 self.project.dbgCmdline = txt
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 elif self.name() == "WorkingDirectory":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 txt = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 self.dbg.setWdHistory(txt)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 self.project.dbgWd = txt
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 elif self.name() == "Environment":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 txt = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 self.dbg.setEnvHistory(txt)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 self.project.dbgEnv = txt
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 elif self.name() == "ReportExceptions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 exc = self.toBool(self.attribute("value", "True"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 self.dbg.setExceptionReporting(exc)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 self.project.dbgReportExceptions = exc
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 elif self.name() == "Exceptions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 pass # ignore this start tag
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 elif self.name() == "Exception":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 dbgExcList.append(self.readElementText())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 elif self.name() == "IgnoredExceptions":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 pass # ignore this start tag
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 elif self.name() == "IgnoredException":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 dbgExcIgnoreList.append(self.readElementText())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 elif self.name() == "AutoClearShell":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 val = self.toBool(self.attribute("value"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 self.dbg.setAutoClearShell(val)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 self.project.dbgAutoClearShell = val
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 elif self.name() == "TracePython":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 val = self.toBool(self.attribute("value"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 self.dbg.setTracePython(val)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 self.project.dbgTracePython = val
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 elif self.name() == "AutoContinue":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 val = self.toBool(self.attribute("value"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 self.dbg.setAutoContinue(val)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 if not self.isGlobal:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293 self.project.dbgAutoContinue = val
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 elif self.name() == "CovexcPattern":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 pass # ignore this start tag
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 def __readBookmarks(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 Private method to read the bookmark infos.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 if self.isEndElement() and self.name() == "Bookmarks":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 if self.name() == "Bookmark":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 self.__readBookmark()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 self.raiseUnexpectedStartTag(self.name())
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 def __readBookmark(self):
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 Private method to read the bookmark info.
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 """
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 filename = ""
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 lineno = 0
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 while not self.atEnd():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 self.readNext()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 if self.isEndElement() and self.name() == "Bookmark":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 editor = self.vm.getOpenEditor(filename)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 if editor is not None:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 editor.toggleBookmark(lineno)
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 break
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 if self.isStartElement():
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 if self.name() == "BmFilename":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 filename = self.readElementText()
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332 elif self.name() == "Linenumber":
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 lineno = int(self.attribute("value", "0"))
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
334 else:
ee87fe94bf96 Migrated the session handler to session reader.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 self.raiseUnexpectedStartTag(self.name())

eric ide

mercurial