MoinMoin.items package

Subpackages

Submodules

MoinMoin.items.blog module

MoinMoin - Blog itemtype

class MoinMoin.items.blog.Blog(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Default

description = l'Blog item'
display_name = l'Blog'
do_show(revid)[source]

Show a blog item and a list of its blog entries below it.

If tag GET-parameter is defined, the list of blog entries consists only of those entries that contain the tag value in their lists of tags.

itemtype = u'blog'
order = 0
class MoinMoin.items.blog.BlogEntry(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Default

description = l'Blog entry item'
display_name = l'Blog entry'
do_show(revid)[source]
itemtype = u'blogentry'
order = 0
class MoinMoin.items.blog.BlogEntryMetaForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.BaseMetaForm

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.DateTimeUNIX'>, <class 'flatland.schema.declarative.String'>]
class MoinMoin.items.blog.BlogMetaForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.BaseMetaForm

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.MyJoinedString'>]

MoinMoin.items.content module

MoinMoin - item contents

Classes handling the content part of items (ie. minus metadata). The content part is sometimes called the “data” part in other places, but is always called content in this module to avoid confusion.

Each class in this module corresponds to a contenttype value.

class MoinMoin.items.content.AnyWikiDraw(contenttype, item=None)[source]

Bases: MoinMoin.items.content.DrawAWDTWDBase

drawings by AnyWikiDraw applet. It creates three files which are stored as tar file.

class ModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.content.ModifyForm

field_schema = [<class 'flatland.schema.declarative.FileStorage'>]
template = 'modify_anywikidraw.html'
AnyWikiDraw.contenttype = 'application/x-anywikidraw'
AnyWikiDraw.display_name = 'ADRAW'
class MoinMoin.items.content.Application(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Base class for application/*

class MoinMoin.items.content.ApplicationXGTar(contenttype, item=None)[source]

Bases: MoinMoin.items.content.ApplicationXTar

Compressed tar items

contenttype = 'application/x-gtar'
display_name = 'TGZ'
class MoinMoin.items.content.ApplicationXTar(contenttype, item=None)[source]

Bases: MoinMoin.items.content.TarMixin, MoinMoin.items.content.Application

Tar items

contenttype = 'application/x-tar'
display_name = 'TAR'
class MoinMoin.items.content.ApplicationZip(contenttype, item=None)[source]

Bases: MoinMoin.items.content.ZipMixin, MoinMoin.items.content.Application

Zip items

contenttype = 'application/zip'
display_name = 'ZIP'
class MoinMoin.items.content.Audio(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Base class for audio/*

contenttype = 'audio/*'
group = 'Audio Items'
class MoinMoin.items.content.Binary(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Content

An arbitrary binary item, fallback class for every item mimetype.

class ModifyForm(value=Unspecified, **kw)[source]

Bases: flatland.schema.declarative.Form

The content part of the ModifyForm of an Item subclass. See also the doc of Item._ModifyForm.

field_schema = [<class 'flatland.schema.declarative.FileStorage'>]
template = 'modify_binary.html'
Binary.contenttype = '*/*'
Binary.data
Binary.do_get(force_attachment=False, mimetype=None)[source]
Binary.get_data()[source]
class MoinMoin.items.content.CSV(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Text

contenttype = 'text/csv'
display_name = 'CSV'
class MoinMoin.items.content.Content(contenttype, item=None)[source]

Bases: object

Base for content classes defining some helpers, agnostic about content data.

contenttype = None
classmethod create(contenttype, item=None)[source]
data
default_contenttype_params = {}
display_name = None
get_data()[source]
get_templates(contenttype=None)[source]

create a list of templates (for some specific contenttype)

group = 'Other Items'
ingroup_order = 0
internal_representation(*args, **kw)[source]

Return the internal representation of a document using a DOM Tree

name
rev
class MoinMoin.items.content.CreoleWiki(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

Creole wiki markup

contenttype = 'text/x.moin.creole'
display_name = 'Wiki (Creole)'
class MoinMoin.items.content.Diff(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Text

contenttype = 'text/x-diff'
display_name = 'Diff/Patch'
class MoinMoin.items.content.DocBook(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

DocBook Document

contenttype = 'application/docbook+xml'
display_name = 'DocBook'
class MoinMoin.items.content.Draw(contenttype, item=None)[source]

Bases: MoinMoin.items.content.TarMixin, MoinMoin.items.content.Image

Base class for drawing apps that use special Java/Javascript applets to modify and store data in a tar file.

class ModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.content.ModifyForm

field_schema = [<class 'flatland.schema.declarative.FileStorage'>]
is_draw = True
Draw.group = 'Drawing Items'
Draw.handle_post()[source]
class MoinMoin.items.content.DrawAWDTWDBase(contenttype, item=None)[source]

Bases: MoinMoin.items.content.DrawPNGMap

Shared code between TWikiDraw and AnyWikiDraw

handle_post()[source]
class MoinMoin.items.content.DrawPNGMap(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Draw

Base class for drawings that have a png with click map

class MoinMoin.items.content.GIF(contenttype, item=None)[source]

Bases: MoinMoin.items.content.TransformableBitmapImage

GIF image.

contenttype = 'image/gif'
display_name = 'GIF'
class MoinMoin.items.content.HTML(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

HTML markup

Note: As we use html_in converter to convert this to DOM and later some
output converterter to produce output format (e.g. html_out for html output), all(?) unsafe stuff will get lost.

Note: If raw revision data is accessed, unsafe stuff might be present!

class ModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.content.ModifyForm

field_schema = [<class 'flatland.schema.declarative.FileStorage'>, <class 'flatland.schema.declarative.String'>]
template = 'modify_text_html.html'
HTML.contenttype = 'text/html'
HTML.display_name = 'HTML'
class MoinMoin.items.content.IRCLog(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Text

contenttype = 'text/x-irclog'
display_name = 'IRC Log'
class MoinMoin.items.content.Image(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Base class for image/*

contenttype = 'image/*'
class MoinMoin.items.content.JPEG(contenttype, item=None)[source]

Bases: MoinMoin.items.content.TransformableBitmapImage

JPEG image.

contenttype = 'image/jpeg'
display_name = 'JPEG'
class MoinMoin.items.content.MP3(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Audio

contenttype = 'audio/mpeg'
display_name = 'MP3'
class MoinMoin.items.content.MP4(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Video

contenttype = 'video/mp4'
display_name = 'MP4'
class MoinMoin.items.content.Markdown(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

Markdown markup

contenttype = 'text/x-markdown'
display_name = 'Markdown'
class MoinMoin.items.content.MarkupItem(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Text

some kind of item with markup (internal links and transcluded items)

group = 'Markup Text Items'
class MoinMoin.items.content.MediaWiki(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

MediaWiki markup

contenttype = 'text/x-mediawiki'
display_name = 'Wiki (MediaWiki)'
class MoinMoin.items.content.MoinWiki(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

MoinMoin wiki markup

contenttype = 'text/x.moin.wiki'
display_name = 'Wiki (MoinMoin)'
class MoinMoin.items.content.NonExistentContent(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Content

Dummy Content to use with NonExistent.

contenttype = u'application/x-nonexistent'
do_get(force_attachment=False, mimetype=None)[source]
group = None
class MoinMoin.items.content.OGGAudio(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Audio

contenttype = 'audio/ogg'
display_name = 'OGG'
class MoinMoin.items.content.OGGVideo(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Video

contenttype = 'video/ogg'
display_name = 'OGG'
class MoinMoin.items.content.OctetStream(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Fallback Content for uploaded file of unknown contenttype.

contenttype = 'application/octet-stream'
display_name = 'Binary File'
class MoinMoin.items.content.PDF(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Application

contenttype = 'application/pdf'
display_name = 'PDF'
class MoinMoin.items.content.PNG(contenttype, item=None)[source]

Bases: MoinMoin.items.content.TransformableBitmapImage

PNG image.

contenttype = 'image/png'
display_name = 'PNG'
class MoinMoin.items.content.PlainText(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Text

contenttype = 'text/plain'
display_name = 'Plain Text'
class MoinMoin.items.content.PythonCode(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Text

contenttype = 'text/x-python'
display_name = 'Python Code'
class MoinMoin.items.content.ReST(contenttype, item=None)[source]

Bases: MoinMoin.items.content.MarkupItem

ReStructured Text markup

contenttype = 'text/x-rst'
display_name = 'ReST'
class MoinMoin.items.content.RegistryContent(group_names)[source]

Bases: MoinMoin.util.registry.RegistryBase

class Entry[source]

Bases: MoinMoin.items.content.Entry

RegistryContent.register(e, group)[source]

Register a contenttype entry and optionally add it to a specific group.

class MoinMoin.items.content.RenderableBinary(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Base class for some binary stuff that renders with a object tag.

class MoinMoin.items.content.RenderableBitmapImage(contenttype, item=None)[source]

Bases: MoinMoin.items.content.RenderableImage

PNG/JPEG/GIF images use <img> tag (better browser support than <object>)

class MoinMoin.items.content.RenderableImage(contenttype, item=None)[source]

Bases: MoinMoin.items.content.RenderableBinary

Base class for renderable Image mimetypes

group = 'Image Items'
class MoinMoin.items.content.SvgDraw(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Draw

drawings by svg-edit. It creates two files (svg, png) which are stored as tar file.

class ModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.content.ModifyForm

field_schema = [<class 'flatland.schema.declarative.FileStorage'>]
template = 'modify_svg-edit.html'
SvgDraw.contenttype = 'application/x-svgdraw'
SvgDraw.display_name = 'SVGDRAW'
SvgDraw.handle_post()[source]
class MoinMoin.items.content.SvgImage(contenttype, item=None)[source]

Bases: MoinMoin.items.content.RenderableImage

SVG images use <object> tag mechanism from RenderableBinary base class

contenttype = 'image/svg+xml'
display_name = 'SVG'
class MoinMoin.items.content.TWikiDraw(contenttype, item=None)[source]

Bases: MoinMoin.items.content.DrawAWDTWDBase

drawings by TWikiDraw applet. It creates three files which are stored as tar file.

class ModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.content.ModifyForm

field_schema = [<class 'flatland.schema.declarative.FileStorage'>]
template = 'modify_twikidraw.html'
TWikiDraw.contenttype = 'application/x-twikidraw'
TWikiDraw.display_name = 'TDRAW'
class MoinMoin.items.content.TarMixin[source]

Bases: object

TarMixin offers additional functionality for tar-like items to list and access member files and to create new revisions by multiple posts.

get_member(name)[source]

return a file-like object with the member file data

Parameters:name – name of the data in the container file
list_members()[source]

list tar file contents (member file names)

put_member(name, content, content_length, expected_members)[source]

puts a new member file into a temporary tar container. If all expected members have been put, it saves the tar container to a new item revision.

Parameters:
  • name – name of the data in the container file
  • content – the data to store into the tar file (str or file-like)
  • content_length – byte-length of content (for str, None can be given)
  • expected_members – set of expected member file names
class MoinMoin.items.content.Text(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Base class for text/*

class ModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.content.ModifyForm

cols = 80
field_schema = [<class 'flatland.schema.declarative.FileStorage'>, <class 'flatland.schema.declarative.String'>]
rows = 20
template = 'modify_text.html'
Text.contenttype = 'text/*'
Text.data_form_to_internal(data)[source]

convert data from form format to memory format

Text.data_internal_to_form(text)[source]

convert data from memory format to form format

Text.data_internal_to_storage(text)[source]

convert data from memory format to storage format

Text.data_storage_to_internal(data)[source]

convert data from storage format to memory format

Text.default_contenttype_params = {'charset': 'utf-8'}
Text.group = 'Other Text Items'
class MoinMoin.items.content.TransformableBitmapImage(contenttype, item=None)[source]

Bases: MoinMoin.items.content.RenderableBitmapImage

We can transform (resize, rotate, mirror) some image types

class MoinMoin.items.content.Video(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Binary

Base class for video/*

contenttype = 'video/*'
group = 'Video Items'
class MoinMoin.items.content.WAV(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Audio

contenttype = 'audio/x-wav'
display_name = 'WAV'
class MoinMoin.items.content.WebMAudio(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Audio

contenttype = 'audio/webm'
display_name = 'WebM'
class MoinMoin.items.content.WebMVideo(contenttype, item=None)[source]

Bases: MoinMoin.items.content.Video

contenttype = 'video/webm'
display_name = 'WebM'
class MoinMoin.items.content.ZipMixin[source]

Bases: object

ZipMixin offers additional functionality for zip-like items to list and access member files.

get_member(name)[source]

return a file-like object with the member file data

Parameters:name – name of the data in the zip file
list_members()[source]

list zip file contents (member file names)

put_member(name, content, content_length, expected_members)[source]
MoinMoin.items.content.conv_serialize(doc, namespaces, method='polyglot')[source]
MoinMoin.items.content.register(cls)[source]

MoinMoin.items.ticket module

MoinMoin - Ticket itemtype

TODO: Tickets require more work. Key requirements include but are not limited to:

  • ability to edit the original description or subsequent comments to correct typos
  • rework global history and global index to show or not show tickets and/or comments
  • rework page trail, subscriptions, navigation links to show something other than rev ids or timestamps
  • some method to override the default parser (text/x.moin.wiki) for a new ticket or comment
  • add more comments to the code

A ticket is a unique itemtype, the initial ticket consists of a description and meta data. Some of the meta data fields are unique to tickets.

The original design called for tickets to be nameless. Instead of a name, tickets would have a summary in meta data that would be too long for a typical wiki item name. However, it is not currently possible to create a nameless item, so as a workaround, tickets are created with a name similar to: ticket_2016_09_21-09_19_29.

When a ticket’s meta data is updated, a new revision is created and the ticket’s name is removed. After the first update, the current revision has an Old Name, after the second meta data update, the current name and Old Name are both displayed as None.

Ticket comments and ticket comments to comments are presently created without an item type. This is an issue because when a wiki is dumped and restored, all comments are tagged with an itemtype of “default”. This is probably not wanted, but no other problems after a restore were noted.

As a workaround to the issue of creating nameless items, comments are created with a name similar to: comment_2016_09_21-09_19_29. As comments can not currently be updated, the name is never removed. Comments and comments to comments are linked to the original ticket through a refers_to field preserved in meta data.

class MoinMoin.items.ticket.AdvancedSearchForm(value=Unspecified, **kw)[source]

Bases: flatland.schema.declarative.Form

field_schema = [<class 'flatland.schema.declarative.Integer'>, <class 'flatland.schema.declarative.Integer'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.Reference'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.Integer'>, <class 'flatland.schema.declarative.Reference'>, <class 'flatland.schema.declarative.Integer'>]
MoinMoin.items.ticket.OptionalTicketReference

alias of Reference

MoinMoin.items.ticket.OptionalUserReference

alias of Reference

MoinMoin.items.ticket.Rating

alias of Integer

class MoinMoin.items.ticket.Ticket(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Contentful

description = l'Ticket item'
display_name = l'Ticket'
do_modify()[source]

Process new ticket, changes to ticket meta data, and/or a new comment against original ticket description.

User has clicked “Submit ticket” or “Update ticket” button to get here. If user clicks Save button to add a comment to a prior comment it is not processed here - see /+comment in views.py.

do_show(revid)[source]
itemtype = u'ticket'
modify_template = 'ticket/modify.html'
submit_template = 'ticket/submit.html'
class MoinMoin.items.ticket.TicketBackRefForm(value=Unspecified, **kw)[source]

Bases: flatland.schema.declarative.Form

field_schema = [<class 'flatland.schema.declarative.BackReference'>, <class 'flatland.schema.declarative.BackReference'>, <class 'flatland.schema.declarative.BackReference'>]
class MoinMoin.items.ticket.TicketForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.BaseModifyForm

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.FileStorage'>, <class 'flatland.schema.declarative.TicketBackRefForm'>, <class 'flatland.schema.declarative.TicketMetaForm'>, <class 'flatland.schema.declarative.String'>]
class MoinMoin.items.ticket.TicketMetaForm(value=Unspecified, **kw)[source]

Bases: flatland.schema.declarative.Form

field_schema = [<class 'flatland.schema.declarative.Reference'>, <class 'flatland.schema.declarative.Integer'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.Reference'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.Integer'>, <class 'flatland.schema.declarative.Integer'>, <class 'flatland.schema.declarative.Reference'>, <class 'flatland.schema.declarative.Integer'>]
class MoinMoin.items.ticket.TicketSubmitForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.ticket.TicketForm

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.FileStorage'>, <class 'flatland.schema.declarative.TicketBackRefForm'>, <class 'flatland.schema.declarative.TicketMetaForm'>, <class 'flatland.schema.declarative.String'>]
submit_label = l'Submit ticket'
class MoinMoin.items.ticket.TicketUpdateForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.ticket.TicketForm

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.FileStorage'>, <class 'flatland.schema.declarative.TicketBackRefForm'>, <class 'flatland.schema.declarative.TicketMetaForm'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.Enum'>]
MoinMoin.items.ticket.build_tree(comments, root, comment_tree, indent)[source]

Return an ordered list of comments related to a root comment.

Parameters:
  • comments – dict containing list of comments related to root
  • root – a comment to the ticket description
  • comment_tree – empty list on first call, may be populated through recursion
Return type:

list of comments

Returns:

list of tuples [comments, indent] pertaining to a comment against original description

MoinMoin.items.ticket.check_itemid(self)[source]
MoinMoin.items.ticket.create_comment(meta, message)[source]

Create a new item comment against original description, refers_to links to original.

MoinMoin.items.ticket.file_upload(self, data_file)[source]
MoinMoin.items.ticket.get_comments(self)[source]

Return a list of roots (comments to original ticket) and a dict of comments (comments to comments).

MoinMoin.items.ticket.get_files(self)[source]
MoinMoin.items.ticket.get_itemid_short_summary(rev)[source]
MoinMoin.items.ticket.get_name(rev)[source]
MoinMoin.items.ticket.message_markup(message)[source]

Add a heading with author and timestamp to message (aka ticket description).

MoinMoin.items.ticket.render_comment_data(comment)[source]

Return a rendered comment.

Module contents

MoinMoin - high-level (frontend) items

While MoinMoin.storage cares for backend storage of items, this module cares for more high-level, frontend items, e.g. showing, editing, etc. of wiki items.

Each class in this module corresponds to an itemtype.

class MoinMoin.items.ACLValidator(**kw)[source]

Bases: flatland.validation.base.Validator

Meta Validator - currently used for validating ACLs only

acl_fail_msg = l'The ACL string is invalid'
validate(element, state)[source]
class MoinMoin.items.BaseChangeForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.security.textcha.TextChaizedForm

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>]
submit_label = l'OK'
class MoinMoin.items.BaseMetaForm(value=Unspecified, **kw)[source]

Bases: flatland.schema.declarative.Form

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.MyJoinedString'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.MyJoinedString'>]
class MoinMoin.items.BaseModifyForm(value=Unspecified, **kw)[source]

Bases: MoinMoin.items.BaseChangeForm

This class is abstract and only defines two factory methods; see Item._ModifyForm for the implementation.

field_schema = [<class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>, <class 'flatland.schema.declarative.String'>]
classmethod from_item(item)[source]

Construct an instance from :item.

This class method is not supposed to be overriden; subclasses should overrride the _load method instead.

classmethod from_request(request)[source]

Construct an instance from :request.

Since the mapping from HTTP form (unlike from an Item instance) to Flatland Form is straightforward, there should be rarely any need to override this class method.

class MoinMoin.items.Contentful(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Item

Base class for Item subclasses that have content.

ModifyForm
class MoinMoin.items.Default(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Contentful

A “conventional” wiki item.

description = l'Wiki item'
display_name = l'Default'
do_modify()[source]
do_show(revid)[source]

Display an item. If this is not the current revision, then page content will include an H1 tag with rev-id and next-rev / prior-rev links.

create a link to serve local doc files as help for wiki editors

itemtype = u'default'
order = -10
class MoinMoin.items.DummyItem(fqname)[source]

Bases: object

if we have no stored Item, we use this dummy

destroy_all_revisions()[source]
list_revisions()[source]
class MoinMoin.items.DummyRev(item, itemtype=None, contenttype=None)[source]

Bases: dict

if we have no stored Revision, we use this dummy

exception MoinMoin.items.FieldNotUniqueError[source]

Bases: exceptions.ValueError

The Field is not a UFIELD(unique Field). Non unique fields can refer to more than one item.

class MoinMoin.items.IndexEntry(relname, fullname, meta)

Bases: tuple

fullname

Alias for field number 1

meta

Alias for field number 2

relname

Alias for field number 0

class MoinMoin.items.Item(fqname, rev=None, content=None)[source]

Bases: object

Highlevel (not storage) Item, wraps around a storage Revision

build_index_query(startswith=None, selected_groups=None, isglobalindex=False)[source]
contenttype
classmethod create(name=u'', itemtype=None, contenttype=None, rev_id=u'current', item=None)[source]

Create a highlevel Item by looking up :name or directly wrapping :item and extract the Revision designated by :rev_id revision.

The highlevel Item is created by creating an instance of Content subclass according to the item’s contenttype metadata entry; The :contenttype argument can be used to override contenttype. It is used only when handling +convert (when deciding the contenttype of target item), +modify (when creating a new item whose contenttype is not yet decided), +diff and +diffraw (to coerce the Content to a common super-contenttype of both revisions).

After that the Content instance, an instance of Item subclass is created according to the item’s itemtype metadata entry, and the previously created Content instance is assigned to its content property.

delete(comment=u'')[source]

delete this item (remove current name from NAME list)

description = u''
destroy(comment=u'', destroy_item=False)[source]
display_name = u''
do_modify()[source]

Handle +modify requests, both GET and POST.

This method should be overridden in subclasses, providing polymorphic behavior for the +modify view.

get_index(startswith=None, selected_groups=None)[source]
get_meta()[source]
get_mixed_index()[source]
get_prefix_match(name, prefixes)[source]

returns the prefix match found.

get_subitem_revs()[source]

Create a list of subitems of this item.

Subitems are in the form of storage Revisions.

itemtype = ''
make_flat_index(subitems, isglobalindex=False)[source]

Create two IndexEntry lists - dirs and files - from a list of subitems.

Direct subitems are added to the files list.

For indirect subitems, its ancestor which is a direct subitem is added to the dirs list. Supposing current index root is ‘foo’ and when ‘foo/bar/la’ is encountered, ‘foo/bar’ is added to dirs.

The direct subitem need not exist.

When both a subitem itself and some of its subitems are in the subitems list, it appears in both files and dirs.

Parameters:isglobalindex – True if the query is for global indexes.
meta
meta_dict_to_text(meta, use_filter=True)[source]

convert meta data from a dict to a text fragment

meta_filter(meta)[source]

kill metadata entries that we set automatically when saving

meta_text_to_dict(text)[source]

convert meta data from a text fragment to a dict

meta_to_dict(meta, use_filter=True)[source]

convert meta data from storage object to python dict

modify(meta, data, comment=u'', contenttype_guessed=None, **update_meta)[source]
name

returns the first name from the list of names.

names

returns a list of 0..n names of the item If we are dealing with a specific name (e.g field being NAME_EXACT), move it to position 0 of the list, so the upper layer can use names[0] if they want that particular name and names for the whole list. TODO make the entire code to be able to use names instead of name

order = 0
prepare_meta_for_modify(meta)[source]

transform the meta dict of the current revision into a meta dict that can be used for saving next revision (after “modify”).

rename(name, comment=u'')[source]

rename this item to item <name> (replace current name by another name in the NAME list)

revert(comment=u'')[source]
shown = True
subitem_prefixes

Return the possible prefixes for subitems.

class MoinMoin.items.MixedIndexEntry(relname, fullname, meta, hassubitems)

Bases: tuple

fullname

Alias for field number 1

hassubitems

Alias for field number 3

meta

Alias for field number 2

relname

Alias for field number 0

exception MoinMoin.items.NameNotUniqueError[source]

Bases: exceptions.ValueError

An item with the same name exists.

class MoinMoin.items.NonExistent(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Item

A dummy Item for nonexistent items (when modifying, a nonexistent item with undetermined itemtype)

delete(comment=u'')[source]
destroy(comment=u'', destroy_item=False)[source]
do_modify()[source]
do_show(revid)[source]
itemtype = u'nonexistent'
rename(name, comment=u'')[source]
revert(comment=u'')[source]
shown = False
class MoinMoin.items.RegistryItem[source]

Bases: MoinMoin.util.registry.RegistryBase

class Entry[source]

Bases: MoinMoin.items.Entry

RegistryItem.register(e, shown)[source]

Register a factory

Parameters:factory – Factory to register. Callable, must return an object.
class MoinMoin.items.Userprofile(fqname, rev=None, content=None)[source]

Bases: MoinMoin.items.Item

Currently userprofile is implemented as a contenttype. This is a stub of an itemtype implementation of userprofile.

description = l'User profile item (not implemented yet!)'
display_name = l'User profile'
itemtype = u'userprofile'
MoinMoin.items.get_itemtype_specific_tags(itemtype)[source]

Returns the tags of a specific itemtype

MoinMoin.items.get_storage_revision(fqname, itemtype=None, contenttype=None, rev_id=u'current', item=None)[source]

Get a storage Revision.

If :item is supplied it is used as the storage Item; otherwise the storage Item is looked up with :name. If it is not found (either because the item doesn’t exist or the user does not have the required permissions) a DummyItem is created, and a DummyRev is created with appropriate metadata properties and the “item” property pointing to the DummyItem. The DummyRev is then returned.

If the previous step didn’t end up with a DummyRev, the revision designated by :rev_id is then looked up. If it is not found, current revision is looked up and returned instead. If current revision is not found (i.e. the item has no revision), a DummyRev is created. (TODO: in the last two cases, emit warnings or throw exceptions.)

:itemtype and :contenttype are used when creating a DummyRev, where metadata is not available from the storage.

MoinMoin.items.register(cls)[source]