Attachment 'exchangecategory.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - Action for exchanging the category of the page
   4 
   5     @copyright: 2012 MoinMoin:ReimarBauer
   6     @license: GNU GPL, see COPYING for details.
   7 """
   8 
   9 from MoinMoin.Page import Page
  10 from MoinMoin.PageEditor import PageEditor
  11 
  12 def execute(pagename, request):
  13     if not request.user.may.read(pagename):
  14         msg = "You are not allowed to view this page."
  15         request.theme.add_msg(msg, "error")
  16         Page(request, pagename).send_page()
  17     else:
  18         text = Page(request, pagename).get_raw_body()
  19         '''
  20         ADD here the code to replace the category
  21         '''
  22         msg = "Changed category foo to bar."
  23         try:
  24             PageEditor(request, pagename).saveText(text, 0)
  25         except PageEditor.Unchanged:
  26             msg = "You did not change the page content, not saved!"
  27         request.theme.add_msg(msg, "info")
  28         Page(request, pagename).send_page()

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-09-19 13:42:22, 10.9 KB) [[attachment:WikiAdministration_DebugInfo.zip]]
  • [get | view] (2012-03-03 10:08:09, 0.9 KB) [[attachment:exchangecategory.py]]
  • [get | view] (2011-07-25 12:27:20, 1.6 KB) [[attachment:home.png]]
  • [get | view] (2007-09-19 13:17:18, 211.6 KB) [[attachment:htmldoc_WikiAdministration_ClassicTheme.zip]]
  • [get | view] (2006-02-17 10:35:21, 18.2 KB) [[attachment:wiki0.jpg]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.