2008-10-09 20:34:33 +04:00
|
|
|
#!/usr/bin/env python
|
2012-05-21 15:12:37 +04:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2008-10-09 20:34:33 +04:00
|
|
|
|
|
|
|
"""
|
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)
|