Tue, 14 Sep 2010 18:04:15 +0200
Merge latest changes.
--- a/DTDs/DebuggerProperties-3.8.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -<!-- This is the DTD for eric3's project session file version 3.8 --> - -<!ELEMENT Interpreter (#PCDATA)> - -<!ELEMENT DebugClient (#PCDATA)> - -<!ELEMENT Environment (#PCDATA)> -<!ATTLIST Environment - override CDATA #REQUIRED> - -<!ELEMENT RemoteHost (#PCDATA)> -<!ELEMENT RemoteCommand (#PCDATA)> -<!ELEMENT RemoteDebugger (RemoteHost, - RemoteCommand)> -<!ATTLIST RemoteDebugger - on CDATA #REQUIRED> - -<!ELEMENT RemotePath (#PCDATA)> -<!ELEMENT LocalPath (#PCDATA)> -<!ELEMENT PathTranslation (RemotePath, - LocalPath)> -<!ATTLIST PathTranslation - on CDATA #REQUIRED> - -<!ELEMENT ConsoleDebugger (#PCDATA)> -<!ATTLIST ConsoleDebugger - on CDATA #REQUIRED> - -<!ELEMENT Redirect EMPTY> -<!ATTLIST Redirect - on CDATA #REQUIRED> - -<!ELEMENT DebuggerProperties (Interpreter, - DebugClient, - Environment, - RemoteDebugger, - PathTranslation, - ConsoleDebugger, - Redirect)> -<!ATTLIST DebuggerProperties - version CDATA #REQUIRED>
--- a/DTDs/Project-4.0.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -<!-- This is the DTD for eric4's project file version 4.0 --> - -<!-- This is a copy of the Basic DTD --> -<!ELEMENT int (#PCDATA)> -<!ELEMENT long (#PCDATA)> -<!ELEMENT float (#PCDATA)> -<!ELEMENT complex (#PCDATA)> -<!ELEMENT bool (#PCDATA)> -<!ELEMENT string (#PCDATA)> -<!ELEMENT unicode (#PCDATA)> -<!ELEMENT none EMPTY> - -<!ELEMENT pickle (#PCDATA)> -<!ATTLIST pickle - method CDATA #REQUIRED - encoding CDATA #REQUIRED> - -<!ELEMENT key (int | long | float | complex | string | unicode)> -<!ELEMENT value (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)> - -<!ELEMENT dict (key, value)*> - -<!ELEMENT tuple (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> - -<!ELEMENT list (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> -<!-- End of the Basic DTD --> - -<!ELEMENT ProgLanguage (#PCDATA)> -<!ATTLIST ProgLanguage - mixed CDATA #REQUIRED> - -<!ELEMENT UIType (#PCDATA)> - -<!ELEMENT Description (#PCDATA)> - -<!ELEMENT Version (#PCDATA)> - -<!ELEMENT Author (#PCDATA)> - -<!ELEMENT Email (#PCDATA)> - -<!ELEMENT Dir (#PCDATA)> -<!ELEMENT Name (#PCDATA)> - -<!ELEMENT TranslationPrefix (Dir*, Name)> - -<!ELEMENT TranslationsBinPath (Dir*, Name)> - -<!ELEMENT Source (Dir*, Name)> - -<!ELEMENT Sources (Source*)> - -<!ELEMENT Form (Dir*, Name)> - -<!ELEMENT Forms (Form*)> - -<!ELEMENT Translation (Dir*, Name)> - -<!ELEMENT Translations (Translation*)> - -<!ELEMENT TranslationException (Dir*, Name)> - -<!ELEMENT TranslationExceptions (TranslationException*)> - -<!ELEMENT Resource (Dir*, Name)> - -<!ELEMENT Resources (Resource*)> - -<!ELEMENT Interface (Dir*, Name)> - -<!ELEMENT Interfaces (Interface*)> - -<!ELEMENT Other (Dir*, Name)> - -<!ELEMENT Others (Other*)> - -<!ELEMENT MainScript (Dir*, Name)> - -<!ELEMENT VcsType (#PCDATA)> -<!ELEMENT VcsOptions (dict)> -<!ELEMENT VcsOtherData (dict)> - -<!ELEMENT Vcs (VcsType?, - VcsOptions?, - VcsOtherData?)> - -<!ELEMENT Eric4DocParams (dict)> - -<!ELEMENT Eric4Doc (Eric4DocParams?)> - -<!ELEMENT Eric4ApiParams (dict)> - -<!ELEMENT Eric4Api (Eric4ApiParams?)> - -<!ELEMENT FiletypeAssociation EMPTY> -<!ATTLIST FiletypeAssociation - pattern CDATA #REQUIRED - type CDATA #REQUIRED> - -<!ELEMENT FiletypeAssociations (FiletypeAssociation*)> - -<!ELEMENT CxfreezeParams (dict)> - -<!ELEMENT Cxfreeze (CxfreezeParams?)> - -<!ELEMENT PyLintParams (dict)> - -<!ELEMENT PyLint (PyLintParams?)> - -<!ELEMENT Project (ProgLanguage, - UIType, - Description?, - Version?, - Author?, - Email?, - TranslationPrefix?, - TranslationsBinPath?, - Sources, - Forms, - Translations, - TranslationExceptions?, - Resources, - Interfaces, - Others, - MainScript?, - Vcs, - Eric4Doc?, - Eric4Api?, - FiletypeAssociations, - Cxfreeze?, - PyLint?)> -<!ATTLIST Project - version CDATA #REQUIRED>
--- a/DTDs/Project-4.1.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -<!-- This is the DTD for eric4's project file version 4.1 --> - -<!-- This is a copy of the Basic DTD --> -<!ELEMENT int (#PCDATA)> -<!ELEMENT long (#PCDATA)> -<!ELEMENT float (#PCDATA)> -<!ELEMENT complex (#PCDATA)> -<!ELEMENT bool (#PCDATA)> -<!ELEMENT string (#PCDATA)> -<!ELEMENT unicode (#PCDATA)> -<!ELEMENT none EMPTY> - -<!ELEMENT pickle (#PCDATA)> -<!ATTLIST pickle - method CDATA #REQUIRED - encoding CDATA #REQUIRED> - -<!ELEMENT key (int | long | float | complex | string | unicode)> -<!ELEMENT value (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)> - -<!ELEMENT dict (key, value)*> - -<!ELEMENT tuple (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> - -<!ELEMENT list (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> -<!-- End of the Basic DTD --> - -<!ELEMENT ProgLanguage (#PCDATA)> -<!ATTLIST ProgLanguage - mixed CDATA #REQUIRED> - -<!ELEMENT UIType (#PCDATA)> - -<!ELEMENT Description (#PCDATA)> - -<!ELEMENT Version (#PCDATA)> - -<!ELEMENT Author (#PCDATA)> - -<!ELEMENT Email (#PCDATA)> - -<!ELEMENT Dir (#PCDATA)> -<!ELEMENT Name (#PCDATA)> - -<!ELEMENT TranslationPrefix (Dir*, Name)> - -<!ELEMENT TranslationsBinPath (Dir*, Name)> - -<!ELEMENT Source (Dir*, Name)> - -<!ELEMENT Sources (Source*)> - -<!ELEMENT Form (Dir*, Name)> - -<!ELEMENT Forms (Form*)> - -<!ELEMENT Translation (Dir*, Name)> - -<!ELEMENT Translations (Translation*)> - -<!ELEMENT TranslationException (Dir*, Name)> - -<!ELEMENT TranslationExceptions (TranslationException*)> - -<!ELEMENT Resource (Dir*, Name)> - -<!ELEMENT Resources (Resource*)> - -<!ELEMENT Interface (Dir*, Name)> - -<!ELEMENT Interfaces (Interface*)> - -<!ELEMENT Other (Dir*, Name)> - -<!ELEMENT Others (Other*)> - -<!ELEMENT MainScript (Dir*, Name)> - -<!ELEMENT VcsType (#PCDATA)> -<!ELEMENT VcsOptions (dict)> -<!ELEMENT VcsOtherData (dict)> - -<!ELEMENT Vcs (VcsType?, - VcsOptions?, - VcsOtherData?)> - -<!ELEMENT FiletypeAssociation EMPTY> -<!ATTLIST FiletypeAssociation - pattern CDATA #REQUIRED - type CDATA #REQUIRED> - -<!ELEMENT FiletypeAssociations (FiletypeAssociation*)> - -<!ELEMENT DocumentationParams (dict)> - -<!ELEMENT Documentation (DocumentationParams?)> - -<!ELEMENT PackagersParams (dict)> - -<!ELEMENT Packagers (PackagersParams?)> - -<!ELEMENT CheckersParams (dict)> - -<!ELEMENT Checkers (CheckersParams?)> - -<!ELEMENT OtherToolsParams (dict)> - -<!ELEMENT OtherTools (OtherToolsParams?)> - -<!ELEMENT Project (ProgLanguage, - UIType, - Description?, - Version?, - Author?, - Email?, - TranslationPrefix?, - TranslationsBinPath?, - Sources, - Forms, - Translations, - TranslationExceptions?, - Resources, - Interfaces, - Others, - MainScript?, - Vcs, - FiletypeAssociations, - Documentation?, - Packagers?, - Checkers?, - OtherTools?)> -<!ATTLIST Project - version CDATA #REQUIRED>
--- a/DTDs/Project-4.2.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -<!-- This is the DTD for eric4's project file version 4.2 --> - -<!-- This is a copy of the Basic DTD --> -<!ELEMENT int (#PCDATA)> -<!ELEMENT long (#PCDATA)> -<!ELEMENT float (#PCDATA)> -<!ELEMENT complex (#PCDATA)> -<!ELEMENT bool (#PCDATA)> -<!ELEMENT string (#PCDATA)> -<!ELEMENT unicode (#PCDATA)> -<!ELEMENT none EMPTY> - -<!ELEMENT pickle (#PCDATA)> -<!ATTLIST pickle - method CDATA #REQUIRED - encoding CDATA #REQUIRED> - -<!ELEMENT key (int | long | float | complex | string | unicode)> -<!ELEMENT value (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)> - -<!ELEMENT dict (key, value)*> - -<!ELEMENT tuple (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> - -<!ELEMENT list (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> -<!-- End of the Basic DTD --> - -<!ELEMENT ProgLanguage (#PCDATA)> -<!ATTLIST ProgLanguage - mixed CDATA #REQUIRED> - -<!ELEMENT ProjectType (#PCDATA)> - -<!ELEMENT Description (#PCDATA)> - -<!ELEMENT Version (#PCDATA)> - -<!ELEMENT Author (#PCDATA)> - -<!ELEMENT Email (#PCDATA)> - -<!ELEMENT Dir (#PCDATA)> -<!ELEMENT Name (#PCDATA)> - -<!ELEMENT TranslationPrefix (Dir*, Name)> - -<!ELEMENT TranslationsBinPath (Dir*, Name)> - -<!ELEMENT Source (Dir*, Name)> - -<!ELEMENT Sources (Source*)> - -<!ELEMENT Form (Dir*, Name)> - -<!ELEMENT Forms (Form*)> - -<!ELEMENT Translation (Dir*, Name)> - -<!ELEMENT Translations (Translation*)> - -<!ELEMENT TranslationException (Dir*, Name)> - -<!ELEMENT TranslationExceptions (TranslationException*)> - -<!ELEMENT Resource (Dir*, Name)> - -<!ELEMENT Resources (Resource*)> - -<!ELEMENT Interface (Dir*, Name)> - -<!ELEMENT Interfaces (Interface*)> - -<!ELEMENT Other (Dir*, Name)> - -<!ELEMENT Others (Other*)> - -<!ELEMENT MainScript (Dir*, Name)> - -<!ELEMENT VcsType (#PCDATA)> -<!ELEMENT VcsOptions (dict)> -<!ELEMENT VcsOtherData (dict)> - -<!ELEMENT Vcs (VcsType?, - VcsOptions?, - VcsOtherData?)> - -<!ELEMENT FiletypeAssociation EMPTY> -<!ATTLIST FiletypeAssociation - pattern CDATA #REQUIRED - type CDATA #REQUIRED> - -<!ELEMENT FiletypeAssociations (FiletypeAssociation*)> - -<!ELEMENT DocumentationParams (dict)> - -<!ELEMENT Documentation (DocumentationParams?)> - -<!ELEMENT PackagersParams (dict)> - -<!ELEMENT Packagers (PackagersParams?)> - -<!ELEMENT CheckersParams (dict)> - -<!ELEMENT Checkers (CheckersParams?)> - -<!ELEMENT OtherToolsParams (dict)> - -<!ELEMENT OtherTools (OtherToolsParams?)> - -<!ELEMENT Project (ProgLanguage, - ProjectType, - Description?, - Version?, - Author?, - Email?, - TranslationPrefix?, - TranslationsBinPath?, - Sources, - Forms, - Translations, - TranslationExceptions?, - Resources, - Interfaces, - Others, - MainScript?, - Vcs, - FiletypeAssociations, - Documentation?, - Packagers?, - Checkers?, - OtherTools?)> -<!ATTLIST Project - version CDATA #REQUIRED>
--- a/DTDs/Project-4.3.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -<!-- This is the DTD for eric4's project file version 4.3 --> - -<!-- This is a copy of the Basic DTD --> -<!ELEMENT int (#PCDATA)> -<!ELEMENT long (#PCDATA)> -<!ELEMENT float (#PCDATA)> -<!ELEMENT complex (#PCDATA)> -<!ELEMENT bool (#PCDATA)> -<!ELEMENT string (#PCDATA)> -<!ELEMENT unicode (#PCDATA)> -<!ELEMENT none EMPTY> - -<!ELEMENT pickle (#PCDATA)> -<!ATTLIST pickle - method CDATA #REQUIRED - encoding CDATA #REQUIRED> - -<!ELEMENT key (int | long | float | complex | string | unicode)> -<!ELEMENT value (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)> - -<!ELEMENT dict (key, value)*> - -<!ELEMENT tuple (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> - -<!ELEMENT list (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> -<!-- End of the Basic DTD --> - -<!ELEMENT ProgLanguage (#PCDATA)> -<!ATTLIST ProgLanguage - mixed CDATA #REQUIRED> - -<!ELEMENT ProjectType (#PCDATA)> - -<!ELEMENT Description (#PCDATA)> - -<!ELEMENT Version (#PCDATA)> - -<!ELEMENT Author (#PCDATA)> - -<!ELEMENT Email (#PCDATA)> - -<!ELEMENT TranslationPrefix (#PCDATA)> - -<!ELEMENT TranslationsBinPath (#PCDATA)> - -<!ELEMENT Source (#PCDATA)> - -<!ELEMENT Sources (Source*)> - -<!ELEMENT Form (#PCDATA)> - -<!ELEMENT Forms (Form*)> - -<!ELEMENT Translation (#PCDATA)> - -<!ELEMENT Translations (Translation*)> - -<!ELEMENT TranslationException (#PCDATA)> - -<!ELEMENT TranslationExceptions (TranslationException*)> - -<!ELEMENT Resource (#PCDATA)> - -<!ELEMENT Resources (Resource*)> - -<!ELEMENT Interface (#PCDATA)> - -<!ELEMENT Interfaces (Interface*)> - -<!ELEMENT Other (#PCDATA)> - -<!ELEMENT Others (Other*)> - -<!ELEMENT MainScript (#PCDATA)> - -<!ELEMENT VcsType (#PCDATA)> -<!ELEMENT VcsOptions (dict)> -<!ELEMENT VcsOtherData (dict)> - -<!ELEMENT Vcs (VcsType?, - VcsOptions?, - VcsOtherData?)> - -<!ELEMENT FiletypeAssociation EMPTY> -<!ATTLIST FiletypeAssociation - pattern CDATA #REQUIRED - type CDATA #REQUIRED> - -<!ELEMENT FiletypeAssociations (FiletypeAssociation*)> - -<!ELEMENT DocumentationParams (dict)> - -<!ELEMENT Documentation (DocumentationParams?)> - -<!ELEMENT PackagersParams (dict)> - -<!ELEMENT Packagers (PackagersParams?)> - -<!ELEMENT CheckersParams (dict)> - -<!ELEMENT Checkers (CheckersParams?)> - -<!ELEMENT OtherToolsParams (dict)> - -<!ELEMENT OtherTools (OtherToolsParams?)> - -<!ELEMENT Project (ProgLanguage, - ProjectType, - Description?, - Version?, - Author?, - Email?, - TranslationPrefix?, - TranslationsBinPath?, - Sources, - Forms, - Translations, - TranslationExceptions?, - Resources, - Interfaces, - Others, - MainScript?, - Vcs, - FiletypeAssociations, - Documentation?, - Packagers?, - Checkers?, - OtherTools?)> -<!ATTLIST Project - version CDATA #REQUIRED>
--- a/DTDs/Project-4.4.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -<!-- This is the DTD for eric4's project file version 4.4 --> - -<!-- This is a copy of the Basic DTD --> -<!ELEMENT int (#PCDATA)> -<!ELEMENT long (#PCDATA)> -<!ELEMENT float (#PCDATA)> -<!ELEMENT complex (#PCDATA)> -<!ELEMENT bool (#PCDATA)> -<!ELEMENT string (#PCDATA)> -<!ELEMENT unicode (#PCDATA)> -<!ELEMENT none EMPTY> - -<!ELEMENT pickle (#PCDATA)> -<!ATTLIST pickle - method CDATA #REQUIRED - encoding CDATA #REQUIRED> - -<!ELEMENT key (int | long | float | complex | string | unicode)> -<!ELEMENT value (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)> - -<!ELEMENT dict (key, value)*> - -<!ELEMENT tuple (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> - -<!ELEMENT list (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> -<!-- End of the Basic DTD --> - -<!ELEMENT ProgLanguage (#PCDATA)> -<!ATTLIST ProgLanguage - mixed CDATA #REQUIRED> - -<!ELEMENT ProjectType (#PCDATA)> - -<!ELEMENT Description (#PCDATA)> - -<!ELEMENT Version (#PCDATA)> - -<!ELEMENT Author (#PCDATA)> - -<!ELEMENT Email (#PCDATA)> - -<!ELEMENT TranslationPrefix (#PCDATA)> - -<!ELEMENT TranslationsBinPath (#PCDATA)> - -<!ELEMENT Source (#PCDATA)> - -<!ELEMENT Sources (Source*)> - -<!ELEMENT Form (#PCDATA)> - -<!ELEMENT Forms (Form*)> - -<!ELEMENT Translation (#PCDATA)> - -<!ELEMENT Translations (Translation*)> - -<!ELEMENT TranslationException (#PCDATA)> - -<!ELEMENT TranslationExceptions (TranslationException*)> - -<!ELEMENT Resource (#PCDATA)> - -<!ELEMENT Resources (Resource*)> - -<!ELEMENT Interface (#PCDATA)> - -<!ELEMENT Interfaces (Interface*)> - -<!ELEMENT Other (#PCDATA)> - -<!ELEMENT Others (Other*)> - -<!ELEMENT MainScript (#PCDATA)> - -<!ELEMENT VcsType (#PCDATA)> -<!ELEMENT VcsOptions (dict)> -<!ELEMENT VcsOtherData (dict)> - -<!ELEMENT Vcs (VcsType?, - VcsOptions?, - VcsOtherData?)> - -<!ELEMENT FiletypeAssociation EMPTY> -<!ATTLIST FiletypeAssociation - pattern CDATA #REQUIRED - type CDATA #REQUIRED> - -<!ELEMENT FiletypeAssociations (FiletypeAssociation*)> - -<!ELEMENT ProjectTypeSpecificData (dict)> - -<!ELEMENT ProjectTypeSpecific (ExtraData?)> - -<!ELEMENT DocumentationParams (dict)> - -<!ELEMENT Documentation (DocumentationParams?)> - -<!ELEMENT PackagersParams (dict)> - -<!ELEMENT Packagers (PackagersParams?)> - -<!ELEMENT CheckersParams (dict)> - -<!ELEMENT Checkers (CheckersParams?)> - -<!ELEMENT OtherToolsParams (dict)> - -<!ELEMENT OtherTools (OtherToolsParams?)> - -<!ELEMENT Project (ProgLanguage, - ProjectType, - Description?, - Version?, - Author?, - Email?, - TranslationPrefix?, - TranslationsBinPath?, - Sources, - Forms, - Translations, - TranslationExceptions?, - Resources, - Interfaces, - Others, - MainScript?, - Vcs, - FiletypeAssociations, - Extra?, - Documentation?, - Packagers?, - Checkers?, - OtherTools?)> -<!ATTLIST Project - version CDATA #REQUIRED>
--- a/DTDs/Project-4.5.dtd Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -<!-- This is the DTD for eric4's project file version 4.5 --> - -<!-- This is a copy of the Basic DTD --> -<!ELEMENT int (#PCDATA)> -<!ELEMENT long (#PCDATA)> -<!ELEMENT float (#PCDATA)> -<!ELEMENT complex (#PCDATA)> -<!ELEMENT bool (#PCDATA)> -<!ELEMENT string (#PCDATA)> -<!ELEMENT unicode (#PCDATA)> -<!ELEMENT none EMPTY> - -<!ELEMENT pickle (#PCDATA)> -<!ATTLIST pickle - method CDATA #REQUIRED - encoding CDATA #REQUIRED> - -<!ELEMENT key (int | long | float | complex | string | unicode)> -<!ELEMENT value (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)> - -<!ELEMENT dict (key, value)*> - -<!ELEMENT tuple (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> - -<!ELEMENT list (int | long | float | complex | bool | string | unicode | none | - dict | tuple | list | pickle)*> -<!-- End of the Basic DTD --> - -<!ELEMENT ProgLanguage (#PCDATA)> -<!ATTLIST ProgLanguage - mixed CDATA #REQUIRED> - -<!ELEMENT ProjectType (#PCDATA)> - -<!ELEMENT Description (#PCDATA)> - -<!ELEMENT Version (#PCDATA)> - -<!ELEMENT Author (#PCDATA)> - -<!ELEMENT Email (#PCDATA)> - -<!ELEMENT TranslationPattern (#PCDATA)> - -<!ELEMENT TranslationsBinPath (#PCDATA)> - -<!ELEMENT Source (#PCDATA)> - -<!ELEMENT Sources (Source*)> - -<!ELEMENT Form (#PCDATA)> - -<!ELEMENT Forms (Form*)> - -<!ELEMENT Translation (#PCDATA)> - -<!ELEMENT Translations (Translation*)> - -<!ELEMENT TranslationException (#PCDATA)> - -<!ELEMENT TranslationExceptions (TranslationException*)> - -<!ELEMENT Resource (#PCDATA)> - -<!ELEMENT Resources (Resource*)> - -<!ELEMENT Interface (#PCDATA)> - -<!ELEMENT Interfaces (Interface*)> - -<!ELEMENT Other (#PCDATA)> - -<!ELEMENT Others (Other*)> - -<!ELEMENT MainScript (#PCDATA)> - -<!ELEMENT VcsType (#PCDATA)> -<!ELEMENT VcsOptions (dict)> -<!ELEMENT VcsOtherData (dict)> - -<!ELEMENT Vcs (VcsType?, - VcsOptions?, - VcsOtherData?)> - -<!ELEMENT FiletypeAssociation EMPTY> -<!ATTLIST FiletypeAssociation - pattern CDATA #REQUIRED - type CDATA #REQUIRED> - -<!ELEMENT FiletypeAssociations (FiletypeAssociation*)> - -<!ELEMENT ProjectTypeSpecificData (dict)> - -<!ELEMENT ProjectTypeSpecific (ExtraData?)> - -<!ELEMENT DocumentationParams (dict)> - -<!ELEMENT Documentation (DocumentationParams?)> - -<!ELEMENT PackagersParams (dict)> - -<!ELEMENT Packagers (PackagersParams?)> - -<!ELEMENT CheckersParams (dict)> - -<!ELEMENT Checkers (CheckersParams?)> - -<!ELEMENT OtherToolsParams (dict)> - -<!ELEMENT OtherTools (OtherToolsParams?)> - -<!ELEMENT Project (ProgLanguage, - ProjectType, - Description?, - Version?, - Author?, - Email?, - TranslationPattern?, - TranslationsBinPath?, - Sources, - Forms, - Translations, - TranslationExceptions?, - Resources, - Interfaces, - Others, - MainScript?, - Vcs, - FiletypeAssociations, - Extra?, - Documentation?, - Packagers?, - Checkers?, - OtherTools?)> -<!ATTLIST Project - version CDATA #REQUIRED>
--- a/Documentation/Source/eric5.E5XML.XMLWriterBase.html Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,372 +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.XMLWriterBase</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.XMLWriterBase</h1> -<p> -Module implementing a base class for all of eric5s XML writers. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#XMLWriterBase">XMLWriterBase</a></td> -<td>Class implementing a base class for all of eric5s XML writers.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="XMLWriterBase" ID="XMLWriterBase"></a> -<h2>XMLWriterBase</h2> -<p> - Class implementing a base class for all of eric5s XML writers. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#XMLWriterBase.__init__">XMLWriterBase</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#XMLWriterBase._write">_write</a></td> -<td>Protected method used to do the real write operation.</td> -</tr><tr> -<td><a href="#XMLWriterBase._writeBasics">_writeBasics</a></td> -<td>Protected method to dump an object of a basic Python type.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_bool">_write_bool</a></td> -<td>Protected method to dump a bool object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_bytearray">_write_bytearray</a></td> -<td>Protected method to dump a bytearray object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_bytes">_write_bytes</a></td> -<td>Protected method to dump a bytes object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_complex">_write_complex</a></td> -<td>Protected method to dump a complex object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_dictionary">_write_dictionary</a></td> -<td>Protected method to dump a dict object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_float">_write_float</a></td> -<td>Protected method to dump a float object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_frozenset">_write_frozenset</a></td> -<td>Protected method to dump a frozenset object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_int">_write_int</a></td> -<td>Protected method to dump an int object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_list">_write_list</a></td> -<td>Protected method to dump a list object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_none">_write_none</a></td> -<td>Protected method to dump a NoneType object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_set">_write_set</a></td> -<td>Protected method to dump a set object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_string">_write_string</a></td> -<td>Protected method to dump a str object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_tuple">_write_tuple</a></td> -<td>Protected method to dump a tuple object.</td> -</tr><tr> -<td><a href="#XMLWriterBase._write_unimplemented">_write_unimplemented</a></td> -<td>Protected method to dump a type, that has no special method.</td> -</tr><tr> -<td><a href="#XMLWriterBase.encodedNewLines">encodedNewLines</a></td> -<td>Public method to encode newlines and paragraph breaks.</td> -</tr><tr> -<td><a href="#XMLWriterBase.escape">escape</a></td> -<td>Function to escape &, <, and > in a string of data.</td> -</tr><tr> -<td><a href="#XMLWriterBase.writeXML">writeXML</a></td> -<td>Public method to write the XML to the file.</td> -</tr> -</table> -<a NAME="XMLWriterBase.__init__" ID="XMLWriterBase.__init__"></a> -<h4>XMLWriterBase (Constructor)</h4> -<b>XMLWriterBase</b>(<i>file</i>) -<p> - Constructor -</p><dl> -<dt><i>file</i></dt> -<dd> -open file (like) object for writing -</dd> -</dl><a NAME="XMLWriterBase._write" ID="XMLWriterBase._write"></a> -<h4>XMLWriterBase._write</h4> -<b>_write</b>(<i>s, newline = True</i>) -<p> - Protected method used to do the real write operation. -</p><dl> -<dt><i>s</i></dt> -<dd> -string to be written to the XML file -</dd><dt><i>newline</i></dt> -<dd> -flag indicating a linebreak -</dd> -</dl><a NAME="XMLWriterBase._writeBasics" ID="XMLWriterBase._writeBasics"></a> -<h4>XMLWriterBase._writeBasics</h4> -<b>_writeBasics</b>(<i>pyobject, indent = 0</i>) -<p> - Protected method to dump an object of a basic Python type. -</p><dl> -<dt><i>pyobject</i></dt> -<dd> -object to be dumped -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_bool" ID="XMLWriterBase._write_bool"></a> -<h4>XMLWriterBase._write_bool</h4> -<b>_write_bool</b>(<i>value, indent</i>) -<p> - Protected method to dump a bool object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (boolean) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_bytearray" ID="XMLWriterBase._write_bytearray"></a> -<h4>XMLWriterBase._write_bytearray</h4> -<b>_write_bytearray</b>(<i>value, indent</i>) -<p> - Protected method to dump a bytearray object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (bytearray) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_bytes" ID="XMLWriterBase._write_bytes"></a> -<h4>XMLWriterBase._write_bytes</h4> -<b>_write_bytes</b>(<i>value, indent</i>) -<p> - Protected method to dump a bytes object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (bytes) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_complex" ID="XMLWriterBase._write_complex"></a> -<h4>XMLWriterBase._write_complex</h4> -<b>_write_complex</b>(<i>value, indent</i>) -<p> - Protected method to dump a complex object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (complex) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_dictionary" ID="XMLWriterBase._write_dictionary"></a> -<h4>XMLWriterBase._write_dictionary</h4> -<b>_write_dictionary</b>(<i>value, indent</i>) -<p> - Protected method to dump a dict object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (dictionary) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_float" ID="XMLWriterBase._write_float"></a> -<h4>XMLWriterBase._write_float</h4> -<b>_write_float</b>(<i>value, indent</i>) -<p> - Protected method to dump a float object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (float) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_frozenset" ID="XMLWriterBase._write_frozenset"></a> -<h4>XMLWriterBase._write_frozenset</h4> -<b>_write_frozenset</b>(<i>value, indent</i>) -<p> - Protected method to dump a frozenset object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (frozenset) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_int" ID="XMLWriterBase._write_int"></a> -<h4>XMLWriterBase._write_int</h4> -<b>_write_int</b>(<i>value, indent</i>) -<p> - Protected method to dump an int object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (integer) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_list" ID="XMLWriterBase._write_list"></a> -<h4>XMLWriterBase._write_list</h4> -<b>_write_list</b>(<i>value, indent</i>) -<p> - Protected method to dump a list object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (list) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_none" ID="XMLWriterBase._write_none"></a> -<h4>XMLWriterBase._write_none</h4> -<b>_write_none</b>(<i>value, indent</i>) -<p> - Protected method to dump a NoneType object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (None) (ignored) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_set" ID="XMLWriterBase._write_set"></a> -<h4>XMLWriterBase._write_set</h4> -<b>_write_set</b>(<i>value, indent</i>) -<p> - Protected method to dump a set object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (set) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_string" ID="XMLWriterBase._write_string"></a> -<h4>XMLWriterBase._write_string</h4> -<b>_write_string</b>(<i>value, indent</i>) -<p> - Protected method to dump a str object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (string) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_tuple" ID="XMLWriterBase._write_tuple"></a> -<h4>XMLWriterBase._write_tuple</h4> -<b>_write_tuple</b>(<i>value, indent</i>) -<p> - Protected method to dump a tuple object. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (tuple) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase._write_unimplemented" ID="XMLWriterBase._write_unimplemented"></a> -<h4>XMLWriterBase._write_unimplemented</h4> -<b>_write_unimplemented</b>(<i>value, indent</i>) -<p> - Protected method to dump a type, that has no special method. -</p><dl> -<dt><i>value</i></dt> -<dd> -value to be dumped (any pickleable object) -</dd><dt><i>indent</i></dt> -<dd> -indentation level for prettier output (integer) -</dd> -</dl><a NAME="XMLWriterBase.encodedNewLines" ID="XMLWriterBase.encodedNewLines"></a> -<h4>XMLWriterBase.encodedNewLines</h4> -<b>encodedNewLines</b>(<i>text</i>) -<p> - Public method to encode newlines and paragraph breaks. -</p><dl> -<dt><i>text</i></dt> -<dd> -text to encode (string) -</dd> -</dl><a NAME="XMLWriterBase.escape" ID="XMLWriterBase.escape"></a> -<h4>XMLWriterBase.escape</h4> -<b>escape</b>(<i>data, attribute=False</i>) -<p> - Function to escape &, <, and > in a string of data. -</p><dl> -<dt><i>data</i></dt> -<dd> -data to be escaped (string) -</dd><dt><i>attribute</i></dt> -<dd> -flag indicating escaping is done for an attribute -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -the escaped data (string) -</dd> -</dl><a NAME="XMLWriterBase.writeXML" ID="XMLWriterBase.writeXML"></a> -<h4>XMLWriterBase.writeXML</h4> -<b>writeXML</b>(<i></i>) -<p> - Public method to write the XML to the file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/E5XML/ProjectWriter.py Tue Sep 14 09:37:12 2010 +0200 +++ b/E5XML/ProjectWriter.py Tue Sep 14 18:04:15 2010 +0200 @@ -11,24 +11,24 @@ from E5Gui.E5Application import e5App -from .XMLWriterBase import XMLWriterBase +from .XMLStreamWriterBase import XMLStreamWriterBase from .Config import projectFileFormatVersion import Preferences import Utilities -class ProjectWriter(XMLWriterBase): +class ProjectWriter(XMLStreamWriterBase): """ Class implementing the writer class for writing an XML project file. """ - def __init__(self, file, projectName): + def __init__(self, device, projectName): """ Constructor - @param file open file (like) object for writing + @param device reference to the I/O device to write to (QIODevice) @param projectName name of the project (string) """ - XMLWriterBase.__init__(self, file) + XMLStreamWriterBase.__init__(self, device) self.pdata = e5App().getObject("Project").pdata self.name = projectName @@ -37,196 +37,184 @@ """ Public method to write the XML to the file. """ - XMLWriterBase.writeXML(self) + XMLStreamWriterBase.writeXML(self) - self._write('<!DOCTYPE Project SYSTEM "Project-{0}.dtd">'.format( + self.writeDTD('<!DOCTYPE Project SYSTEM "Project-{0}.dtd">'.format( projectFileFormatVersion)) # add some generation comments - self._write("<!-- eric5 project file for project {0} -->".format(self.name)) + self.writeComment(" eric5 project file for project {0} ".format(self.name)) if Preferences.getProject("XMLTimestamp"): - self._write("<!-- Saved: {0} -->".format(time.strftime('%Y-%m-%d, %H:%M:%S'))) - self._write("<!-- Copyright (C) {0} {1}, {2} -->".format( + self.writeComment(" Saved: {0} ".format(time.strftime('%Y-%m-%d, %H:%M:%S'))) + self.writeComment(" Copyright (C) {0} {1}, {2} ".format( time.strftime('%Y'), self.escape(self.pdata["AUTHOR"][0]), self.escape(self.pdata["EMAIL"][0]))) # add the main tag - self._write('<Project version="{0}">'.format(projectFileFormatVersion)) + self.writeStartElement("Project") + self.writeAttribute("version", projectFileFormatVersion) # do the language (used for spell checking) - self._write(' <Language>{0}</Language>'.format(self.pdata["SPELLLANGUAGE"][0])) + self.writeTextElement("Language", self.pdata["SPELLLANGUAGE"][0]) if len(self.pdata["SPELLWORDS"][0]) > 0: - self._write(" <ProjectWordList>{0}</ProjectWordList>".format( - Utilities.fromNativeSeparators(self.pdata["SPELLWORDS"][0]))) + self.writeTextElement("ProjectWordList", + Utilities.fromNativeSeparators(self.pdata["SPELLWORDS"][0])) if len(self.pdata["SPELLEXCLUDES"][0]) > 0: - self._write(" <ProjectExcludeList>{0}</ProjectExcludeList>".format( - Utilities.fromNativeSeparators(self.pdata["SPELLEXCLUDES"][0]))) + self.writeTextElement("ProjectExcludeList", + Utilities.fromNativeSeparators(self.pdata["SPELLEXCLUDES"][0])) # do the hash - self._write(' <Hash>{0}</Hash>'.format(self.pdata["HASH"][0])) + self.writeTextElement("Hash", self.pdata["HASH"][0]) # do the programming language - self._write(' <ProgLanguage mixed="{0:d}">{1}</ProgLanguage>'.format( - self.pdata["MIXEDLANGUAGE"][0], self.pdata["PROGLANGUAGE"][0])) + self.writeStartElement("ProgLanguage") + self.writeAttribute("mixed", str(int(self.pdata["MIXEDLANGUAGE"][0]))) + self.writeCharacters(self.pdata["PROGLANGUAGE"][0]) + self.writeEndElement() # do the UI type - self._write(' <ProjectType>{0}</ProjectType>'.format( - self.pdata["PROJECTTYPE"][0])) + self.writeTextElement("ProjectType", self.pdata["PROJECTTYPE"][0]) # do description if self.pdata["DESCRIPTION"]: - self._write(" <Description>{0}</Description>".format( - self.escape(self.encodedNewLines(self.pdata["DESCRIPTION"][0])))) + self.writeTextElement("Description", self.pdata["DESCRIPTION"][0]) # do version, author and email - for key in ["VERSION", "AUTHOR", "EMAIL"]: - element = key.capitalize() - if self.pdata[key]: - self._write(" <{0}>{1}</{0}>".format( - element, self.escape(self.pdata[key][0]))) + self.writeTextElement("Version", self.pdata["VERSION"][0]) + self.writeTextElement("Author", self.pdata["AUTHOR"][0]) + self.writeTextElement("Email", self.pdata["EMAIL"][0]) # do the translation pattern if self.pdata["TRANSLATIONPATTERN"]: - self._write(" <TranslationPattern>{0}</TranslationPattern>".format( - Utilities.fromNativeSeparators(self.pdata["TRANSLATIONPATTERN"][0]))) + self.writeTextElement("TranslationPattern", + Utilities.fromNativeSeparators(self.pdata["TRANSLATIONPATTERN"][0])) # do the binary translations path if self.pdata["TRANSLATIONSBINPATH"]: - self._write(" <TranslationsBinPath>{0}</TranslationsBinPath>".format( - Utilities.fromNativeSeparators(self.pdata["TRANSLATIONSBINPATH"][0]))) + self.writeTextElement("TranslationsBinPath", + Utilities.fromNativeSeparators(self.pdata["TRANSLATIONSBINPATH"][0])) # do the eol setting if self.pdata["EOL"] and self.pdata["EOL"][0]: - self._write(' <Eol index="{0:d}" />'.format(self.pdata["EOL"][0])) + self.writeEmptyElement("Eol") + self.writeAttribute("index", str(int(self.pdata["EOL"][0]))) # do the sources - self._write(" <Sources>") + self.writeStartElement("Sources") for name in self.pdata["SOURCES"]: - self._write(" <Source>{0}</Source>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </Sources>") + self.writeTextElement("Source", Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the forms - self._write(" <Forms>") + self.writeStartElement("Forms") for name in self.pdata["FORMS"]: - self._write(" <Form>{0}</Form>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </Forms>") + self.writeTextElement("Form", Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the translations - self._write(" <Translations>") + self.writeStartElement("Translations") for name in self.pdata["TRANSLATIONS"]: - self._write(" <Translation>{0}</Translation>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </Translations>") + self.writeTextElement("Translation", Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the translation exceptions if self.pdata["TRANSLATIONEXCEPTIONS"]: - self._write(" <TranslationExceptions>") + self.writeStartElement("TranslationExceptions") for name in self.pdata["TRANSLATIONEXCEPTIONS"]: - self._write(" <TranslationException>{0}</TranslationException>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </TranslationExceptions>") + self.writeTextElement("TranslationException", + Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the resources - self._write(" <Resources>") + self.writeStartElement("Resources") for name in self.pdata["RESOURCES"]: - self._write(" <Resource>{0}</Resource>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </Resources>") + self.writeTextElement("Resource", Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the interfaces (IDL) - self._write(" <Interfaces>") + self.writeStartElement("Interfaces") for name in self.pdata["INTERFACES"]: - self._write(" <Interface>{0}</Interface>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </Interfaces>") + self.writeTextElement("Interface", Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the others - self._write(" <Others>") + self.writeStartElement("Others") for name in self.pdata["OTHERS"]: - self._write(" <Other>{0}</Other>".format( - Utilities.fromNativeSeparators(name))) - self._write(" </Others>") + self.writeTextElement("Other", Utilities.fromNativeSeparators(name)) + self.writeEndElement() # do the main script if self.pdata["MAINSCRIPT"]: - self._write(" <MainScript>{0}</MainScript>".format( - Utilities.fromNativeSeparators(self.pdata["MAINSCRIPT"][0]))) + self.writeTextElement("MainScript", + Utilities.fromNativeSeparators(self.pdata["MAINSCRIPT"][0])) # do the vcs stuff - self._write(" <Vcs>") + self.writeStartElement("Vcs") if self.pdata["VCS"]: - self._write(" <VcsType>{0}</VcsType>".format(self.pdata["VCS"][0])) + self.writeTextElement("VcsType", self.pdata["VCS"][0]) if self.pdata["VCSOPTIONS"]: - self._write(" <VcsOptions>") - self._writeBasics(self.pdata["VCSOPTIONS"][0], 3) - self._write(" </VcsOptions>") + self.writeBasics("VcsOptions", self.pdata["VCSOPTIONS"][0]) if self.pdata["VCSOTHERDATA"]: - self._write(" <VcsOtherData>") - self._writeBasics(self.pdata["VCSOTHERDATA"][0], 3) - self._write(" </VcsOtherData>") - self._write(" </Vcs>") + self.writeBasics("VcsOtherData", self.pdata["VCSOTHERDATA"][0]) + self.writeEndElement() # do the filetype associations - self._write(" <FiletypeAssociations>") + self.writeStartElement("FiletypeAssociations") for pattern, filetype in list(self.pdata["FILETYPES"].items()): - self._write(' <FiletypeAssociation pattern="{0}" type="{1}" />'.format( - pattern, filetype)) - self._write(" </FiletypeAssociations>") + self.writeEmptyElement("FiletypeAssociation") + self.writeAttribute("pattern", pattern) + self.writeAttribute("type", filetype) + self.writeEndElement() # do the lexer associations if self.pdata["LEXERASSOCS"]: - self._write(" <LexerAssociations>") + self.writeStartElement("LexerAssociations") for pattern, lexer in list(self.pdata["LEXERASSOCS"].items()): - self._write(' <LexerAssociation pattern="{0}" lexer="{1}" />'.format( - pattern, lexer)) - self._write(" </LexerAssociations>") + self.writeEmptyElement("LexerAssociation") + self.writeAttribute("pattern", pattern) + self.writeAttribute("lexer", lexer) + self.writeEndElement() # do the extra project data stuff if len(self.pdata["PROJECTTYPESPECIFICDATA"]): - self._write(" <ProjectTypeSpecific>") + self.writeStartElement("ProjectTypeSpecific") if self.pdata["PROJECTTYPESPECIFICDATA"]: - self._write(" <ProjectTypeSpecificData>") - self._writeBasics(self.pdata["PROJECTTYPESPECIFICDATA"], 3) - self._write(" </ProjectTypeSpecificData>") - self._write(" </ProjectTypeSpecific>") + self.writeBasics("ProjectTypeSpecificData", + self.pdata["PROJECTTYPESPECIFICDATA"]) + self.writeEndElement() # do the documentation generators stuff if len(self.pdata["DOCUMENTATIONPARMS"]): - self._write(" <Documentation>") + self.writeStartElement("Documentation") if self.pdata["DOCUMENTATIONPARMS"]: - self._write(" <DocumentationParams>") - self._writeBasics(self.pdata["DOCUMENTATIONPARMS"], 3) - self._write(" </DocumentationParams>") - self._write(" </Documentation>") + self.writeBasics("DocumentationParams", + self.pdata["DOCUMENTATIONPARMS"]) + self.writeEndElement() # do the packagers stuff if len(self.pdata["PACKAGERSPARMS"]): - self._write(" <Packagers>") + self.writeStartElement("Packagers") if self.pdata["PACKAGERSPARMS"]: - self._write(" <PackagersParams>") - self._writeBasics(self.pdata["PACKAGERSPARMS"], 3) - self._write(" </PackagersParams>") - self._write(" </Packagers>") + self.writeBasics("PackagersParams", + self.pdata["PACKAGERSPARMS"]) + self.writeEndElement() # do the checkers stuff if len(self.pdata["CHECKERSPARMS"]): - self._write(" <Checkers>") + self.writeStartElement("Checkers") if self.pdata["CHECKERSPARMS"]: - self._write(" <CheckersParams>") - self._writeBasics(self.pdata["CHECKERSPARMS"], 3) - self._write(" </CheckersParams>") - self._write(" </Checkers>") + self.writeBasics("CheckersParams", + self.pdata["CHECKERSPARMS"]) + self.writeEndElement() # do the other tools stuff if len(self.pdata["OTHERTOOLSPARMS"]): - self._write(" <OtherTools>") + self.writeStartElement("OtherTools") if self.pdata["OTHERTOOLSPARMS"]: - self._write(" <OtherToolsParams>") - self._writeBasics(self.pdata["OTHERTOOLSPARMS"], 3) - self._write(" </OtherToolsParams>") - self._write(" </OtherTools>") + self.writeBasics("OtherToolsParams", + self.pdata["OTHERTOOLSPARMS"]) + self.writeEndElement() - self._write("</Project>", newline = False) + self.writeEndElement() + self.writeEndDocument()
--- a/E5XML/XMLStreamWriterBase.py Tue Sep 14 09:37:12 2010 +0200 +++ b/E5XML/XMLStreamWriterBase.py Tue Sep 14 18:04:15 2010 +0200 @@ -50,6 +50,17 @@ # write the XML header self.writeStartDocument() + def writeBasics(self, tag, pyobject): + """ + Public method to write a tag with a basic Python object dump. + + @param tag tag name (string) + @param pyobject object to be dumped + """ + self.writeStartElement(tag) + self._writeBasics(pyobject) + self.writeEndElement() + def _writeBasics(self, pyobject): """ Protected method to dump an object of a basic Python type.
--- a/E5XML/XMLWriterBase.py Tue Sep 14 09:37:12 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,255 +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 writers. -""" - -import pickle -import base64 - -class XMLWriterBase(object): - """ - Class implementing a base class for all of eric5s XML writers. - """ - def __init__(self, file): - """ - Constructor - - @param file open file (like) object for writing - """ - self.pf = file - - self.basics = { - type(None) : self._write_none, - int : self._write_int, - float : self._write_float, - complex : self._write_complex, - bool : self._write_bool, - str : self._write_string, - bytes : self._write_bytes, - bytearray : self._write_bytearray, - tuple : self._write_tuple, - list : self._write_list, - dict : self._write_dictionary, - set : self._write_set, - frozenset : self._write_frozenset, - } - - self.NEWPARA = chr(0x2029) - self.NEWLINE = chr(0x2028) - - def _write(self, s, newline = True): - """ - Protected method used to do the real write operation. - - @param s string to be written to the XML file - @param newline flag indicating a linebreak - """ - self.pf.write("{0}{1}".format(s, - newline and "\n" or "")) - - def writeXML(self): - """ - Public method to write the XML to the file. - """ - # write the XML header - self._write('<?xml version="1.0" encoding="UTF-8"?>') - - def escape(self, data, attribute=False): - """ - Function to escape &, <, and > in a string of data. - - @param data data to be escaped (string) - @param attribute flag indicating escaping is done for an attribute - @return the escaped data (string) - """ - - # must do ampersand first - data = data.replace("&", "&") - data = data.replace(">", ">") - data = data.replace("<", "<") - if attribute: - data = data.replace('"', """) - return data - - def encodedNewLines(self, text): - """ - Public method to encode newlines and paragraph breaks. - - @param text text to encode (string) - """ - return text.replace("\n\n", self.NEWPARA).replace("\n", self.NEWLINE) - - def _writeBasics(self, pyobject, indent = 0): - """ - Protected method to dump an object of a basic Python type. - - @param pyobject object to be dumped - @param indent indentation level for prettier output (integer) - """ - writeMethod = self.basics.get(type(pyobject)) or self._write_unimplemented - writeMethod(pyobject, indent) - - ############################################################################ - ## The various writer methods for basic types - ############################################################################ - - def _write_none(self, value, indent): - """ - Protected method to dump a NoneType object. - - @param value value to be dumped (None) (ignored) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<none />'.format(" " * indent)) - - def _write_int(self, value, indent): - """ - Protected method to dump an int object. - - @param value value to be dumped (integer) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<int>{1}</int>'.format(" " * indent, value)) - - def _write_bool(self, value, indent): - """ - Protected method to dump a bool object. - - @param value value to be dumped (boolean) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<bool>{1}</bool>'.format(" " * indent, value)) - - def _write_float(self, value, indent): - """ - Protected method to dump a float object. - - @param value value to be dumped (float) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<float>{1}</float>'.format(" " * indent, value)) - - def _write_complex(self, value, indent): - """ - Protected method to dump a complex object. - - @param value value to be dumped (complex) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<complex>{1} {2}</complex>'.format( - " " * indent, value.real, value.imag)) - - def _write_string(self, value, indent): - """ - Protected method to dump a str object. - - @param value value to be dumped (string) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<string>{1}</string>'.format(" " * indent, self.escape(value))) - - def _write_bytes(self, value, indent): - """ - Protected method to dump a bytes object. - - @param value value to be dumped (bytes) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<bytes>{1}</bytes>'.format( - " " * indent, ",".join(["{0:d}".format(b) for b in value]))) - - def _write_bytearray(self, value, indent): - """ - Protected method to dump a bytearray object. - - @param value value to be dumped (bytearray) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<bytearray>{1}</bytearray>'.format( - " " * indent, ",".join(["{0:d}".format(b) for b in value]))) - - def _write_tuple(self, value, indent): - """ - Protected method to dump a tuple object. - - @param value value to be dumped (tuple) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<tuple>'.format(" " * indent)) - nindent = indent + 1 - for elem in value: - self._writeBasics(elem, nindent) - self._write('{0}</tuple>'.format(" " * indent)) - - def _write_list(self, value, indent): - """ - Protected method to dump a list object. - - @param value value to be dumped (list) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<list>'.format(" " * indent)) - nindent = indent + 1 - for elem in value: - self._writeBasics(elem, nindent) - self._write('{0}</list>'.format(" " * indent)) - - def _write_dictionary(self, value, indent): - """ - Protected method to dump a dict object. - - @param value value to be dumped (dictionary) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<dict>'.format(" " * indent)) - nindent1 = indent + 1 - nindent2 = indent + 2 - keys = sorted(list(value.keys())) - for key in keys: - self._write('{0}<key>'.format(" " * nindent1)) - self._writeBasics(key, nindent2) - self._write('{0}</key>'.format(" " * nindent1)) - self._write('{0}<value>'.format(" " * nindent1)) - self._writeBasics(value[key], nindent2) - self._write('{0}</value>'.format(" " * nindent1)) - self._write('{0}</dict>'.format(" " * indent)) - - def _write_set(self, value, indent): - """ - Protected method to dump a set object. - - @param value value to be dumped (set) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<set>'.format(" " * indent)) - nindent = indent + 1 - for elem in value: - self._writeBasics(elem, nindent) - self._write('{0}</set>'.format(" " * indent)) - - def _write_frozenset(self, value, indent): - """ - Protected method to dump a frozenset object. - - @param value value to be dumped (frozenset) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<frozenset>'.format(" " * indent)) - nindent = indent + 1 - for elem in value: - self._writeBasics(elem, nindent) - self._write('{0}</frozenset>'.format(" " * indent)) - - def _write_unimplemented(self, value, indent): - """ - Protected method to dump a type, that has no special method. - - @param value value to be dumped (any pickleable object) - @param indent indentation level for prettier output (integer) - """ - self._write('{0}<pickle method="pickle" encoding="base64">{1}</pickle>'.format( - " " * indent, str(base64.b64encode(pickle.dumps(value)), "ASCII")))
--- a/Project/Project.py Tue Sep 14 09:37:12 2010 +0200 +++ b/Project/Project.py Tue Sep 14 18:04:15 2010 +0200 @@ -660,7 +660,16 @@ if fn is None: fn = self.pfile - res = self.__writeXMLProject(fn) + f = QFile(fn) + if f.open(QIODevice.WriteOnly): + ProjectWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML() + res = True + else: + E5MessageBox.critical(self.ui, + self.trUtf8("Save project file"), + self.trUtf8("<p>The project file <b>{0}</b> could not be written.</p>")\ + .format(fn)) + res = False if res: self.pfile = os.path.abspath(fn) @@ -677,48 +686,6 @@ return res - def __writeXMLProject(self, fn = None): - """ - Private method to write the project data to an XML file. - - @param fn the filename of the project file (string) - @return flag indicating success (boolean) - """ - try: - if self.pdata["EOL"][0] == 0: - newline = None - else: - newline = self.getEolString() - if fn.lower().endswith("e4pz"): - try: - import gzip - except ImportError: - E5MessageBox.critical(self.ui, - self.trUtf8("Save project file"), - self.trUtf8("""Compressed project files not supported.""" - """ The compression library is missing.""")) - return False - f = io.StringIO(newline = newline) - else: - f = open(fn, "w", encoding = "utf-8", newline = newline) - - ProjectWriter(f, os.path.splitext(os.path.basename(fn))[0]).writeXML() - - if fn.lower().endswith("e4pz"): - g = gzip.open(fn, "wb") - g.write(f.getvalue().encode("utf-8")) - g.close() - f.close() - - except IOError: - E5MessageBox.critical(self.ui, - self.trUtf8("Save project file"), - self.trUtf8("<p>The project file <b>{0}</b> could not be written.</p>")\ - .format(fn)) - return False - - return True - def __readUserProperties(self): """ Private method to read in the user specific project file (.e4q)