diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-03-02 20:58:09 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-03-03 00:31:18 +0200 |
commit | ae8b8bc81eab08b2ebe9f8c0957c085b5d45fc2b (patch) | |
tree | 551e90f993a83674faa367b776538c44704e78a6 /wikicvt.py | |
parent | 86ee544f442aa3c4a0516a620890ec64de0770cc (diff) | |
download | wikitrans-ae8b8bc81eab08b2ebe9f8c0957c085b5d45fc2b.tar.gz wikitrans-ae8b8bc81eab08b2ebe9f8c0957c085b5d45fc2b.tar.bz2 |
Rewrite from scratch. Text conversion almost(TM) works
Diffstat (limited to 'wikicvt.py')
-rw-r--r-- | wikicvt.py | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -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() |