1.1 --- a/moinformat/serialisers/common.py Mon Aug 06 15:44:10 2018 +0200
1.2 +++ b/moinformat/serialisers/common.py Mon Aug 06 15:45:11 2018 +0200
1.3 @@ -25,17 +25,18 @@
1.4
1.5 format = None # defined by subclasses
1.6
1.7 - def __init__(self, output, formats=None, linker=None):
1.8 + def __init__(self, output, formats=None, linker=None, pagename=None):
1.9
1.10 """
1.11 Initialise the serialiser with an 'output' context, an optional
1.12 - 'formats' mapping from names to serialiser classes, and an optional
1.13 - 'linker' object for translating links.
1.14 + 'formats' mapping from names to serialiser classes, an optional 'linker'
1.15 + object for translating links, and an optional 'pagename'.
1.16 """
1.17
1.18 self.output = output
1.19 self.formats = formats
1.20 self.linker = linker
1.21 + self.pagename = pagename
1.22
1.23 # Initialise a callable for use in serialisation.
1.24
1.25 @@ -52,8 +53,8 @@
1.26 pass
1.27
1.28 def __repr__(self):
1.29 - return "%s(%r, %r, %r)" % (self.__class__.__name__, self.output,
1.30 - self.formats, self.linker)
1.31 + return "%s(%r, %r, %r, %r)" % (self.__class__.__name__, self.output,
1.32 + self.formats, self.linker, self.pagename)
1.33
1.34 def get_serialiser(self, format):
1.35
1.36 @@ -84,7 +85,7 @@
1.37 if cls is self.__class__:
1.38 return self
1.39 else:
1.40 - return cls(self.output, self.formats, self.linker)
1.41 + return cls(self.output, self.formats, self.linker, self.pagename)
1.42
1.43 def escape_attr(s):
1.44