2008-10-09 20:34:33 +04:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
"""
|
2008-10-25 00:29:33 +04:00
|
|
|
Upload a page to MDC
|
2008-10-09 20:34:33 +04:00
|
|
|
|
|
|
|
Usage: python MDC-upload.py <file> <MDC-path>
|
|
|
|
Please set MDC_USER and MDC_PASSWORD in the environment
|
|
|
|
"""
|
|
|
|
|
2008-10-25 00:29:33 +04:00
|
|
|
import os, sys, deki
|
2008-10-09 20:34:33 +04:00
|
|
|
|
|
|
|
wikiuser = os.environ['MDC_USER']
|
|
|
|
wikipw = os.environ['MDC_PASSWORD']
|
|
|
|
|
|
|
|
(file, wikipath) = sys.argv[1:]
|
|
|
|
|
|
|
|
wiki = deki.Deki("http://developer.mozilla.org/@api/deki/", wikiuser, wikipw)
|
|
|
|
wiki.create_page(wikipath, open(file).read(), overwrite=True)
|