summaryrefslogtreecommitdiff
path: root/tests/test_pretty_print.py
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-11-26 19:43:40 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-11-26 19:43:40 (GMT)
commit2454c85348b5d1c645d8fbe777cfe611dbb49131 (patch)
treeececb635e695632e3876adb46a85560ce5fc5151 /tests/test_pretty_print.py
parent8197294d4c30d533c88ef2901e298d2b2863aa87 (diff)
improve html output, logging
Diffstat (limited to 'tests/test_pretty_print.py')
-rwxr-xr-xtests/test_pretty_print.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index 4dd614b..2f533ab 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -240,6 +240,7 @@ def wikitohtml(wiki_rootpath, sysid, wikidata, manifest):
head = '<html><head><title>'+wiki_rootpath+' test run for '+sysid +'</title></head><body>'
revmanifest = dict((val,key) for key, val in manifest.iteritems())
x=re.sub('\{\|(.*?)\n','<table \\1>\n',wikidata)
+ x=re.sub('\|(.*?colspan.*?)\|','<td \\1>',x)
x=re.sub("'''(.*?)'''","<b>\\1</b>",x)
filestrs=re.findall('\[\[File\:(.*?)\|.*?\]\]',x)
for f in filestrs:
@@ -270,28 +271,28 @@ def upload(wikiurl,api_php_path,wikidata,manifest,wiki_rootpath,sysid,botname,bo
import mwclient
except:
print 'please download mwclient and unpack here:', os.cwd()
- print 'open site',wikiurl
+ print 'opening site:',wikiurl
if not api_php_path == '':
site = mwclient.Site(wikiurl,api_php_path)
else:
site = mwclient.Site(wikiurl)
- print 'bot login'
+ print 'bot login:', botname
site.login(botname,botpass)
- print 'edit ',wiki_rootpath
+ print 'edit page:',wiki_rootpath
page = site.Pages[wiki_rootpath]
text = page.edit()
rootpage = wiki_rootpath + sysid
if not '[['+rootpage+']]' in text:
page.save(text +'\n*[['+rootpage+']]\n')
- print 'upload wiki data to',rootpage
+ print 'upload wiki page:',rootpage
page = site.Pages[rootpage]
text = page.edit()
page.save(wikidata)
- print 'upload images'
+ print 'upload images:'
for localfile in sorted(manifest.keys()):
if localfile:
localf = open(localfile,'rb')
contact: Jan Huwald // Impressum