diff options
Diffstat (limited to 'examples/custom_contentviews.py')
-rw-r--r-- | examples/custom_contentviews.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/custom_contentviews.py b/examples/custom_contentviews.py index 05ebeb69..5a63e2a0 100644 --- a/examples/custom_contentviews.py +++ b/examples/custom_contentviews.py @@ -11,7 +11,7 @@ class ViewPigLatin(contentviews.View): content_types = ["text/html"] def __call__(self, data, **metadata): - if strutils.isXML(data): + if strutils.is_xml(data): parser = lxml.etree.HTMLParser( strip_cdata=True, remove_blank_text=True @@ -20,7 +20,7 @@ class ViewPigLatin(contentviews.View): docinfo = d.getroottree().docinfo def piglify(src): - words = string.split(src) + words = src.split() ret = '' for word in words: idx = -1 @@ -62,9 +62,9 @@ class ViewPigLatin(contentviews.View): pig_view = ViewPigLatin() -def start(context): - context.add_contentview(pig_view) +def start(): + contentviews.add(pig_view) -def done(context): - context.remove_contentview(pig_view) +def done(): + contentviews.remove(pig_view) |