Mercurial > ppgen
comparison ppgen.py @ 9:35c468a37b54
Extend command line options to select 2nd language
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 02 Oct 2019 15:04:28 +0200 |
parents | 200c2c3c5f67 |
children | 15d5b3961009 |
comparison
equal
deleted
inserted
replaced
8:200c2c3c5f67 | 9:35c468a37b54 |
---|---|
49 # "jikf", "zug", "lmf", "opq"] | 49 # "jikf", "zug", "lmf", "opq"] |
50 # second test dictionary to show that different string functions are used. | 50 # second test dictionary to show that different string functions are used. |
51 #d = [''.join('A' * 1000) for _ in range(1000)] | 51 #d = [''.join('A' * 1000) for _ in range(1000)] |
52 | 52 |
53 # Using the dictionary from Ding **customize** | 53 # Using the dictionary from Ding **customize** |
54 d = readDingDict(options, filename="/usr/share/trans/de-en", useLeft=True) | 54 d = readDingDict(options, |
55 filename="/usr/share/trans/de-en", | |
56 useLeft=not options.second_language) | |
55 | 57 |
56 # for debugging purposes, dump dictionary | 58 # for debugging purposes, dump dictionary |
57 if options.ddump_filename: | 59 if options.ddump_filename: |
58 print("Writing out dictionary in '{}'.".format(options.ddump_filename)) | 60 print("Writing out dictionary in '{}'.".format(options.ddump_filename)) |
59 with open(options.ddump_filename, "w") as f: | 61 with open(options.ddump_filename, "w") as f: |
134 'most useful with -j') | 136 'most useful with -j') |
135 parser.add_argument('-j', '--just-passphrase', action="store_true", | 137 parser.add_argument('-j', '--just-passphrase', action="store_true", |
136 help='only output the passphrase on a single line') | 138 help='only output the passphrase on a single line') |
137 parser.add_argument('--ddump-filename', | 139 parser.add_argument('--ddump-filename', |
138 help='filename to dump the dictionary to') | 140 help='filename to dump the dictionary to') |
141 parser.add_argument('-2', '--second-language', action='store_true', | |
142 help='use the second language in the ding dictionary') | |
139 options = parser.parse_args() | 143 options = parser.parse_args() |
140 | 144 |
141 dictionary = buildDictionary(options) | 145 dictionary = buildDictionary(options) |
142 | 146 |
143 how_many = options.number_of_words | 147 how_many = options.number_of_words |