aboutsummaryrefslogtreecommitdiff
path: root/wikicvt.py
diff options
context:
space:
mode:
Diffstat (limited to 'wikicvt.py')
-rwxr-xr-xwikicvt.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/wikicvt.py b/wikicvt.py
index c8ca887..41bba2f 100755
--- a/wikicvt.py
+++ b/wikicvt.py
@@ -15,9 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import print_function
import sys
import getopt
-import StringIO
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
from wiki2html import *
from wiki2text import *
from wiki2texi import *
@@ -25,17 +29,17 @@ from wiki2texi import *
class DumpWikiMarkup (WikiMarkup):
def __str__(self):
if self.tree:
- s = StringIO.StringIO()
+ s = StringIO()
self.dump(self.tree, 0, s)
return s.getvalue()
else:
return ""
def usage(code=0):
- print """
-usage: %s [-hvt] [-I INTYPE] [-l lang] [-o kw=val] [--lang=lang] [--option kw=val]
- [--input-type=INTYPE] [--type=OUTTYPE] [--help] [--verbose] file
-""" % (sys.argv[0])
+ print("""usage: %s [-hvt] [-I INTYPE] [-l lang] [-o kw=val] [--lang=lang]
+ [--option kw=val] [--input-type=INTYPE] [--type=OUTTYPE] [--help]
+ [--verbose] file
+""" % sys.argv[0])
sys.exit(code)
handlers = {
@@ -109,12 +113,12 @@ def main():
markup = handlers[otype][itype](**kwdict)
markup.debug_level = debug
markup.parse()
- print str(markup)
+ print("%s" % str(markup))
exit(0)
else:
- print "unsupported input type: %s" % (itype)
+ print("unsupported input type: %s" % itype)
else:
- print "unsupported output type: %s" % (otype)
+ print("unsupported output type: %s" % otype)
exit(1)
if __name__ == '__main__':

Return to:

Send suggestions and report system problems to the System administrator.