Commit 3a2a4b8a authored by Brett Wilkins's avatar Brett Wilkins

mt2mw/mt2mw: Adding output for user to see progress

parent 224a5c14
......@@ -26,8 +26,11 @@ cfg = cp.SafeConfigParser()
cfg.read('config.ini')
# get the root element in the page structure
print "Attempting to get the mindtouch wiki layout"
mtwiki = MTWiki(cfg.get('config', 'mindtouch_url'))
homepage = mtwiki.get_sitemap()
if homepage:
print "Have mindtouch layout."
directdb = cfg.get('config', 'direct_db')
dbconfig = None
......@@ -39,6 +42,7 @@ if directdb:
'password': cfg.get('config', 'mediawiki_db_password'),
}
print "Attempting to create mediawiki connection"
mwwiki = MWWiki(
cfg.get('config', 'mediawiki_url'),
cfg.get('config', 'mediawiki_user'),
......@@ -46,10 +50,15 @@ mwwiki = MWWiki(
dbconfig,
cfg.get('config', 'dataroot'),
)
if mwwiki:
print "MediaWiki Connection created"
print "Creating MediaWiki from mindtouch site..."
mwwiki.create_from_mindtouch(homepage)
print "MediaWiki updated"
# point MediaWiki:MainPage at the new homepage
print "Updating MediaWiki homepage"
mwwiki.update_mainpage(homepage)
mwwiki.done()
print "All done!"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment