""" The Wiki module primarily exports the `WikiPage` class: """ import os, re, time import shutil from datetime import datetime, timedelta try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import propertymeta from rfc822persist import RFC822Dict, metaprop, metabool try: import Image except ImportError: Image = None import converter_registry from html_abstracts import find_abstract from common import * try: import user except ImportError: user = None # Just make sure these are loaded: import convert_rest del convert_rest import convert_html del convert_html __all__ = ['WikiPage'] class WikiPage(object): """ WikiPage is a class to represent one page in a WikiWikiWeb [#]_. The page may or may not yet exist -- that is, it may not yet have content. .. [#] http://c2.com/cgi-bin/wiki It has the following properties and methods: `html`: A read-only property giving the HTML for the page. If the page does not yet have content the text ``"This page has not yet been created"`` is returned. `text`: The text for the page. To save new text, simply assign to this property. .. ignore: html .. ignore: text .. ignore: setText """ __metaclass__ = propertymeta.MakeProperties def __init__(self, wiki, dir, pageName, urlName=None, version=None): """ Each page has a name, which is a unique identifier, for example ``"FrontPage"``, which identifies the page in the URL and for linking. """ self.dir = dir self.wiki = wiki self.name = pageName self.version = version self.metadata = RFC822Dict(self.basePath + '.meta') self._text = None self._summary = None self._thumbnail = None self._connectionsDirty = False self._config = None if not self.exists() and urlName is not None: self.urlName = urlName self.title = guessTitle(urlName) def __repr__(self): text = '