changeset 5246:c9d372df60a9

mkpagepacks: make package contents more consistent
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 02 Nov 2009 23:36:00 +0100
parents 9730c2936db7
children ac1f33fb3829
files MoinMoin/script/maint/mkpagepacks.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/script/maint/mkpagepacks.py	Sun Nov 01 12:21:16 2009 +0100
+++ b/MoinMoin/script/maint/mkpagepacks.py	Mon Nov 02 23:36:00 2009 +0100
@@ -100,22 +100,22 @@
         script = [packLine(['MoinMoinPackage', '1']), ]
 
         cnt = 0
-        userid = ""
         for pagename in existing_pages:
             pagename = pagename.strip()
             page = Page(request, pagename)
-            cnt += 1
             files = _get_files(request, pagename)
             for attname in files:
                 cnt += 1
-                zipname = "%d_attachment" % cnt
-                script.append(packLine(["ReplaceUnderlayAttachment", zipname, attname, pagename, userid, "Created by the PackagePages action."]))
+                zipname = "%d" % cnt
+                script.append(packLine(["ReplaceUnderlayAttachment", zipname, attname, pagename]))
                 filename = AttachFile.getFilename(request, pagename, attname)
                 zf.write(filename, zipname)
 
-            script.append(packLine([function, str(cnt), pagename]))
+            cnt += 1
+            zipname = "%d" % cnt
+            script.append(packLine([function, zipname, pagename]))
             timestamp = wikiutil.version2timestamp(page.mtime_usecs())
-            zi = zipfile.ZipInfo(filename=str(cnt), date_time=datetime.fromtimestamp(timestamp).timetuple()[:6])
+            zi = zipfile.ZipInfo(filename=zipname, date_time=datetime.fromtimestamp(timestamp).timetuple()[:6])
             zi.compress_type = COMPRESSION_LEVEL
             zf.writestr(zi, page.get_raw_body().encode("utf-8"))