Tue, 14 Sep 2010 09:37:12 +0200
Migrated the project handler to project reader and removed XML handling source no longer needed.
--- a/Documentation/Source/eric5.E5XML.ProjectHandler.html Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,735 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E5XML.ProjectHandler</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E5XML.ProjectHandler</h1> -<p> -Module implementing the handler class for reading an XML project file. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#ProjectHandler">ProjectHandler</a></td> -<td>Class implementing a sax handler to read an XML project file.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="ProjectHandler" ID="ProjectHandler"></a> -<h2>ProjectHandler</h2> -<p> - Class implementing a sax handler to read an XML project file. -</p> -<h3>Derived from</h3> -XMLHandlerBase -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#ProjectHandler.__init__">ProjectHandler</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#ProjectHandler.__buildPath">__buildPath</a></td> -<td>Private method to assemble a path.</td> -</tr><tr> -<td><a href="#ProjectHandler.endAuthor">endAuthor</a></td> -<td>Handler method for the "Author" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endCheckersParams">endCheckersParams</a></td> -<td>Handler method for the "CheckersParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endCxfreezeParams">endCxfreezeParams</a></td> -<td>Handler method for the "CxfreezeParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endDescription">endDescription</a></td> -<td>Handler method for the "Description" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endDir">endDir</a></td> -<td>Handler method for the "Dir" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endDocumentationParams">endDocumentationParams</a></td> -<td>Handler method for the "DocumentationParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endEmail">endEmail</a></td> -<td>Handler method for the "Email" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endEric4ApiParams">endEric4ApiParams</a></td> -<td>Handler method for the "Eric4ApiParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endEric4DocParams">endEric4DocParams</a></td> -<td>Handler method for the "Eric4DocParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endForm">endForm</a></td> -<td>Handler method for the "Form" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endHash">endHash</a></td> -<td>Handler method for the "Hash" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endInterface">endInterface</a></td> -<td>Handler method for the "Interface" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endLanguage">endLanguage</a></td> -<td>Handler method for the "Language" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endMainScript">endMainScript</a></td> -<td>Handler method for the "MainScript" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endName">endName</a></td> -<td>Handler method for the "Name" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endOther">endOther</a></td> -<td>Handler method for the "Other" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endOtherToolsParams">endOtherToolsParams</a></td> -<td>Handler method for the "OtherToolsParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endPackagersParams">endPackagersParams</a></td> -<td>Handler method for the "PackagersParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endProgLanguage">endProgLanguage</a></td> -<td>Handler method for the "ProgLanguage" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endProjectExcludeList">endProjectExcludeList</a></td> -<td>Handler method for the "ProjectExcludeList" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endProjectType">endProjectType</a></td> -<td>Handler method for the "ProjectType" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endProjectTypeSpecificData">endProjectTypeSpecificData</a></td> -<td>Handler method for the "ProjectTypeSpecificData" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endProjectWordList">endProjectWordList</a></td> -<td>Handler method for the "ProjectWordList" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endPyLintParams">endPyLintParams</a></td> -<td>Handler method for the "PyLintParams" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endResource">endResource</a></td> -<td>Handler method for the "Resource" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endSource">endSource</a></td> -<td>Handler method for the "Source" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endTranslation">endTranslation</a></td> -<td>Handler method for the "Translation" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endTranslationException">endTranslationException</a></td> -<td>Handler method for the "TranslationException" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endTranslationPattern">endTranslationPattern</a></td> -<td>Handler method for the "TranslationPattern" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endTranslationPrefix">endTranslationPrefix</a></td> -<td>Handler method for the "TranslationPrefix" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endTranslationsBinPath">endTranslationsBinPath</a></td> -<td>Handler method for the "TranslationsBinPath" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endUIType">endUIType</a></td> -<td>Handler method for the "UIType" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endVcsOptions">endVcsOptions</a></td> -<td>Handler method for the "VcsOptions" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endVcsOtherData">endVcsOtherData</a></td> -<td>Handler method for the "VcsOtherData" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endVcsType">endVcsType</a></td> -<td>Handler method for the "VcsType" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.endVersion">endVersion</a></td> -<td>Handler method for the "Version" end tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.getVersion">getVersion</a></td> -<td>Public method to retrieve the version of the project.</td> -</tr><tr> -<td><a href="#ProjectHandler.startCheckersParams">startCheckersParams</a></td> -<td>Handler method for the "CheckersParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startCxfreezeParams">startCxfreezeParams</a></td> -<td>Handler method for the "CxfreezeParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startDocumentProject">startDocumentProject</a></td> -<td>Handler called, when the document parsing is started.</td> -</tr><tr> -<td><a href="#ProjectHandler.startDocumentationParams">startDocumentationParams</a></td> -<td>Handler method for the "DocumentationParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startEol">startEol</a></td> -<td>Handler method for the "Eol" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startEric4ApiParams">startEric4ApiParams</a></td> -<td>Handler method for the "Eric4ApiParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startEric4DocParams">startEric4DocParams</a></td> -<td>Handler method for the "Eric4DocParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startFiletypeAssociation">startFiletypeAssociation</a></td> -<td>Handler method for the "FiletypeAssociation" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startForm">startForm</a></td> -<td>Handler method for the "Form" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startInterface">startInterface</a></td> -<td>Handler method for the "Interface" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startLexerAssociation">startLexerAssociation</a></td> -<td>Handler method for the "LexerAssociation" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startMainScript">startMainScript</a></td> -<td>Handler method for the "MainScript" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startOther">startOther</a></td> -<td>Handler method for the "Other" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startOtherToolsParams">startOtherToolsParams</a></td> -<td>Handler method for the "OtherToolsParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startPackagersParams">startPackagersParams</a></td> -<td>Handler method for the "PackagersParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startProgLanguage">startProgLanguage</a></td> -<td>Handler method for the "Source" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startProject">startProject</a></td> -<td>Handler method for the "Project" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startProjectTypeSpecificData">startProjectTypeSpecificData</a></td> -<td>Handler method for the "ProjectTypeSpecificData" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startPyLintParams">startPyLintParams</a></td> -<td>Handler method for the "PyLintParams" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startResource">startResource</a></td> -<td>Handler method for the "Resource" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startSource">startSource</a></td> -<td>Handler method for the "Source" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startTranslation">startTranslation</a></td> -<td>Handler method for the "Translation" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startTranslationException">startTranslationException</a></td> -<td>Handler method for the "TranslationException" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startTranslationPrefix">startTranslationPrefix</a></td> -<td>Handler method for the "TranslationPrefix" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startTranslationsBinPath">startTranslationsBinPath</a></td> -<td>Handler method for the "TranslationsBinPath" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startVcsOptions">startVcsOptions</a></td> -<td>Handler method for the "VcsOptions" start tag.</td> -</tr><tr> -<td><a href="#ProjectHandler.startVcsOtherData">startVcsOtherData</a></td> -<td>Handler method for the "VcsOtherData" start tag.</td> -</tr> -</table> -<a NAME="ProjectHandler.__init__" ID="ProjectHandler.__init__"></a> -<h4>ProjectHandler (Constructor)</h4> -<b>ProjectHandler</b>(<i>project</i>) -<p> - Constructor -</p><dl> -<dt><i>project</i></dt> -<dd> -Reference to the project object to store the - information into. -</dd> -</dl><a NAME="ProjectHandler.__buildPath" ID="ProjectHandler.__buildPath"></a> -<h4>ProjectHandler.__buildPath</h4> -<b>__buildPath</b>(<i></i>) -<p> - Private method to assemble a path. -</p><dl> -<dt>Returns:</dt> -<dd> -The ready assembled path. (string) -</dd> -</dl><a NAME="ProjectHandler.endAuthor" ID="ProjectHandler.endAuthor"></a> -<h4>ProjectHandler.endAuthor</h4> -<b>endAuthor</b>(<i></i>) -<p> - Handler method for the "Author" end tag. -</p><a NAME="ProjectHandler.endCheckersParams" ID="ProjectHandler.endCheckersParams"></a> -<h4>ProjectHandler.endCheckersParams</h4> -<b>endCheckersParams</b>(<i></i>) -<p> - Handler method for the "CheckersParams" end tag. -</p><a NAME="ProjectHandler.endCxfreezeParams" ID="ProjectHandler.endCxfreezeParams"></a> -<h4>ProjectHandler.endCxfreezeParams</h4> -<b>endCxfreezeParams</b>(<i></i>) -<p> - Handler method for the "CxfreezeParams" end tag. -</p><a NAME="ProjectHandler.endDescription" ID="ProjectHandler.endDescription"></a> -<h4>ProjectHandler.endDescription</h4> -<b>endDescription</b>(<i></i>) -<p> - Handler method for the "Description" end tag. -</p><a NAME="ProjectHandler.endDir" ID="ProjectHandler.endDir"></a> -<h4>ProjectHandler.endDir</h4> -<b>endDir</b>(<i></i>) -<p> - Handler method for the "Dir" end tag. -</p><a NAME="ProjectHandler.endDocumentationParams" ID="ProjectHandler.endDocumentationParams"></a> -<h4>ProjectHandler.endDocumentationParams</h4> -<b>endDocumentationParams</b>(<i></i>) -<p> - Handler method for the "DocumentationParams" end tag. -</p><a NAME="ProjectHandler.endEmail" ID="ProjectHandler.endEmail"></a> -<h4>ProjectHandler.endEmail</h4> -<b>endEmail</b>(<i></i>) -<p> - Handler method for the "Email" end tag. -</p><a NAME="ProjectHandler.endEric4ApiParams" ID="ProjectHandler.endEric4ApiParams"></a> -<h4>ProjectHandler.endEric4ApiParams</h4> -<b>endEric4ApiParams</b>(<i></i>) -<p> - Handler method for the "Eric4ApiParams" end tag. -</p><a NAME="ProjectHandler.endEric4DocParams" ID="ProjectHandler.endEric4DocParams"></a> -<h4>ProjectHandler.endEric4DocParams</h4> -<b>endEric4DocParams</b>(<i></i>) -<p> - Handler method for the "Eric4DocParams" end tag. -</p><a NAME="ProjectHandler.endForm" ID="ProjectHandler.endForm"></a> -<h4>ProjectHandler.endForm</h4> -<b>endForm</b>(<i></i>) -<p> - Handler method for the "Form" end tag. -</p><a NAME="ProjectHandler.endHash" ID="ProjectHandler.endHash"></a> -<h4>ProjectHandler.endHash</h4> -<b>endHash</b>(<i></i>) -<p> - Handler method for the "Hash" end tag. -</p><a NAME="ProjectHandler.endInterface" ID="ProjectHandler.endInterface"></a> -<h4>ProjectHandler.endInterface</h4> -<b>endInterface</b>(<i></i>) -<p> - Handler method for the "Interface" end tag. -</p><a NAME="ProjectHandler.endLanguage" ID="ProjectHandler.endLanguage"></a> -<h4>ProjectHandler.endLanguage</h4> -<b>endLanguage</b>(<i></i>) -<p> - Handler method for the "Language" end tag. -</p><a NAME="ProjectHandler.endMainScript" ID="ProjectHandler.endMainScript"></a> -<h4>ProjectHandler.endMainScript</h4> -<b>endMainScript</b>(<i></i>) -<p> - Handler method for the "MainScript" end tag. -</p><a NAME="ProjectHandler.endName" ID="ProjectHandler.endName"></a> -<h4>ProjectHandler.endName</h4> -<b>endName</b>(<i></i>) -<p> - Handler method for the "Name" end tag. -</p><a NAME="ProjectHandler.endOther" ID="ProjectHandler.endOther"></a> -<h4>ProjectHandler.endOther</h4> -<b>endOther</b>(<i></i>) -<p> - Handler method for the "Other" end tag. -</p><a NAME="ProjectHandler.endOtherToolsParams" ID="ProjectHandler.endOtherToolsParams"></a> -<h4>ProjectHandler.endOtherToolsParams</h4> -<b>endOtherToolsParams</b>(<i></i>) -<p> - Handler method for the "OtherToolsParams" end tag. -</p><a NAME="ProjectHandler.endPackagersParams" ID="ProjectHandler.endPackagersParams"></a> -<h4>ProjectHandler.endPackagersParams</h4> -<b>endPackagersParams</b>(<i></i>) -<p> - Handler method for the "PackagersParams" end tag. -</p><a NAME="ProjectHandler.endProgLanguage" ID="ProjectHandler.endProgLanguage"></a> -<h4>ProjectHandler.endProgLanguage</h4> -<b>endProgLanguage</b>(<i></i>) -<p> - Handler method for the "ProgLanguage" end tag. -</p><a NAME="ProjectHandler.endProjectExcludeList" ID="ProjectHandler.endProjectExcludeList"></a> -<h4>ProjectHandler.endProjectExcludeList</h4> -<b>endProjectExcludeList</b>(<i></i>) -<p> - Handler method for the "ProjectExcludeList" end tag. -</p><a NAME="ProjectHandler.endProjectType" ID="ProjectHandler.endProjectType"></a> -<h4>ProjectHandler.endProjectType</h4> -<b>endProjectType</b>(<i></i>) -<p> - Handler method for the "ProjectType" end tag. -</p><a NAME="ProjectHandler.endProjectTypeSpecificData" ID="ProjectHandler.endProjectTypeSpecificData"></a> -<h4>ProjectHandler.endProjectTypeSpecificData</h4> -<b>endProjectTypeSpecificData</b>(<i></i>) -<p> - Handler method for the "ProjectTypeSpecificData" end tag. -</p><a NAME="ProjectHandler.endProjectWordList" ID="ProjectHandler.endProjectWordList"></a> -<h4>ProjectHandler.endProjectWordList</h4> -<b>endProjectWordList</b>(<i></i>) -<p> - Handler method for the "ProjectWordList" end tag. -</p><a NAME="ProjectHandler.endPyLintParams" ID="ProjectHandler.endPyLintParams"></a> -<h4>ProjectHandler.endPyLintParams</h4> -<b>endPyLintParams</b>(<i></i>) -<p> - Handler method for the "PyLintParams" end tag. -</p><a NAME="ProjectHandler.endResource" ID="ProjectHandler.endResource"></a> -<h4>ProjectHandler.endResource</h4> -<b>endResource</b>(<i></i>) -<p> - Handler method for the "Resource" end tag. -</p><a NAME="ProjectHandler.endSource" ID="ProjectHandler.endSource"></a> -<h4>ProjectHandler.endSource</h4> -<b>endSource</b>(<i></i>) -<p> - Handler method for the "Source" end tag. -</p><a NAME="ProjectHandler.endTranslation" ID="ProjectHandler.endTranslation"></a> -<h4>ProjectHandler.endTranslation</h4> -<b>endTranslation</b>(<i></i>) -<p> - Handler method for the "Translation" end tag. -</p><a NAME="ProjectHandler.endTranslationException" ID="ProjectHandler.endTranslationException"></a> -<h4>ProjectHandler.endTranslationException</h4> -<b>endTranslationException</b>(<i></i>) -<p> - Handler method for the "TranslationException" end tag. -</p><a NAME="ProjectHandler.endTranslationPattern" ID="ProjectHandler.endTranslationPattern"></a> -<h4>ProjectHandler.endTranslationPattern</h4> -<b>endTranslationPattern</b>(<i></i>) -<p> - Handler method for the "TranslationPattern" end tag. -</p><a NAME="ProjectHandler.endTranslationPrefix" ID="ProjectHandler.endTranslationPrefix"></a> -<h4>ProjectHandler.endTranslationPrefix</h4> -<b>endTranslationPrefix</b>(<i></i>) -<p> - Handler method for the "TranslationPrefix" end tag. -</p><a NAME="ProjectHandler.endTranslationsBinPath" ID="ProjectHandler.endTranslationsBinPath"></a> -<h4>ProjectHandler.endTranslationsBinPath</h4> -<b>endTranslationsBinPath</b>(<i></i>) -<p> - Handler method for the "TranslationsBinPath" end tag. -</p><a NAME="ProjectHandler.endUIType" ID="ProjectHandler.endUIType"></a> -<h4>ProjectHandler.endUIType</h4> -<b>endUIType</b>(<i></i>) -<p> - Handler method for the "UIType" end tag. -</p><a NAME="ProjectHandler.endVcsOptions" ID="ProjectHandler.endVcsOptions"></a> -<h4>ProjectHandler.endVcsOptions</h4> -<b>endVcsOptions</b>(<i></i>) -<p> - Handler method for the "VcsOptions" end tag. -</p><a NAME="ProjectHandler.endVcsOtherData" ID="ProjectHandler.endVcsOtherData"></a> -<h4>ProjectHandler.endVcsOtherData</h4> -<b>endVcsOtherData</b>(<i></i>) -<p> - Handler method for the "VcsOtherData" end tag. -</p><a NAME="ProjectHandler.endVcsType" ID="ProjectHandler.endVcsType"></a> -<h4>ProjectHandler.endVcsType</h4> -<b>endVcsType</b>(<i></i>) -<p> - Handler method for the "VcsType" end tag. -</p><a NAME="ProjectHandler.endVersion" ID="ProjectHandler.endVersion"></a> -<h4>ProjectHandler.endVersion</h4> -<b>endVersion</b>(<i></i>) -<p> - Handler method for the "Version" end tag. -</p><a NAME="ProjectHandler.getVersion" ID="ProjectHandler.getVersion"></a> -<h4>ProjectHandler.getVersion</h4> -<b>getVersion</b>(<i></i>) -<p> - Public method to retrieve the version of the project. -</p><dl> -<dt>Returns:</dt> -<dd> -String containing the version number. -</dd> -</dl><a NAME="ProjectHandler.startCheckersParams" ID="ProjectHandler.startCheckersParams"></a> -<h4>ProjectHandler.startCheckersParams</h4> -<b>startCheckersParams</b>(<i>attrs</i>) -<p> - Handler method for the "CheckersParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startCxfreezeParams" ID="ProjectHandler.startCxfreezeParams"></a> -<h4>ProjectHandler.startCxfreezeParams</h4> -<b>startCxfreezeParams</b>(<i>attrs</i>) -<p> - Handler method for the "CxfreezeParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startDocumentProject" ID="ProjectHandler.startDocumentProject"></a> -<h4>ProjectHandler.startDocumentProject</h4> -<b>startDocumentProject</b>(<i></i>) -<p> - Handler called, when the document parsing is started. -</p><a NAME="ProjectHandler.startDocumentationParams" ID="ProjectHandler.startDocumentationParams"></a> -<h4>ProjectHandler.startDocumentationParams</h4> -<b>startDocumentationParams</b>(<i>attrs</i>) -<p> - Handler method for the "DocumentationParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startEol" ID="ProjectHandler.startEol"></a> -<h4>ProjectHandler.startEol</h4> -<b>startEol</b>(<i>attrs</i>) -<p> - Handler method for the "Eol" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startEric4ApiParams" ID="ProjectHandler.startEric4ApiParams"></a> -<h4>ProjectHandler.startEric4ApiParams</h4> -<b>startEric4ApiParams</b>(<i>attrs</i>) -<p> - Handler method for the "Eric4ApiParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startEric4DocParams" ID="ProjectHandler.startEric4DocParams"></a> -<h4>ProjectHandler.startEric4DocParams</h4> -<b>startEric4DocParams</b>(<i>attrs</i>) -<p> - Handler method for the "Eric4DocParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startFiletypeAssociation" ID="ProjectHandler.startFiletypeAssociation"></a> -<h4>ProjectHandler.startFiletypeAssociation</h4> -<b>startFiletypeAssociation</b>(<i>attrs</i>) -<p> - Handler method for the "FiletypeAssociation" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startForm" ID="ProjectHandler.startForm"></a> -<h4>ProjectHandler.startForm</h4> -<b>startForm</b>(<i>attrs</i>) -<p> - Handler method for the "Form" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startInterface" ID="ProjectHandler.startInterface"></a> -<h4>ProjectHandler.startInterface</h4> -<b>startInterface</b>(<i>attrs</i>) -<p> - Handler method for the "Interface" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startLexerAssociation" ID="ProjectHandler.startLexerAssociation"></a> -<h4>ProjectHandler.startLexerAssociation</h4> -<b>startLexerAssociation</b>(<i>attrs</i>) -<p> - Handler method for the "LexerAssociation" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startMainScript" ID="ProjectHandler.startMainScript"></a> -<h4>ProjectHandler.startMainScript</h4> -<b>startMainScript</b>(<i>attrs</i>) -<p> - Handler method for the "MainScript" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startOther" ID="ProjectHandler.startOther"></a> -<h4>ProjectHandler.startOther</h4> -<b>startOther</b>(<i>attrs</i>) -<p> - Handler method for the "Other" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startOtherToolsParams" ID="ProjectHandler.startOtherToolsParams"></a> -<h4>ProjectHandler.startOtherToolsParams</h4> -<b>startOtherToolsParams</b>(<i>attrs</i>) -<p> - Handler method for the "OtherToolsParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startPackagersParams" ID="ProjectHandler.startPackagersParams"></a> -<h4>ProjectHandler.startPackagersParams</h4> -<b>startPackagersParams</b>(<i>attrs</i>) -<p> - Handler method for the "PackagersParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startProgLanguage" ID="ProjectHandler.startProgLanguage"></a> -<h4>ProjectHandler.startProgLanguage</h4> -<b>startProgLanguage</b>(<i>attrs</i>) -<p> - Handler method for the "Source" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startProject" ID="ProjectHandler.startProject"></a> -<h4>ProjectHandler.startProject</h4> -<b>startProject</b>(<i>attrs</i>) -<p> - Handler method for the "Project" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startProjectTypeSpecificData" ID="ProjectHandler.startProjectTypeSpecificData"></a> -<h4>ProjectHandler.startProjectTypeSpecificData</h4> -<b>startProjectTypeSpecificData</b>(<i>attrs</i>) -<p> - Handler method for the "ProjectTypeSpecificData" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startPyLintParams" ID="ProjectHandler.startPyLintParams"></a> -<h4>ProjectHandler.startPyLintParams</h4> -<b>startPyLintParams</b>(<i>attrs</i>) -<p> - Handler method for the "PyLintParams" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startResource" ID="ProjectHandler.startResource"></a> -<h4>ProjectHandler.startResource</h4> -<b>startResource</b>(<i>attrs</i>) -<p> - Handler method for the "Resource" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startSource" ID="ProjectHandler.startSource"></a> -<h4>ProjectHandler.startSource</h4> -<b>startSource</b>(<i>attrs</i>) -<p> - Handler method for the "Source" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startTranslation" ID="ProjectHandler.startTranslation"></a> -<h4>ProjectHandler.startTranslation</h4> -<b>startTranslation</b>(<i>attrs</i>) -<p> - Handler method for the "Translation" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startTranslationException" ID="ProjectHandler.startTranslationException"></a> -<h4>ProjectHandler.startTranslationException</h4> -<b>startTranslationException</b>(<i>attrs</i>) -<p> - Handler method for the "TranslationException" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startTranslationPrefix" ID="ProjectHandler.startTranslationPrefix"></a> -<h4>ProjectHandler.startTranslationPrefix</h4> -<b>startTranslationPrefix</b>(<i>attrs</i>) -<p> - Handler method for the "TranslationPrefix" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startTranslationsBinPath" ID="ProjectHandler.startTranslationsBinPath"></a> -<h4>ProjectHandler.startTranslationsBinPath</h4> -<b>startTranslationsBinPath</b>(<i>attrs</i>) -<p> - Handler method for the "TranslationsBinPath" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startVcsOptions" ID="ProjectHandler.startVcsOptions"></a> -<h4>ProjectHandler.startVcsOptions</h4> -<b>startVcsOptions</b>(<i>attrs</i>) -<p> - Handler method for the "VcsOptions" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="ProjectHandler.startVcsOtherData" ID="ProjectHandler.startVcsOtherData"></a> -<h4>ProjectHandler.startVcsOtherData</h4> -<b>startVcsOtherData</b>(<i>attrs</i>) -<p> - Handler method for the "VcsOtherData" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.E5XML.XMLEntityResolver.html Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E5XML.XMLEntityResolver</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E5XML.XMLEntityResolver</h1> -<p> -Module implementing a specialized entity resolver to find our DTDs. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#XMLEntityResolver">XMLEntityResolver</a></td> -<td>Class implementing a specialized entity resolver to find our DTDs.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="XMLEntityResolver" ID="XMLEntityResolver"></a> -<h2>XMLEntityResolver</h2> -<p> - Class implementing a specialized entity resolver to find our DTDs. -</p> -<h3>Derived from</h3> -EntityResolver -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#XMLEntityResolver.resolveEntity">resolveEntity</a></td> -<td>Public method to resolve the system identifier of an entity and return either the system identifier to read from as a string.</td> -</tr> -</table> -<a NAME="XMLEntityResolver.resolveEntity" ID="XMLEntityResolver.resolveEntity"></a> -<h4>XMLEntityResolver.resolveEntity</h4> -<b>resolveEntity</b>(<i>publicId, systemId</i>) -<p> - Public method to resolve the system identifier of an entity and - return either the system identifier to read from as a string. -</p><dl> -<dt><i>publicId</i></dt> -<dd> -publicId of an entity (string) -</dd><dt><i>systemId</i></dt> -<dd> -systemId of an entity to reslove (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -resolved systemId (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.E5XML.XMLErrorHandler.html Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E5XML.XMLErrorHandler</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E5XML.XMLErrorHandler</h1> -<p> -Module implementing an error handler class. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#XMLErrorHandler">XMLErrorHandler</a></td> -<td>Class implementing an error handler class.</td> -</tr><tr> -<td><a href="#XMLFatalParseError">XMLFatalParseError</a></td> -<td>Class implementing an exception for recoverable parse errors.</td> -</tr><tr> -<td><a href="#XMLParseError">XMLParseError</a></td> -<td>Class implementing an exception for recoverable parse errors.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="XMLErrorHandler" ID="XMLErrorHandler"></a> -<h2>XMLErrorHandler</h2> -<p> - Class implementing an error handler class. -</p> -<h3>Derived from</h3> -ErrorHandler -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#XMLErrorHandler.__init__">XMLErrorHandler</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#XMLErrorHandler.error">error</a></td> -<td>Public method to handle a recoverable error.</td> -</tr><tr> -<td><a href="#XMLErrorHandler.fatalError">fatalError</a></td> -<td>Public method to handle a non-recoverable error.</td> -</tr><tr> -<td><a href="#XMLErrorHandler.getParseMessages">getParseMessages</a></td> -<td>Public method to retrieve all messages.</td> -</tr><tr> -<td><a href="#XMLErrorHandler.showParseMessages">showParseMessages</a></td> -<td>Public method to show the parse messages (if any) in a dialog.</td> -</tr><tr> -<td><a href="#XMLErrorHandler.warning">warning</a></td> -<td>Public method to handle a warning.</td> -</tr> -</table> -<a NAME="XMLErrorHandler.__init__" ID="XMLErrorHandler.__init__"></a> -<h4>XMLErrorHandler (Constructor)</h4> -<b>XMLErrorHandler</b>(<i></i>) -<p> - Constructor -</p><a NAME="XMLErrorHandler.error" ID="XMLErrorHandler.error"></a> -<h4>XMLErrorHandler.error</h4> -<b>error</b>(<i>exception</i>) -<p> - Public method to handle a recoverable error. -</p><dl> -<dt><i>exception</i></dt> -<dd> -Exception object describing the error (SAXParseException) -</dd> -</dl><a NAME="XMLErrorHandler.fatalError" ID="XMLErrorHandler.fatalError"></a> -<h4>XMLErrorHandler.fatalError</h4> -<b>fatalError</b>(<i>exception</i>) -<p> - Public method to handle a non-recoverable error. -</p><dl> -<dt><i>exception</i></dt> -<dd> -Exception object describing the error (SAXParseException) -</dd> -</dl><dl> -<dt>Raises <b>XMLFatalParseError</b>:</dt> -<dd> -a fatal parse error has occured -</dd> -</dl><a NAME="XMLErrorHandler.getParseMessages" ID="XMLErrorHandler.getParseMessages"></a> -<h4>XMLErrorHandler.getParseMessages</h4> -<b>getParseMessages</b>(<i></i>) -<p> - Public method to retrieve all messages. -</p><dl> -<dt>Returns:</dt> -<dd> -list of tuples of (message type, system id, line no, column no, - message) -</dd> -</dl><a NAME="XMLErrorHandler.showParseMessages" ID="XMLErrorHandler.showParseMessages"></a> -<h4>XMLErrorHandler.showParseMessages</h4> -<b>showParseMessages</b>(<i></i>) -<p> - Public method to show the parse messages (if any) in a dialog. -</p><a NAME="XMLErrorHandler.warning" ID="XMLErrorHandler.warning"></a> -<h4>XMLErrorHandler.warning</h4> -<b>warning</b>(<i>exception</i>) -<p> - Public method to handle a warning. -</p><dl> -<dt><i>exception</i></dt> -<dd> -Exception object describing the error (SAXParseException) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="XMLFatalParseError" ID="XMLFatalParseError"></a> -<h2>XMLFatalParseError</h2> -<p> - Class implementing an exception for recoverable parse errors. -</p> -<h3>Derived from</h3> -XMLParseError -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="XMLParseError" ID="XMLParseError"></a> -<h2>XMLParseError</h2> -<p> - Class implementing an exception for recoverable parse errors. -</p> -<h3>Derived from</h3> -Exception -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.E5XML.XMLHandlerBase.html Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,367 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E5XML.XMLHandlerBase</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E5XML.XMLHandlerBase</h1> -<p> -Module implementing a base class for all of eric5s XML handlers. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#XMLHandlerBase">XMLHandlerBase</a></td> -<td>Class implementing the base class for al of eric5s XML handlers.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="XMLHandlerBase" ID="XMLHandlerBase"></a> -<h2>XMLHandlerBase</h2> -<p> - Class implementing the base class for al of eric5s XML handlers. -</p> -<h3>Derived from</h3> -ContentHandler -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#XMLHandlerBase.__init__">XMLHandlerBase</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#XMLHandlerBase._prepareBasics">_prepareBasics</a></td> -<td>Protected method to prepare the parsing of XML for basic python types.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.characters">characters</a></td> -<td>Handler called for ordinary text.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.decodedNewLines">decodedNewLines</a></td> -<td>Public method to decode newlines and paragraph breaks.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.defaultEndElement">defaultEndElement</a></td> -<td>Handler method for the common end tags.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.defaultStartElement">defaultStartElement</a></td> -<td>Handler method for common start tags.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endBool">endBool</a></td> -<td>Handler method for the "bool" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endBytearray">endBytearray</a></td> -<td>Handler method for the "bytearray" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endBytes">endBytes</a></td> -<td>Handler method for the "bytes" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endComplex">endComplex</a></td> -<td>Handler method for the "complex" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endDictionary">endDictionary</a></td> -<td>Handler method for the "dictionary" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endElement">endElement</a></td> -<td>Handler called, when an ending tag is found.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endFloat">endFloat</a></td> -<td>Handler method for the "float" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endFrozenset">endFrozenset</a></td> -<td>Handler method for the "frozenset" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endInt">endInt</a></td> -<td>Handler method for the "int" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endList">endList</a></td> -<td>Handler method for the "list" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endNone">endNone</a></td> -<td>Handler method for the "none" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endPickle">endPickle</a></td> -<td>Handler method for the "pickle" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endSet">endSet</a></td> -<td>Handler method for the "set" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endString">endString</a></td> -<td>Handler method for the "string" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.endTuple">endTuple</a></td> -<td>Handler method for the "tuple" end tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startDictionary">startDictionary</a></td> -<td>Handler method for the "dictionary" start tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startDocument">startDocument</a></td> -<td>Handler called, when the document parsing is started.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startElement">startElement</a></td> -<td>Handler called, when a starting tag is found.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startFrozenset">startFrozenset</a></td> -<td>Handler method for the "frozenset" start tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startList">startList</a></td> -<td>Handler method for the "list" start tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startPickle">startPickle</a></td> -<td>Handler method for the "pickle" start tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startSet">startSet</a></td> -<td>Handler method for the "set" start tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.startTuple">startTuple</a></td> -<td>Handler method for the "tuple" start tag.</td> -</tr><tr> -<td><a href="#XMLHandlerBase.unescape">unescape</a></td> -<td>Public method used to unescape certain characters.</td> -</tr> -</table> -<a NAME="XMLHandlerBase.__init__" ID="XMLHandlerBase.__init__"></a> -<h4>XMLHandlerBase (Constructor)</h4> -<b>XMLHandlerBase</b>(<i></i>) -<p> - Constructor -</p><a NAME="XMLHandlerBase._prepareBasics" ID="XMLHandlerBase._prepareBasics"></a> -<h4>XMLHandlerBase._prepareBasics</h4> -<b>_prepareBasics</b>(<i></i>) -<p> - Protected method to prepare the parsing of XML for basic python types. -</p><a NAME="XMLHandlerBase.characters" ID="XMLHandlerBase.characters"></a> -<h4>XMLHandlerBase.characters</h4> -<b>characters</b>(<i>chars</i>) -<p> - Handler called for ordinary text. -</p><dl> -<dt><i>chars</i></dt> -<dd> -the scanned text (string) -</dd> -</dl><a NAME="XMLHandlerBase.decodedNewLines" ID="XMLHandlerBase.decodedNewLines"></a> -<h4>XMLHandlerBase.decodedNewLines</h4> -<b>decodedNewLines</b>(<i>text</i>) -<p> - Public method to decode newlines and paragraph breaks. -</p><dl> -<dt><i>text</i></dt> -<dd> -text to decode (string) -</dd> -</dl><a NAME="XMLHandlerBase.defaultEndElement" ID="XMLHandlerBase.defaultEndElement"></a> -<h4>XMLHandlerBase.defaultEndElement</h4> -<b>defaultEndElement</b>(<i></i>) -<p> - Handler method for the common end tags. -</p><a NAME="XMLHandlerBase.defaultStartElement" ID="XMLHandlerBase.defaultStartElement"></a> -<h4>XMLHandlerBase.defaultStartElement</h4> -<b>defaultStartElement</b>(<i>attrs</i>) -<p> - Handler method for common start tags. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.endBool" ID="XMLHandlerBase.endBool"></a> -<h4>XMLHandlerBase.endBool</h4> -<b>endBool</b>(<i></i>) -<p> - Handler method for the "bool" end tag. -</p><a NAME="XMLHandlerBase.endBytearray" ID="XMLHandlerBase.endBytearray"></a> -<h4>XMLHandlerBase.endBytearray</h4> -<b>endBytearray</b>(<i></i>) -<p> - Handler method for the "bytearray" end tag. -</p><a NAME="XMLHandlerBase.endBytes" ID="XMLHandlerBase.endBytes"></a> -<h4>XMLHandlerBase.endBytes</h4> -<b>endBytes</b>(<i></i>) -<p> - Handler method for the "bytes" end tag. -</p><a NAME="XMLHandlerBase.endComplex" ID="XMLHandlerBase.endComplex"></a> -<h4>XMLHandlerBase.endComplex</h4> -<b>endComplex</b>(<i></i>) -<p> - Handler method for the "complex" end tag. -</p><a NAME="XMLHandlerBase.endDictionary" ID="XMLHandlerBase.endDictionary"></a> -<h4>XMLHandlerBase.endDictionary</h4> -<b>endDictionary</b>(<i></i>) -<p> - Handler method for the "dictionary" end tag. -</p><a NAME="XMLHandlerBase.endElement" ID="XMLHandlerBase.endElement"></a> -<h4>XMLHandlerBase.endElement</h4> -<b>endElement</b>(<i>name</i>) -<p> - Handler called, when an ending tag is found. -</p><dl> -<dt><i>name</i></dt> -<dd> -name of the tag (string) -</dd> -</dl><a NAME="XMLHandlerBase.endFloat" ID="XMLHandlerBase.endFloat"></a> -<h4>XMLHandlerBase.endFloat</h4> -<b>endFloat</b>(<i></i>) -<p> - Handler method for the "float" end tag. -</p><a NAME="XMLHandlerBase.endFrozenset" ID="XMLHandlerBase.endFrozenset"></a> -<h4>XMLHandlerBase.endFrozenset</h4> -<b>endFrozenset</b>(<i></i>) -<p> - Handler method for the "frozenset" end tag. -</p><a NAME="XMLHandlerBase.endInt" ID="XMLHandlerBase.endInt"></a> -<h4>XMLHandlerBase.endInt</h4> -<b>endInt</b>(<i></i>) -<p> - Handler method for the "int" end tag. -</p><a NAME="XMLHandlerBase.endList" ID="XMLHandlerBase.endList"></a> -<h4>XMLHandlerBase.endList</h4> -<b>endList</b>(<i></i>) -<p> - Handler method for the "list" end tag. -</p><a NAME="XMLHandlerBase.endNone" ID="XMLHandlerBase.endNone"></a> -<h4>XMLHandlerBase.endNone</h4> -<b>endNone</b>(<i></i>) -<p> - Handler method for the "none" end tag. -</p><a NAME="XMLHandlerBase.endPickle" ID="XMLHandlerBase.endPickle"></a> -<h4>XMLHandlerBase.endPickle</h4> -<b>endPickle</b>(<i></i>) -<p> - Handler method for the "pickle" end tag. -</p><a NAME="XMLHandlerBase.endSet" ID="XMLHandlerBase.endSet"></a> -<h4>XMLHandlerBase.endSet</h4> -<b>endSet</b>(<i></i>) -<p> - Handler method for the "set" end tag. -</p><a NAME="XMLHandlerBase.endString" ID="XMLHandlerBase.endString"></a> -<h4>XMLHandlerBase.endString</h4> -<b>endString</b>(<i></i>) -<p> - Handler method for the "string" end tag. -</p><a NAME="XMLHandlerBase.endTuple" ID="XMLHandlerBase.endTuple"></a> -<h4>XMLHandlerBase.endTuple</h4> -<b>endTuple</b>(<i></i>) -<p> - Handler method for the "tuple" end tag. -</p><a NAME="XMLHandlerBase.startDictionary" ID="XMLHandlerBase.startDictionary"></a> -<h4>XMLHandlerBase.startDictionary</h4> -<b>startDictionary</b>(<i>attrs</i>) -<p> - Handler method for the "dictionary" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.startDocument" ID="XMLHandlerBase.startDocument"></a> -<h4>XMLHandlerBase.startDocument</h4> -<b>startDocument</b>(<i></i>) -<p> - Handler called, when the document parsing is started. -</p><a NAME="XMLHandlerBase.startElement" ID="XMLHandlerBase.startElement"></a> -<h4>XMLHandlerBase.startElement</h4> -<b>startElement</b>(<i>name, attrs</i>) -<p> - Handler called, when a starting tag is found. -</p><dl> -<dt><i>name</i></dt> -<dd> -name of the tag (string) -</dd><dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.startFrozenset" ID="XMLHandlerBase.startFrozenset"></a> -<h4>XMLHandlerBase.startFrozenset</h4> -<b>startFrozenset</b>(<i>attrs</i>) -<p> - Handler method for the "frozenset" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.startList" ID="XMLHandlerBase.startList"></a> -<h4>XMLHandlerBase.startList</h4> -<b>startList</b>(<i>attrs</i>) -<p> - Handler method for the "list" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.startPickle" ID="XMLHandlerBase.startPickle"></a> -<h4>XMLHandlerBase.startPickle</h4> -<b>startPickle</b>(<i>attrs</i>) -<p> - Handler method for the "pickle" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.startSet" ID="XMLHandlerBase.startSet"></a> -<h4>XMLHandlerBase.startSet</h4> -<b>startSet</b>(<i>attrs</i>) -<p> - Handler method for the "set" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.startTuple" ID="XMLHandlerBase.startTuple"></a> -<h4>XMLHandlerBase.startTuple</h4> -<b>startTuple</b>(<i>attrs</i>) -<p> - Handler method for the "tuple" start tag. -</p><dl> -<dt><i>attrs</i></dt> -<dd> -list of tag attributes -</dd> -</dl><a NAME="XMLHandlerBase.unescape" ID="XMLHandlerBase.unescape"></a> -<h4>XMLHandlerBase.unescape</h4> -<b>unescape</b>(<i>text, attribute = False</i>) -<p> - Public method used to unescape certain characters. -</p><dl> -<dt><i>text</i></dt> -<dd> -the text to unescape (string) -</dd><dt><i>attribute</i></dt> -<dd> -flag indicating unescaping is done for an attribute -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.E5XML.XMLMessageDialog.html Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E5XML.XMLMessageDialog</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E5XML.XMLMessageDialog</h1> -<p> -Module implementing a dialog to display XML parse messages. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#XMLMessageDialog">XMLMessageDialog</a></td> -<td>Class implementing a dialog to display XML parse messages.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="XMLMessageDialog" ID="XMLMessageDialog"></a> -<h2>XMLMessageDialog</h2> -<p> - Class implementing a dialog to display XML parse messages. -</p> -<h3>Derived from</h3> -QDialog, Ui_XMLMessageDialog -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#XMLMessageDialog.__init__">XMLMessageDialog</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#XMLMessageDialog.__appendText">__appendText</a></td> -<td>Private method to append text to the end of the messages pane.</td> -</tr> -</table> -<a NAME="XMLMessageDialog.__init__" ID="XMLMessageDialog.__init__"></a> -<h4>XMLMessageDialog (Constructor)</h4> -<b>XMLMessageDialog</b>(<i>msgs, parent = None</i>) -<p> - Constructor -</p><dl> -<dt><i>msgs</i></dt> -<dd> -list of tuples of (message type, system id, - line no, column no, message) -</dd><dt><i>parent</i></dt> -<dd> -parent object of the dialog (QWidget) -</dd> -</dl><a NAME="XMLMessageDialog.__appendText" ID="XMLMessageDialog.__appendText"></a> -<h4>XMLMessageDialog.__appendText</h4> -<b>__appendText</b>(<i>txt, color</i>) -<p> - Private method to append text to the end of the messages pane. -</p><dl> -<dt><i>txt</i></dt> -<dd> -text to insert (string) -</dd><dt><i>color</i></dt> -<dd> -text color to be used (QColor) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.E5XML.XMLUtilities.html Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' -'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html><head> -<title>eric5.E5XML.XMLUtilities</title> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.E5XML.XMLUtilities</h1> -<p> -Module implementing various XML utility functions. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#make_parser">make_parser</a></td> -<td>Function to generate an XML parser.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="make_parser" ID="make_parser"></a> -<h2>make_parser</h2> -<b>make_parser</b>(<i>validating</i>) -<p> - Function to generate an XML parser. -</p><p> - First it will be tried to generate a validating parser. If - this attempt fails, a non validating parser is tried next. -</p><dl> -<dt><i>validating</i></dt> -<dd> -flag indicating a validating parser is requested -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -XML parser object -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/E5XML/ProjectHandler.py Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,660 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2003 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing the handler class for reading an XML project file. -""" - -import os - -from .Config import projectFileFormatVersion -from .XMLHandlerBase import XMLHandlerBase - -import Utilities - -class ProjectHandler(XMLHandlerBase): - """ - Class implementing a sax handler to read an XML project file. - """ - def __init__(self, project): - """ - Constructor - - @param project Reference to the project object to store the - information into. - """ - XMLHandlerBase.__init__(self) - - self.startDocumentSpecific = self.startDocumentProject - - self.elements.update({ - 'Project' : (self.startProject, self.defaultEndElement), - 'Language' : (self.defaultStartElement, self.endLanguage), - 'ProjectWordList' : (self.defaultStartElement, self.endProjectWordList), - 'ProjectExcludeList' : (self.defaultStartElement, - self.endProjectExcludeList), - 'Hash' : (self.defaultStartElement, self.endHash), - 'ProgLanguage' : (self.startProgLanguage, self.endProgLanguage), - 'ProjectType' : (self.defaultStartElement, self.endProjectType), - 'Description' : (self.defaultStartElement, self.endDescription), - 'Version' : (self.defaultStartElement, self.endVersion), - 'Author' : (self.defaultStartElement, self.endAuthor), - 'Email' : (self.defaultStartElement, self.endEmail), - 'VcsType' : (self.defaultStartElement, self.endVcsType), - 'VcsOptions' : (self.startVcsOptions, self.endVcsOptions), - 'VcsOtherData' : (self.startVcsOtherData, self.endVcsOtherData), - 'Dir' : (self.defaultStartElement, self.endDir), - 'Name' : (self.defaultStartElement, self.endName), - 'Source' : (self.startSource, self.endSource), - 'Form' : (self.startForm, self.endForm), - 'Translation' : (self.startTranslation, self.endTranslation), - 'TranslationPattern' : (self.defaultStartElement, - self.endTranslationPattern), - 'TranslationsBinPath' : (self.startTranslationsBinPath, - self.endTranslationsBinPath), - 'TranslationException' : (self.startTranslationException, - self.endTranslationException), - 'Resource' : (self.startResource, self.endResource), - 'Interface' : (self.startInterface, self.endInterface), - 'Other' : (self.startOther, self.endOther), - 'MainScript' : (self.startMainScript, self.endMainScript), - 'FiletypeAssociation' : (self.startFiletypeAssociation, - self.defaultEndElement), - 'LexerAssociation' : (self.startLexerAssociation, - self.defaultEndElement), - 'ProjectTypeSpecificData' : (self.startProjectTypeSpecificData, - self.endProjectTypeSpecificData), - 'DocumentationParams' : (self.startDocumentationParams, - self.endDocumentationParams), - 'PackagersParams' : (self.startPackagersParams, self.endPackagersParams), - 'CheckersParams' : (self.startCheckersParams, self.endCheckersParams), - 'OtherToolsParams' : (self.startOtherToolsParams, self.endOtherToolsParams), - 'Eol' : (self.startEol, self.defaultEndElement), - # parameters kept for backward compatibility - 'UIType' : (self.defaultStartElement, self.endUIType), - 'TranslationPrefix' : (self.startTranslationPrefix, - self.endTranslationPrefix), - 'Eric4DocParams' : (self.startEric4DocParams, self.endEric4DocParams), - 'Eric4ApiParams' : (self.startEric4ApiParams, self.endEric4ApiParams), - 'CxfreezeParams' : (self.startCxfreezeParams, self.endCxfreezeParams), - 'PyLintParams' : (self.startPyLintParams, self.endPyLintParams), - }) - - self.project = project - - def startDocumentProject(self): - """ - Handler called, when the document parsing is started. - """ - self.version = '' - self.pathStack = [] - - ################################################### - ## below follow the individual handler functions - ################################################### - - def endLanguage(self): - """ - Handler method for the "Language" end tag. - """ - self.project.pdata["SPELLLANGUAGE"] = [self.buffer] - - def endProjectWordList(self): - """ - Handler method for the "ProjectWordList" end tag. - """ - path = Utilities.toNativeSeparators(self.buffer) - self.project.pdata["SPELLWORDS"] = [path] - - def endProjectExcludeList(self): - """ - Handler method for the "ProjectExcludeList" end tag. - """ - path = Utilities.toNativeSeparators(self.buffer) - self.project.pdata["SPELLEXCLUDES"] = [path] - - def endHash(self): - """ - Handler method for the "Hash" end tag. - """ - self.project.pdata["HASH"] = [self.buffer] - - def startProgLanguage(self, attrs): - """ - Handler method for the "Source" start tag. - - @param attrs list of tag attributes - """ - mixedLanguage = int(attrs.get("mixed", "0")) - self.project.pdata["MIXEDLANGUAGE"] = [mixedLanguage] - self.buffer = "" - - def endProgLanguage(self): - """ - Handler method for the "ProgLanguage" end tag. - """ - self.project.pdata["PROGLANGUAGE"] = [self.buffer] - - def endProjectType(self): - """ - Handler method for the "ProjectType" end tag. - """ - self.project.pdata["PROJECTTYPE"] = [self.buffer] - - def endDescription(self): - """ - Handler method for the "Description" end tag. - """ - self.buffer = self.unescape(self.buffer) - if self.version >= '4.3': - self.project.pdata["DESCRIPTION"] = [self.decodedNewLines(self.buffer)] - else: - self.project.pdata["DESCRIPTION"] = [self.buffer] - - def endVersion(self): - """ - Handler method for the "Version" end tag. - """ - self.buffer = self.unescape(self.buffer) - self.project.pdata["VERSION"] = [self.buffer] - - def endAuthor(self): - """ - Handler method for the "Author" end tag. - """ - self.buffer = self.unescape(self.buffer) - self.project.pdata["AUTHOR"] = [self.buffer] - - def endEmail(self): - """ - Handler method for the "Email" end tag. - """ - self.buffer = self.unescape(self.buffer) - self.project.pdata["EMAIL"] = [self.buffer] - - def endVcsType(self): - """ - Handler method for the "VcsType" end tag. - """ - self.project.pdata["VCS"] = [self.buffer] - - def startVcsOptions(self, attrs): - """ - Handler method for the "VcsOptions" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endVcsOptions(self): - """ - Handler method for the "VcsOptions" end tag. - """ - try: - self.project.pdata["VCSOPTIONS"] = [self.stack[-1]] - except IndexError: - self.project.pdata["VCSOPTIONS"] = [] - - def startVcsOtherData(self, attrs): - """ - Handler method for the "VcsOtherData" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endVcsOtherData(self): - """ - Handler method for the "VcsOtherData" end tag. - """ - try: - self.project.pdata["VCSOTHERDATA"] = [self.stack[-1]] - except IndexError: - self.project.pdata["VCSOTHERDATA"] = [] - - def startProjectTypeSpecificData(self, attrs): - """ - Handler method for the "ProjectTypeSpecificData" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endProjectTypeSpecificData(self): - """ - Handler method for the "ProjectTypeSpecificData" end tag. - """ - try: - self.project.pdata["PROJECTTYPESPECIFICDATA"] = self.stack[-1] - except IndexError: - self.project.pdata["PROJECTTYPESPECIFICDATA"] = {} - - def startDocumentationParams(self, attrs): - """ - Handler method for the "DocumentationParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endDocumentationParams(self): - """ - Handler method for the "DocumentationParams" end tag. - """ - try: - self.project.pdata["DOCUMENTATIONPARMS"] = self.stack[-1] - except IndexError: - self.project.pdata["DOCUMENTATIONPARMS"] = {} - - def startPackagersParams(self, attrs): - """ - Handler method for the "PackagersParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endPackagersParams(self): - """ - Handler method for the "PackagersParams" end tag. - """ - try: - self.project.pdata["PACKAGERSPARMS"] = self.stack[-1] - except IndexError: - self.project.pdata["PACKAGERSPARMS"] = {} - - def startCheckersParams(self, attrs): - """ - Handler method for the "CheckersParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endCheckersParams(self): - """ - Handler method for the "CheckersParams" end tag. - """ - try: - self.project.pdata["CHECKERSPARMS"] = self.stack[-1] - except IndexError: - self.project.pdata["CHECKERSPARMS"] = {} - - def startOtherToolsParams(self, attrs): - """ - Handler method for the "OtherToolsParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endOtherToolsParams(self): - """ - Handler method for the "OtherToolsParams" end tag. - """ - try: - self.project.pdata["OTHERTOOLSPARMS"] = self.stack[-1] - except IndexError: - self.project.pdata["OTHERTOOLSPARMS"] = {} - - def endDir(self): - """ - Handler method for the "Dir" end tag. - """ - self.pathStack.append(self.buffer) - - def endName(self): - """ - Handler method for the "Name" end tag. - """ - self.pathStack.append(self.buffer) - - def endTranslationPattern(self): - """ - Handler method for the "TranslationPattern" end tag. - """ - self.project.pdata["TRANSLATIONPATTERN"].append( - Utilities.toNativeSeparators(self.buffer)) - - def startTranslationsBinPath(self, attrs): - """ - Handler method for the "TranslationsBinPath" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endTranslationsBinPath(self): - """ - Handler method for the "TranslationsBinPath" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["TRANSLATIONSBINPATH"].append(path) - - def startSource(self, attrs): - """ - Handler method for the "Source" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endSource(self): - """ - Handler method for the "Source" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["SOURCES"].append(path) - - def startForm(self, attrs): - """ - Handler method for the "Form" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endForm(self): - """ - Handler method for the "Form" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["FORMS"].append(path) - - def startTranslation(self, attrs): - """ - Handler method for the "Translation" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endTranslation(self): - """ - Handler method for the "Translation" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["TRANSLATIONS"].append(path) - - def startTranslationException(self, attrs): - """ - Handler method for the "TranslationException" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endTranslationException(self): - """ - Handler method for the "TranslationException" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["TRANSLATIONEXCEPTIONS"].append(path) - - def startResource(self, attrs): - """ - Handler method for the "Resource" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endResource(self): - """ - Handler method for the "Resource" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["RESOURCES"].append(path) - - def startInterface(self, attrs): - """ - Handler method for the "Interface" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endInterface(self): - """ - Handler method for the "Interface" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["INTERFACES"].append(path) - - def startOther(self, attrs): - """ - Handler method for the "Other" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endOther(self): - """ - Handler method for the "Other" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["OTHERS"].append(path) - - def startMainScript(self, attrs): - """ - Handler method for the "MainScript" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endMainScript(self): - """ - Handler method for the "MainScript" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - self.project.pdata["MAINSCRIPT"] = [path] - - def startFiletypeAssociation(self, attrs): - """ - Handler method for the "FiletypeAssociation" start tag. - - @param attrs list of tag attributes - """ - pattern = attrs.get("pattern", "") - filetype = attrs.get("type", "OTHERS") - if pattern: - self.project.pdata["FILETYPES"][pattern] = filetype - - def startLexerAssociation(self, attrs): - """ - Handler method for the "LexerAssociation" start tag. - - @param attrs list of tag attributes - """ - pattern = attrs.get("pattern", "") - lexer = attrs.get("lexer", "") - if pattern: - self.project.pdata["LEXERASSOCS"][pattern] = lexer - - def startEol(self, attrs): - """ - Handler method for the "Eol" start tag. - - @param attrs list of tag attributes - """ - index = int(attrs.get("index", "0")) - self.project.pdata["EOL"] = [index] - - def __buildPath(self): - """ - Private method to assemble a path. - - @return The ready assembled path. (string) - """ - path = "" - if self.pathStack and not self.pathStack[0]: - self.pathStack[0] = os.sep - for p in self.pathStack: - path = os.path.join(path, p) - return path - - def startProject(self, attrs): - """ - Handler method for the "Project" start tag. - - @param attrs list of tag attributes - """ - self.version = attrs.get('version', projectFileFormatVersion) - - def getVersion(self): - """ - Public method to retrieve the version of the project. - - @return String containing the version number. - """ - return self.version - - ############################################################### - ## below are handler methods kept for backward compatibility - ############################################################### - - def endUIType(self): - """ - Handler method for the "UIType" end tag. - """ - self.project.pdata["PROJECTTYPE"] = [self.buffer] - - def startTranslationPrefix(self, attrs): - """ - Handler method for the "TranslationPrefix" start tag. - - @param attrs list of tag attributes - """ - self.pathStack = [] - self.buffer = "" - - def endTranslationPrefix(self): - """ - Handler method for the "TranslationPrefix" end tag. - """ - if self.version >= '4.3': - path = Utilities.toNativeSeparators(self.buffer) - else: - path = self.__buildPath() - if not path.endswith("_"): - path = "{0}_".format(path) - self.project.pdata["TRANSLATIONPATTERN"].append("{0}%language%.ts".format(path)) - - def startEric4DocParams(self, attrs): - """ - Handler method for the "Eric4DocParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endEric4DocParams(self): - """ - Handler method for the "Eric4DocParams" end tag. - """ - try: - self.project.pdata["DOCUMENTATIONPARMS"]["ERIC4DOC"] = self.stack[-1] - except IndexError: - pass - - def startEric4ApiParams(self, attrs): - """ - Handler method for the "Eric4ApiParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endEric4ApiParams(self): - """ - Handler method for the "Eric4ApiParams" end tag. - """ - try: - self.project.pdata["DOCUMENTATIONPARMS"]["ERIC4API"] = self.stack[-1] - except IndexError: - pass - - def startCxfreezeParams(self, attrs): - """ - Handler method for the "CxfreezeParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endCxfreezeParams(self): - """ - Handler method for the "CxfreezeParams" end tag. - """ - try: - self.project.pdata["PACKAGERSPARMS"]["CXFREEZE"] = self.stack[-1] - except IndexError: - self.project.pdata["PACKAGERSPARMS"] = {} - - def startPyLintParams(self, attrs): - """ - Handler method for the "PyLintParams" start tag. - - @param attrs list of tag attributes - """ - self.defaultStartElement(attrs) - self._prepareBasics() - - def endPyLintParams(self): - """ - Handler method for the "PyLintParams" end tag. - """ - try: - self.project.pdata["CHECKERSPARMS"]["PYLINT"] = self.stack[-1] - except IndexError: - self.project.pdata["CHECKERSPARMS"] = {}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/E5XML/ProjectReader.py Tue Sep 14 09:37:12 2010 +0200 @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2010 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a class for reading an XML project file. +""" + +from .Config import projectFileFormatVersion +from .XMLStreamReaderBase import XMLStreamReaderBase + +import Utilities + +class ProjectReader(XMLStreamReaderBase): + """ + Class for reading an XML project file. + """ + supportedVersions = ["4.6", "5.0", "5.1"] + + def __init__(self, device, project): + """ + Constructor + + @param device reference to the I/O device to read from (QIODevice) + @param project Reference to the project object to store the + information into. + """ + XMLStreamReaderBase.__init__(self, device) + + self.project = project + + self.version = "" + + def readXML(self): + """ + Public method to read and parse the XML document. + """ + while not self.atEnd(): + self.readNext() + if self.isStartElement(): + if self.name() == "Project": + self.version = \ + self.attribute("version", projectFileFormatVersion) + if self.version not in self.supportedVersions: + self.raiseUnsupportedFormatVersion(self.version) + elif self.name() == "Language": + self.project.pdata["SPELLLANGUAGE"] = [self.readElementText()] + elif self.name() == "ProjectWordList": + self.project.pdata["SPELLWORDS"] = \ + [Utilities.toNativeSeparators(self.readElementText())] + elif self.name() == "ProjectExcludeList": + self.project.pdata["SPELLEXCLUDES"] = \ + [Utilities.toNativeSeparators(self.readElementText())] + elif self.name() == "Hash": + self.project.pdata["HASH"] = [self.readElementText()] + elif self.name() == "ProgLanguage": + self.project.pdata["MIXEDLANGUAGE"] = \ + [int(self.attribute("mixed", "0"))] + self.project.pdata["PROGLANGUAGE"] = [self.readElementText()] + elif self.name() == "ProjectType": + self.project.pdata["PROJECTTYPE"] = [self.readElementText()] + elif self.name() == "Description": + self.project.pdata["DESCRIPTION"] = [self.readElementText()] + elif self.name() == "Version": + self.project.pdata["VERSION"] = [self.readElementText()] + elif self.name() == "Author": + self.project.pdata["AUTHOR"] = [self.readElementText()] + elif self.name() == "Email": + self.project.pdata["EMAIL"] = [self.readElementText()] + elif self.name() == "TranslationPattern": + self.project.pdata["TRANSLATIONPATTERN"] = \ + [Utilities.toNativeSeparators(self.readElementText())] + elif self.name() == "TranslationsBinPath": + self.project.pdata["TRANSLATIONSBINPATH"] = \ + [Utilities.toNativeSeparators(self.readElementText())] + elif self.name() == "Eol": + self.project.pdata["EOL"] = [int(self.attribute("index", "0"))] + elif self.name() == "Sources": + self.__readFiles("Sources", "Source", "SOURCES") + elif self.name() == "Forms": + self.__readFiles("Forms", "Form", "FORMS") + elif self.name() == "Translations": + self.__readFiles("Translations", "Translation", "TRANSLATIONS") + elif self.name() == "TranslationExceptions": + self.__readFiles("TranslationExceptions", "TranslationException", + "TRANSLATIONEXCEPTIONS") + elif self.name() == "Resources": + self.__readFiles("Resources", "Resource", "RESOURCES") + elif self.name() == "Interfaces": + self.__readFiles("Interfaces", "Interface", "INTERFACES") + elif self.name() == "Others": + self.__readFiles("Others", "Other", "OTHERS") + elif self.name() == "MainScript": + self.project.pdata["MAINSCRIPT"] = \ + [Utilities.toNativeSeparators(self.readElementText())] + elif self.name() == "Vcs": + self.__readVcs() + elif self.name() == "FiletypeAssociations": + self.__readFiletypeAssociations() + elif self.name() == "LexerAssociations": + self.__readLexerAssociations() + elif self.name() == "ProjectTypeSpecific": + self.__readBasicDataField("ProjectTypeSpecific", + "ProjectTypeSpecificData", "PROJECTTYPESPECIFICDATA") + elif self.name() == "Documentation": + self.__readBasicDataField("Documentation", + "DocumentationParams", "DOCUMENTATIONPARMS") + elif self.name() == "Packagers": + self.__readBasicDataField("Packagers", + "PackagersParams", "PACKAGERSPARMS") + elif self.name() == "Checkers": + self.__readBasicDataField("Checkers", + "CheckersParams", "CHECKERSPARMS") + elif self.name() == "OtherTools": + self.__readBasicDataField("OtherTools", + "OtherToolsParams", "OTHERTOOLSPARMS") + else: + self.raiseUnexpectedStartTag(self.name()) + + self.showErrorMessage() + + def __readFiles(self, tag, listTag, dataKey): + """ + Private method to read a list of files. + + @param tag name of the list tag (string) + @param listTag name of the list element tag (string) + @param dataKey key of the project data element (string) + """ + while not self.atEnd(): + self.readNext() + if self.isEndElement() and self.name() == tag: + break + + if self.isStartElement(): + if self.name() == listTag: + self.project.pdata[dataKey].append( + Utilities.toNativeSeparators(self.readElementText())) + else: + self.raiseUnexpectedStartTag(self.name()) + + def __readBasicDataField(self, tag, dataTag, dataKey): + """ + Private method to read a list of files. + + @param tag name of the list tag (string) + @param dataTag name of the data tag (string) + @param dataKey key of the project data element (string) + """ + while not self.atEnd(): + self.readNext() + if self.isEndElement() and self.name() == tag: + break + + if self.isStartElement(): + if self.name() == dataTag: + self.project.pdata[dataKey] = self._readBasics() + else: + self.raiseUnexpectedStartTag(self.name()) + + def __readVcs(self): + """ + Private method to read the VCS info. + """ + while not self.atEnd(): + self.readNext() + if self.isEndElement() and self.name() == "Vcs": + break + + if self.isStartElement(): + if self.name() == "VcsType": + self.project.pdata["VCS"] = [self.readElementText()] + elif self.name() == "VcsOptions": + self.project.pdata["VCSOPTIONS"] = [self._readBasics()] + elif self.name() == "VcsOtherData": + self.project.pdata["VCSOTHERDATA"] = [self._readBasics()] + else: + self.raiseUnexpectedStartTag(self.name()) + + def __readFiletypeAssociations(self): + """ + Private method to read the file type associations. + """ + while not self.atEnd(): + self.readNext() + if self.isEndElement() and self.name() == "FiletypeAssociations": + break + + if self.isStartElement(): + if self.name() == "FiletypeAssociation": + pattern = self.attribute("pattern", "") + filetype = self.attribute("type", "OTHERS") + if pattern: + self.project.pdata["FILETYPES"][pattern] = filetype + else: + self.raiseUnexpectedStartTag(self.name()) + + def __readLexerAssociations(self): + """ + Private method to read the lexer associations. + """ + while not self.atEnd(): + self.readNext() + if self.isEndElement() and self.name() == "LexerAssociations": + break + + if self.isStartElement(): + if self.name() == "LexerAssociation": + pattern = self.attribute("pattern", "") + lexer = self.attribute("lexer") + if pattern: + self.project.pdata["LEXERASSOCS"][pattern] = lexer + else: + self.raiseUnexpectedStartTag(self.name())
--- a/E5XML/XMLEntityResolver.py Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2004 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a specialized entity resolver to find our DTDs. -""" - -import os.path -from xml.sax.handler import EntityResolver - -from eric5config import getConfig - -class XMLEntityResolver(EntityResolver): - """ - Class implementing a specialized entity resolver to find our DTDs. - """ - def resolveEntity(self, publicId, systemId): - """ - Public method to resolve the system identifier of an entity and - return either the system identifier to read from as a string. - - @param publicId publicId of an entity (string) - @param systemId systemId of an entity to reslove (string) - @return resolved systemId (string) - """ - if systemId.startswith('http://'): - sId = systemId - - elif os.path.exists(systemId): - sId = systemId - - else: - dtdDir = getConfig('ericDTDDir') - if not os.path.isabs(dtdDir): - dtdDir = os.path.abspath(dtdDir) - sId = os.path.join(dtdDir, systemId) - if not os.path.exists(sId): - ind = sId.rfind('-') - if ind != -1: - sId = "{0}.dtd".format(sId[:ind]) - if not os.path.exists(sId): - sId = "" - - return sId
--- a/E5XML/XMLErrorHandler.py Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2004 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing an error handler class. -""" - -from xml.sax.handler import ErrorHandler - -from .XMLMessageDialog import XMLMessageDialog - -class XMLParseError(Exception): - """ - Class implementing an exception for recoverable parse errors. - """ - pass - -class XMLFatalParseError(XMLParseError): - """ - Class implementing an exception for recoverable parse errors. - """ - pass - -class XMLErrorHandler(ErrorHandler): - """ - Class implementing an error handler class. - """ - def __init__(self): - """ - Constructor - """ - self.errors = 0 - self.fatals = 0 - self.warnings = 0 - self.totals = 0 - - # list of tuples of (message type, system id, line number, - # column number, message) - self.msgs = [] - - def error(self, exception): - """ - Public method to handle a recoverable error. - - @param exception Exception object describing the error (SAXParseException) - """ - self.errors += 1 - self.totals += 1 - self.msgs.append(( - "E", - exception.getSystemId(), - exception.getLineNumber(), - exception.getColumnNumber(), - exception.getMessage() - )) - - def fatalError(self, exception): - """ - Public method to handle a non-recoverable error. - - @param exception Exception object describing the error (SAXParseException) - @exception XMLFatalParseError a fatal parse error has occured - """ - self.fatals += 1 - self.totals += 1 - self.msgs.append(( - "F", - exception.getSystemId(), - exception.getLineNumber(), - exception.getColumnNumber(), - exception.getMessage() - )) - raise XMLFatalParseError - - def warning(self, exception): - """ - Public method to handle a warning. - - @param exception Exception object describing the error (SAXParseException) - """ - self.warnings += 1 - self.totals += 1 - self.msgs.append(( - "W", - exception.getSystemId(), - exception.getLineNumber(), - exception.getColumnNumber(), - exception.getMessage() - )) - - def getParseMessages(self): - """ - Public method to retrieve all messages. - - @return list of tuples of (message type, system id, line no, column no, - message) - """ - return self.msgs - - def showParseMessages(self): - """ - Public method to show the parse messages (if any) in a dialog. - """ - if self.totals: - dlg = XMLMessageDialog(self.msgs, None) - dlg.exec_() \ No newline at end of file
--- a/E5XML/XMLHandlerBase.py Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2004 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a base class for all of eric5s XML handlers. -""" - -import pickle -import base64 - -from xml.sax.handler import ContentHandler - -class XMLHandlerBase(ContentHandler): - """ - Class implementing the base class for al of eric5s XML handlers. - """ - def __init__(self): - """ - Constructor - """ - self.startDocumentSpecific = None - - self.elements = { - 'none' : (self.defaultStartElement, self.endNone), - 'int' : (self.defaultStartElement, self.endInt), - 'float' : (self.defaultStartElement, self.endFloat), - 'complex' : (self.defaultStartElement, self.endComplex), - 'bool' : (self.defaultStartElement, self.endBool), - 'string' : (self.defaultStartElement, self.endString), - 'bytes' : (self.defaultStartElement, self.endBytes), - 'bytearray' : (self.defaultStartElement, self.endBytearray), - 'tuple' : (self.startTuple, self.endTuple), - 'list' : (self.startList, self.endList), - 'dict' : (self.startDictionary, self.endDictionary), - 'set' : (self.startSet, self.endSet), - 'frozenset' : (self.startFrozenset, self.endFrozenset), - 'pickle' : (self.startPickle, self.endPickle), - # for backward compatibility - 'long' : (self.defaultStartElement, self.endInt), - 'unicode' : (self.defaultStartElement, self.endString), - } - - self.buffer = "" - self.stack = [] - self._marker = '__MARKER__' - - self.NEWPARA = chr(0x2029) - self.NEWLINE = chr(0x2028) - - def unescape(self, text, attribute = False): - """ - Public method used to unescape certain characters. - - @param text the text to unescape (string) - @param attribute flag indicating unescaping is done for an attribute - """ - if attribute: - return text.replace(""",'"').replace(">",">")\ - .replace("<","<").replace("&","&") - else: - return text.replace(">",">").replace("<","<").replace("&","&") - - def decodedNewLines(self, text): - """ - Public method to decode newlines and paragraph breaks. - - @param text text to decode (string) - """ - return text.replace(self.NEWPARA, "\n\n").replace(self.NEWLINE, "\n") - - def startDocument(self): - """ - Handler called, when the document parsing is started. - """ - self.buffer = "" - if self.startDocumentSpecific is not None: - self.startDocumentSpecific() - - def startElement(self, name, attrs): - """ - Handler called, when a starting tag is found. - - @param name name of the tag (string) - @param attrs list of tag attributes - """ - try: - self.elements[name][0](attrs) - except KeyError: - pass - - def endElement(self, name): - """ - Handler called, when an ending tag is found. - - @param name name of the tag (string) - """ - try: - self.elements[name][1]() - except KeyError: - pass - - def characters(self, chars): - """ - Handler called for ordinary text. - - @param chars the scanned text (string) - """ - self.buffer += chars - - def defaultStartElement(self, attrs): - """ - Handler method for common start tags. - - @param attrs list of tag attributes - """ - self.buffer = "" - - def defaultEndElement(self): - """ - Handler method for the common end tags. - """ - pass - - def _prepareBasics(self): - """ - Protected method to prepare the parsing of XML for basic python types. - """ - self.stack = [] - - ############################################################################ - ## The various handler methods for basic types - ############################################################################ - - def endNone(self): - """ - Handler method for the "none" end tag. - """ - self.stack.append(None) - - def endInt(self): - """ - Handler method for the "int" end tag. - """ - self.stack.append(int(self.buffer.strip())) - - def endBool(self): - """ - Handler method for the "bool" end tag. - """ - if self.buffer.strip() == "True": - self.stack.append(True) - else: - self.stack.append(False) - - def endFloat(self): - """ - Handler method for the "float" end tag. - """ - self.stack.append(float(self.buffer.strip())) - - def endComplex(self): - """ - Handler method for the "complex" end tag. - """ - real, imag = self.buffer.strip().split() - self.stack.append(float(real) + float(imag)*1j) - - def endString(self): - """ - Handler method for the "string" end tag. - """ - s = str(self.unescape(self.buffer)) - self.stack.append(s) - - def endBytes(self): - """ - Handler method for the "bytes" end tag. - """ - by = bytes([int(b) for b in self.buffer.strip().split(",")]) - self.stack.append(by) - - def endBytearray(self): - """ - Handler method for the "bytearray" end tag. - """ - by = bytearray([int(b) for b in self.buffer.strip().split(",")]) - self.stack.append(by) - - def startList(self, attrs): - """ - Handler method for the "list" start tag. - - @param attrs list of tag attributes - """ - self.stack.append(self._marker) - - def endList(self): - """ - Handler method for the "list" end tag. - """ - for i in range(len(self.stack) - 1, -1, -1): - if self.stack[i] is self._marker: - break - assert i != -1 - l = self.stack[i + 1:len(self.stack)] - self.stack[i:] = [l] - - def startTuple(self, attrs): - """ - Handler method for the "tuple" start tag. - - @param attrs list of tag attributes - """ - self.stack.append(self._marker) - - def endTuple(self): - """ - Handler method for the "tuple" end tag. - """ - for i in range(len(self.stack) - 1, -1, -1): - if self.stack[i] is self._marker: - break - assert i != -1 - t = tuple(self.stack[i + 1:len(self.stack)]) - self.stack[i:] = [t] - - def startDictionary(self, attrs): - """ - Handler method for the "dictionary" start tag. - - @param attrs list of tag attributes - """ - self.stack.append(self._marker) - - def endDictionary(self): - """ - Handler method for the "dictionary" end tag. - """ - for i in range(len(self.stack) - 1, -1, -1): - if self.stack[i] is self._marker: - break - assert i != -1 - d = {} - for j in range(i + 1, len(self.stack), 2): - d[self.stack[j]] = self.stack[j + 1] - self.stack[i:] = [d] - - def startSet(self, attrs): - """ - Handler method for the "set" start tag. - - @param attrs list of tag attributes - """ - self.stack.append(self._marker) - - def endSet(self): - """ - Handler method for the "set" end tag. - """ - for i in range(len(self.stack) - 1, -1, -1): - if self.stack[i] is self._marker: - break - assert i != -1 - s = set(self.stack[i + 1:len(self.stack)]) - self.stack[i:] = [s] - - def startFrozenset(self, attrs): - """ - Handler method for the "frozenset" start tag. - - @param attrs list of tag attributes - """ - self.stack.append(self._marker) - - def endFrozenset(self): - """ - Handler method for the "frozenset" end tag. - """ - for i in range(len(self.stack) - 1, -1, -1): - if self.stack[i] is self._marker: - break - assert i != -1 - f = frozenset(self.stack[i + 1:len(self.stack)]) - self.stack[i:] = [f] - - def startPickle(self, attrs): - """ - Handler method for the "pickle" start tag. - - @param attrs list of tag attributes - """ - self.pickleEnc = attrs.get("encoding", "base64") - - def endPickle(self): - """ - Handler method for the "pickle" end tag. - """ - pic = base64.b64decode(self.buffer.encode("ASCII")) - self.stack.append(pickle.loads(pic))
--- a/E5XML/XMLMessageDialog.py Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2004 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a dialog to display XML parse messages. -""" - -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -from .Ui_XMLMessageDialog import Ui_XMLMessageDialog - - -class XMLMessageDialog(QDialog, Ui_XMLMessageDialog): - """ - Class implementing a dialog to display XML parse messages. - """ - def __init__(self, msgs, parent = None): - """ - Constructor - - @param msgs list of tuples of (message type, system id, - line no, column no, message) - @param parent parent object of the dialog (QWidget) - """ - QDialog.__init__(self,parent) - self.setupUi(self) - - for type, sysId, line, column, msg in msgs: - if type == "F": - color = QColor(Qt.red) - self.__appendText(self.trUtf8("Fatal Error"), color) - elif type == "E": - color = QColor(Qt.blue) - self.__appendText(self.trUtf8("Error"), color) - elif type == "W": - color = QColor(Qt.black) - self.__appendText(self.trUtf8("Warning"), color) - - self.__appendText(sysId, color) - self.__appendText(self.trUtf8("Line: {0}, Column: {1}") - .format(line, column), color) - self.__appendText(msg, color) - - self.__appendText("------", QColor(Qt.black)) - - tc = self.messages.textCursor() - tc.movePosition(QTextCursor.Start) - self.messages.setTextCursor(tc) - self.messages.ensureCursorVisible() - - def __appendText(self, txt, color): - """ - Private method to append text to the end of the messages pane. - - @param txt text to insert (string) - @param color text color to be used (QColor) - """ - if txt is not None: - tc = self.messages.textCursor() - tc.movePosition(QTextCursor.End) - self.messages.setTextCursor(tc) - self.messages.setTextColor(color) - self.messages.insertPlainText(txt) - self.messages.insertPlainText("\n")
--- a/E5XML/XMLMessageDialog.ui Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -<ui version="4.0" > - <class>XMLMessageDialog</class> - <widget class="QDialog" name="XMLMessageDialog" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>567</width> - <height>253</height> - </rect> - </property> - <property name="windowTitle" > - <string>XML Parse Messages</string> - </property> - <property name="sizeGripEnabled" > - <bool>true</bool> - </property> - <layout class="QVBoxLayout" > - <item> - <widget class="QTextEdit" name="messages" > - <property name="readOnly" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons" > - <set>QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="6" /> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>XMLMessageDialog</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel" > - <x>157</x> - <y>231</y> - </hint> - <hint type="destinationlabel" > - <x>157</x> - <y>251</y> - </hint> - </hints> - </connection> - </connections> -</ui>
--- a/E5XML/XMLUtilities.py Mon Sep 13 16:14:10 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2004 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing various XML utility functions. -""" - -def make_parser(validating): - """ - Function to generate an XML parser. - - First it will be tried to generate a validating parser. If - this attempt fails, a non validating parser is tried next. - - @param validating flag indicating a validating parser is requested - @return XML parser object - """ - if validating: - # see if we have a working validating parser available - try: - import _xmlplus - except ImportError: - validating = False - else: - try: - v = _xmlplus.version_info - except AttributeError: - validating = False - else: - if v < (0, 8, 3): - validating = False - - if validating: - try: - from xml.sax.sax2exts import XMLValParserFactory - return XMLValParserFactory.make_parser() - except ImportError: - from xml.sax import make_parser as sax_make_parser - return sax_make_parser() - else: - from xml.sax import make_parser as sax_make_parser - return sax_make_parser()
--- a/Project/Project.py Mon Sep 13 16:14:10 2010 +0200 +++ b/Project/Project.py Tue Sep 14 09:37:12 2010 +0200 @@ -37,11 +37,7 @@ from .LexerAssociationDialog import LexerAssociationDialog from .UserPropertiesDialog import UserPropertiesDialog -from E5XML.XMLUtilities import make_parser -from E5XML.XMLErrorHandler import XMLErrorHandler, XMLFatalParseError -from E5XML.XMLEntityResolver import XMLEntityResolver - -from E5XML.ProjectHandler import ProjectHandler +from E5XML.ProjectReader import ProjectReader from E5XML.ProjectWriter import ProjectWriter from E5XML.UserProjectReader import UserProjectReader from E5XML.UserProjectWriter import UserProjectWriter @@ -573,33 +569,20 @@ @param fn filename of the project file to be read (string) @return flag indicating success """ - try: - if fn.lower().endswith("e4pz"): - try: - import gzip - except ImportError: - QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, - self.trUtf8("Read project file"), - self.trUtf8("""Compressed project files not supported.""" - """ The compression library is missing.""")) - return False - g = gzip.open(fn, "rb") - f = io.StringIO(g.read().decode("utf-8")) - g.close() - else: - f = open(fn, "r", encoding = "utf-8") - line = f.readline() - dtdLine = f.readline() + f = QFile(fn) + if f.open(QIODevice.ReadOnly): + reader = ProjectReader(f, self) + reader.readXML() + res = not reader.hasError() f.close() - except EnvironmentError: + else: QApplication.restoreOverrideCursor() E5MessageBox.critical(self.ui, self.trUtf8("Read project file"), self.trUtf8("<p>The project file <b>{0}</b> could not be read.</p>")\ .format(fn)) return False - + self.pfile = os.path.abspath(fn) self.ppath = os.path.abspath(os.path.dirname(fn)) if Utilities.isWindowsPlatform(): @@ -610,16 +593,6 @@ # insert filename into list of recently opened projects self.__syncRecent() - # now read the file - if not line.startswith('<?xml'): - QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, - self.trUtf8("Read project file"), - self.trUtf8("<p>The project file <b>{0}</b> has an unsupported" - " format.</p>").format(fn)) - return False - - res = self.__readXMLProject(fn, dtdLine.startswith("<!DOCTYPE")) if res: if len(self.pdata["TRANSLATIONPATTERN"]) == 1: self.translationsRoot = \ @@ -669,75 +642,6 @@ return res - def __readXMLProject(self, fn, validating): - """ - Private method to read the project data from an XML file. - - @param fn filename of the project file to be read (string) - @param validating flag indicating a validation of the XML file is - requested (boolean) - @return flag indicating success (boolean) - """ - if fn.lower().endswith("e4pz"): - # work around for a bug in xmlproc - validating = False - - parser = make_parser(validating) - handler = ProjectHandler(self) - er = XMLEntityResolver() - eh = XMLErrorHandler() - - parser.setContentHandler(handler) - parser.setEntityResolver(er) - parser.setErrorHandler(eh) - - try: - if fn.lower().endswith("e4pz"): - try: - import gzip - except ImportError: - QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, - self.trUtf8("Read project file"), - self.trUtf8("""Compressed project files not supported.""" - """ The compression library is missing.""")) - return False - g = gzip.open(fn, "rb") - f = io.StringIO(g.read().decode("utf-8")) - g.close() - else: - f = open(fn, "r", encoding = "utf-8") - try: - try: - parser.parse(f) - except UnicodeEncodeError: - f.seek(0) - buf = io.StringIO(f.read()) - parser.parse(buf) - finally: - f.close() - except IOError: - QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, - self.trUtf8("Read project file"), - self.trUtf8("<p>The project file <b>{0}</b> could not be read.</p>")\ - .format(fn)) - return False - except XMLFatalParseError: - QApplication.restoreOverrideCursor() - E5MessageBox.critical(self.ui, - self.trUtf8("Read project file"), - self.trUtf8("<p>The project file <b>{0}</b> has invalid contents.</p>")\ - .format(fn)) - eh.showParseMessages() - return False - - QApplication.restoreOverrideCursor() - eh.showParseMessages() - QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) - QApplication.processEvents() - return True - def __writeProject(self, fn = None): """ Private method to save the project infos to a project file.
--- a/eric5.e4p Mon Sep 13 16:14:10 2010 +0200 +++ b/eric5.e4p Tue Sep 14 09:37:12 2010 +0200 @@ -710,7 +710,6 @@ <Source>DebugClients/Python/coverage/results.py</Source> <Source>E5XML/ProjectWriter.py</Source> <Source>E5XML/SessionWriter.py</Source> - <Source>E5XML/ProjectHandler.py</Source> <Source>E5XML/ShortcutsWriter.py</Source> <Source>E5XML/DebuggerPropertiesWriter.py</Source> <Source>E5XML/TemplatesWriter.py</Source> @@ -720,12 +719,7 @@ <Source>E5XML/UserProjectWriter.py</Source> <Source>E5XML/MultiProjectWriter.py</Source> <Source>E5XML/HighlightingStylesWriter.py</Source> - <Source>E5XML/XMLUtilities.py</Source> - <Source>E5XML/XMLHandlerBase.py</Source> <Source>E5XML/XMLWriterBase.py</Source> - <Source>E5XML/XMLMessageDialog.py</Source> - <Source>E5XML/XMLEntityResolver.py</Source> - <Source>E5XML/XMLErrorHandler.py</Source> <Source>E5Graphics/__init__.py</Source> <Source>E5Graphics/E5ArrowItem.py</Source> <Source>E5Graphics/E5GraphicsView.py</Source> @@ -821,6 +815,7 @@ <Source>E5XML/MultiProjectReader.py</Source> <Source>E5XML/UserProjectReader.py</Source> <Source>E5XML/DebuggerPropertiesReader.py</Source> + <Source>E5XML/ProjectReader.py</Source> </Sources> <Forms> <Form>PyUnit/UnittestDialog.ui</Form> @@ -1018,7 +1013,6 @@ <Form>Helpviewer/Passwords/PasswordsDialog.ui</Form> <Form>Helpviewer/AdBlock/AdBlockDialog.ui</Form> <Form>Helpviewer/OpenSearch/OpenSearchEditDialog.ui</Form> - <Form>E5XML/XMLMessageDialog.ui</Form> <Form>E5Network/E5NetworkMonitor.ui</Form> <Form>E5Network/E5NetworkHeaderDetailsDialog.ui</Form> <Form>E5Gui/E5ToolBarDialog.ui</Form>