Edit Diskussion History Attachments

attachment:moin-upload.py of LarpWiki/Migration

Attachment 'moin-upload.py'

Download

   1 #!/usr/bin/python
   2 import sys
   3 import string
   4 import xmlrpclib
   5 wiki = xmlrpclib.ServerProxy("http://moin.larpwiki.de/?action=xmlrpc2")
   6 user = 'LarpWikiMigration'
   7 passwd = '*******'
   8 
   9 pagename = sys.argv[1]
  10 content_lines = sys.stdin.readlines()
  11 content = string.join(content_lines,'')
  12 
  13 auth_token = wiki.getAuthToken(user, passwd)
  14 mc = xmlrpclib.MultiCall(wiki)
  15 mc.applyAuthToken(auth_token)
  16 mc.putPage(pagename, content)
  17 result = mc()

New Attachment

File to upload
Rename to
Overwrite existing attachment of same name
Type: LARP

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] (2011-12-03 19:34:24, 0.6 KB) [[attachment:convert.sh]]
  • [get | view] (2011-12-03 19:36:39, 0.4 KB) [[attachment:moin-upload.py]]
  • [get | view] (2011-12-03 19:33:37, 14.0 KB) [[attachment:um2mm.pl]]
 All files | Selected Files: delete move to page copy to page