changeset 1728:97e39d16ae7c

PackagePages:uses now generic name for attachments as for pages n_attachment
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 09 Jan 2007 20:42:32 +0100
parents 8907f3657f80
children fe83672bd165
files MoinMoin/action/PackagePages.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/PackagePages.py	Tue Jan 09 20:38:17 2007 +0100
+++ b/MoinMoin/action/PackagePages.py	Tue Jan 09 20:42:32 2007 +0100
@@ -112,10 +112,11 @@
             zf.writestr(zi, page.get_raw_body().encode("utf-8"))
             for attname in files:
                 if attname != packagename:
-                    script.append(packLine(["AddAttachment", attname, page.page_name, user.getUserIdentification(self.request), "Created by the PackagePages action."]))
-                    filename =  AttachFile.getFilename(self.request, page.page_name, attname)
-                    zf.write(filename.encode("cp437"), attname.encode("cp437"))
-
+                    cnt += 1
+                    zipname = "%s_attachment" % str(cnt)
+                    script.append(packLine(["AddAttachment", zipname, attname, page.page_name, user.getUserIdentification(self.request), "Created by the PackagePages action."]))
+                    filename = AttachFile.getFilename(self.request, page.page_name, attname)
+                    zf.write(filename.encode("cp437"), zipname)
         script += [packLine(['Print', 'Thank you for using PackagePages!'])]
 
         zf.writestr(MOIN_PACKAGE_FILE, u"\n".join(script).encode("utf-8"))