changeset 293:239cd0931e6b

Added missing API for PackagePages action. imported from: moin--main--1.5--patch-297
author Alexander Schremmer <alex@alexanderweb.de.tla>
date Mon, 05 Dec 2005 18:28:06 +0000
parents 103813a8a768
children 3cbbedfb89af
files MoinMoin/packages.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/packages.py	Sun Dec 04 22:14:09 2005 +0000
+++ b/MoinMoin/packages.py	Mon Dec 05 18:28:06 2005 +0000
@@ -39,24 +39,24 @@
     """ Raised by the script commands when the script should quit. """
 
 # Parsing and (un)quoting for script files
-def packLine(list):
-    return '|'.join([x.replace('\\', '\\\\').replace('|', r'\|') for x in list])
+def packLine(list, separator="|"):
+    return '|'.join([x.replace('\\', '\\\\').replace(separator, '\\' + separator) for x in list])
 
-def unpackLine(string):
+def unpackLine(string, separator="|"):
     result = []
     token = None
     escaped = False
     for x in string:
         if token is None:
             token = ""
-        if escaped and x in ('\\', '|'):
+        if escaped and x in ('\\', separator):
             token += x
             escaped = False
             continue
         escaped = (x == '\\')
         if escaped:
             continue
-        if x == '|':
+        if x == separator:
             result.append(token)
             token = ""
         else: