Little enhancement to project to read eric4 project files without 'upgrading' them.

Mon, 28 Jan 2013 19:24:14 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 28 Jan 2013 19:24:14 +0100
changeset 2380
0121b9ab8edb
parent 2377
11b89e636d33
child 2382
a55e5e94a87b

Little enhancement to project to read eric4 project files without 'upgrading' them.

Project/Project.py file | annotate | diff | comparison | revisions
--- a/Project/Project.py	Sun Jan 27 17:05:36 2013 +0100
+++ b/Project/Project.py	Mon Jan 28 19:24:14 2013 +0100
@@ -734,7 +734,7 @@
                     self.otherssubdirs.append(dn)
             
             # create hash value, if it doesn't have one
-            if not self.pdata["HASH"][0]:
+            if reader.version.startswith("5.") and not self.pdata["HASH"][0]:
                 hash = str(QCryptographicHash.hash(
                     QByteArray(self.ppath.encode("utf-8")),
                     QCryptographicHash.Sha1).toHex(),
@@ -759,6 +759,13 @@
             self.pdata["VCSOPTIONS"] = [copy.deepcopy(self.vcs.vcsGetOptions())]
             self.pdata["VCSOTHERDATA"] = [copy.deepcopy(self.vcs.vcsGetOtherData())]
         
+        if not self.pdata["HASH"][0]:
+            hash = str(QCryptographicHash.hash(
+                QByteArray(self.ppath.encode("utf-8")),
+                QCryptographicHash.Sha1).toHex(),
+                encoding="utf-8")
+            self.pdata["HASH"] = [hash]
+        
         if fn is None:
             fn = self.pfile
         

eric ide

mercurial