If a project does not contain protobuf files, the old project file format (5.1) is generated to make the file backward compatible.

Mon, 04 Dec 2017 16:25:40 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 04 Dec 2017 16:25:40 +0100
changeset 6007
82d44dc0fb3b
parent 6006
40abcfa8e2b5
child 6008
ac5057f80f60

If a project does not contain protobuf files, the old project file format (5.1) is generated to make the file backward compatible.

E5XML/Config.py file | annotate | diff | comparison | revisions
E5XML/ProjectWriter.py file | annotate | diff | comparison | revisions
changelog file | annotate | diff | comparison | revisions
eric6.e4p file | annotate | diff | comparison | revisions
--- a/E5XML/Config.py	Sun Dec 03 18:54:55 2017 +0100
+++ b/E5XML/Config.py	Mon Dec 04 16:25:40 2017 +0100
@@ -12,6 +12,7 @@
 
 # version number of the project file
 projectFileFormatVersion = "6.0"
+projectFileFormatVersionAlt = "5.1"
 
 # version number of the user project file
 userProjectFileFormatVersion = "4.0"
--- a/E5XML/ProjectWriter.py	Sun Dec 03 18:54:55 2017 +0100
+++ b/E5XML/ProjectWriter.py	Mon Dec 04 16:25:40 2017 +0100
@@ -14,7 +14,7 @@
 from E5Gui.E5Application import e5App
 
 from .XMLStreamWriterBase import XMLStreamWriterBase
-from .Config import projectFileFormatVersion
+from .Config import projectFileFormatVersion, projectFileFormatVersionAlt
 
 import Preferences
 import Utilities
@@ -42,8 +42,13 @@
         """
         XMLStreamWriterBase.writeXML(self)
         
+        if self.pdata["PROTOCOLS"]:
+            fileFormatVersion = projectFileFormatVersion
+        else:
+            fileFormatVersion = projectFileFormatVersionAlt
+        
         self.writeDTD('<!DOCTYPE Project SYSTEM "Project-{0}.dtd">'.format(
-            projectFileFormatVersion))
+            fileFormatVersion))
         
         # add some generation comments
         self.writeComment(
@@ -58,7 +63,7 @@
         
         # add the main tag
         self.writeStartElement("Project")
-        self.writeAttribute("version", projectFileFormatVersion)
+        self.writeAttribute("version", fileFormatVersion)
         
         # do the language (used for spell checking)
         self.writeTextElement("Language", self.pdata["SPELLLANGUAGE"])
--- a/changelog	Sun Dec 03 18:54:55 2017 +0100
+++ b/changelog	Mon Dec 04 16:25:40 2017 +0100
@@ -2,6 +2,9 @@
 ----------
 Version 18.01:
 - bug fixes
+- Project
+  -- If a project does not contain protobuf files, the old project file format
+     (5.1) is generated to make the file backward compatible.
 
 Version 17.12:
 - bug fixes
--- a/eric6.e4p	Sun Dec 03 18:54:55 2017 +0100
+++ b/eric6.e4p	Mon Dec 04 16:25:40 2017 +0100
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE Project SYSTEM "Project-6.0.dtd">
+<!DOCTYPE Project SYSTEM "Project-5.1.dtd">
 <!-- eric project file for project eric6 -->
 <!-- Copyright (C) 2017 Detlev Offenbach, detlev@die-offenbachs.de -->
-<Project version="6.0">
+<Project version="5.1">
   <Language>en_US</Language>
   <ProjectWordList>Dictionaries/words.dic</ProjectWordList>
   <ProjectExcludeList>Dictionaries/excludes.dic</ProjectExcludeList>

eric ide

mercurial