本文整理汇总了Python中MoinMoin.Page.Page.split方法的典型用法代码示例。如果您正苦于以下问题:Python Page.split方法的具体用法?Python Page.split怎么用?Python Page.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoinMoin.Page.Page
的用法示例。
在下文中一共展示了Page.split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sendEditor
# 需要导入模块: from MoinMoin.Page import Page [as 别名]
# 或者: from MoinMoin.Page.Page import split [as 别名]
#.........这里部分代码省略.........
if request.user.may.read(template_page):
raw_body = Page(request, template_page).get_raw_body()
if raw_body:
request.write(_("[Content of new page loaded from %s]") % (template_page_escaped, ), '<br>')
else:
request.write(_("[Template %s not found]") % (template_page_escaped, ), '<br>')
else:
request.write(_("[You may not read %s]") % (template_page_escaped, ), '<br>')
# Make backup on previews - but not for new empty pages
if not use_draft and preview and raw_body:
self._save_draft(raw_body, rev)
draft_message = None
loadable_draft = False
if preview is None:
draft = self._load_draft()
if draft is not None:
draft_timestamp, draft_rev, draft_text = draft
if draft_text != raw_body:
loadable_draft = True
page_rev = rev
draft_timestamp_str = request.user.getFormattedDateTime(draft_timestamp)
draft_message = _(u"'''<<BR>>Your draft based on revision %(draft_rev)d (saved %(draft_timestamp_str)s) can be loaded instead of the current revision %(page_rev)d by using the load draft button - in case you lost your last edit somehow without saving it.''' A draft gets saved for you when you do a preview, cancel an edit or unsuccessfully save.", wiki=True, percent=True) % locals()
# Setup status message
status = [kw.get('msg', ''), conflict_msg, edit_lock_message, draft_message]
status = [msg for msg in status if msg]
status = ' '.join(status)
status = Status(request, content=status)
request.theme.add_msg(status, "error")
request.theme.send_title(
title % {'pagename': self.split_title(), },
page=self,
html_head=self.lock.locktype and (
PageEditor._countdown_js % {
'countdown_script': request.theme.externalScript('countdown'),
'lock_timeout': lock_timeout,
'lock_expire': lock_expire,
'lock_mins': lock_mins,
'lock_secs': lock_secs,
}) or '',
editor_mode=1,
allow_doubleclick=1,
)
request.write(request.formatter.startContent("content"))
# Generate default content for new pages
if not raw_body:
raw_body = _('Describe %s here.') % (self.page_name, )
# send form
request.write('<form id="editor" method="post" action="%s#preview">' % (
request.href(self.page_name)
))
# yet another weird workaround for broken IE6 (it expands the text
# editor area to the right after you begin to type...). IE sucks...
# http://fplanque.net/2003/Articles/iecsstextarea/
request.write('<fieldset style="border:none;padding:0;">')
request.write(unicode(html.INPUT(type="hidden", name="action", value="edit")))
# Send revision of the page our edit is based on