Make text formatting faster via StringIO

Avoid concatenating strings over and over. Also, the wiki formatting
wasn't necessary at all since it was just joining lines.
This commit is contained in:
Daniel Martí 2015-12-03 12:02:47 +01:00
parent 088929711c
commit 1b43d8e33c
2 changed files with 47 additions and 36 deletions

View file

@ -21,7 +21,10 @@
from argparse import ArgumentParser
import os
import logging
import StringIO
try:
from cStringIO import StringIO
except:
from StringIO import StringIO
import common
import metadata
@ -70,7 +73,7 @@ def main():
to_ext = options.to
if options.list:
s = StringIO.StringIO()
s = StringIO()
# TODO: currently reading entire file again, should reuse first
# read in metadata.py
with open(metadatapath, 'r') as f: