summaryrefslogtreecommitdiff
path: root/wikicvt.py
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-03-02 20:58:09 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-03-03 00:31:18 +0200
commitae8b8bc81eab08b2ebe9f8c0957c085b5d45fc2b (patch)
tree551e90f993a83674faa367b776538c44704e78a6 /wikicvt.py
parent86ee544f442aa3c4a0516a620890ec64de0770cc (diff)
downloadwikitrans-ae8b8bc81eab08b2ebe9f8c0957c085b5d45fc2b.tar.gz
wikitrans-ae8b8bc81eab08b2ebe9f8c0957c085b5d45fc2b.tar.bz2
Rewrite from scratch. Text conversion almost(TM) works
Diffstat (limited to 'wikicvt.py')
-rw-r--r--wikicvt.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/wikicvt.py b/wikicvt.py
index 758bcb1..a2e95e4 100644
--- a/wikicvt.py
+++ b/wikicvt.py
@@ -34,5 +34,7 @@ def main():
kwdict = {}
+ debug = 0
+
try:
- opts, args = getopt.getopt(sys.argv[1:], "hl:o:tv",
- ["help", "lang=", "option=",
+ opts, args = getopt.getopt(sys.argv[1:], "d:hl:o:tv",
+ ["debug=", "help", "lang=", "option=",
"text", "input-text", "verbose" ])
@@ -44,9 +46,9 @@ def main():
usage()
- if o in ("-v", "--verbose"):
+ elif o in ("-v", "--verbose"):
verbose_flag = verbose_flag + 1
- if o in ("-t", "--text"):
+ elif o in ("-t", "--text"):
html = 0
- if o in ("-l", "--lang"):
+ elif o in ("-l", "--lang"):
lang = a
- if o in ("-o", "--option"):
+ elif o in ("-o", "--option"):
(kw,sep,val) = a.partition('=')
@@ -54,4 +56,6 @@ def main():
kwdict[kw] = eval(val)
- if o == "--input-text":
+ elif o == "--input-text":
input_text = True
+ elif o in ("-d", "--debug"):
+ debug = eval(a)
@@ -70,7 +74,7 @@ def main():
markup = TextWiktionaryMarkup(**kwdict)
-
+ markup.debug_level = debug
markup.parse()
print str(markup)
- if verbose_flag > 0:
- markup.output()
+# if verbose_flag > 0:
+# markup.output()

Return to:

Send suggestions and report system problems to the System administrator.