Project/Project.py

changeset 2521
ca91f5ee1b23
parent 2512
290462cc60cb
child 2525
8b507a9a2d40
child 2537
0ff250733d45
--- a/Project/Project.py	Sun Mar 24 13:08:24 2013 +0100
+++ b/Project/Project.py	Sun Mar 24 13:21:43 2013 +0100
@@ -4279,6 +4279,7 @@
                 newline = self.getEolString()
             pkglistFile = open(pkglist, "w", encoding="utf-8", newline=newline)
             pkglistFile.write("\n".join(lst))
+            pkglistFile.write("\n") # ensure the file ends with an empty line
             pkglistFile.close()
         except IOError as why:
             E5MessageBox.critical(self.ui,
@@ -4337,24 +4338,25 @@
             return
         
         for name in names:
-            try:
-                self.__createZipDirEntries(os.path.split(name)[0], archiveFile)
-                if snapshot and name == self.pdata["MAINSCRIPT"][0]:
-                    snapshotSource, version = self.__createSnapshotSource(
-                        os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0]))
-                    archiveFile.writestr(name, snapshotSource)
-                else:
-                    archiveFile.write(os.path.join(self.ppath, name), name)
-                    if name == self.pdata["MAINSCRIPT"][0]:
-                        version = self.__pluginExtractVersion(
+            if name:
+                try:
+                    self.__createZipDirEntries(os.path.split(name)[0], archiveFile)
+                    if snapshot and name == self.pdata["MAINSCRIPT"][0]:
+                        snapshotSource, version = self.__createSnapshotSource(
                             os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0]))
-            except OSError as why:
-                E5MessageBox.critical(self.ui,
-                    self.trUtf8("Create Plugin Archive"),
-                    self.trUtf8("""<p>The file <b>{0}</b> could not be stored """
-                                """in the archive. Ignoring it.</p>"""
-                                """<p>Reason: {1}</p>""")\
-                                .format(os.path.join(self.ppath, name), str(why)))
+                        archiveFile.writestr(name, snapshotSource)
+                    else:
+                        archiveFile.write(os.path.join(self.ppath, name), name)
+                        if name == self.pdata["MAINSCRIPT"][0]:
+                            version = self.__pluginExtractVersion(
+                                os.path.join(self.ppath, self.pdata["MAINSCRIPT"][0]))
+                except OSError as why:
+                    E5MessageBox.critical(self.ui,
+                        self.trUtf8("Create Plugin Archive"),
+                        self.trUtf8("""<p>The file <b>{0}</b> could not be stored """
+                                    """in the archive. Ignoring it.</p>"""
+                                    """<p>Reason: {1}</p>""")\
+                                    .format(os.path.join(self.ppath, name), str(why)))
         archiveFile.writestr("VERSION", version.encode("utf-8"))
         archiveFile.close()
         

eric ide

mercurial