comparison lxmldump.py @ 51:5d3fb2f3aa21

Remove cleanup function as it is unused.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 26 May 2021 23:10:51 +0300
parents 5b22ffdab0ce
children 95671cdda422 301452a71cc7
comparison
equal deleted inserted replaced
50:5b22ffdab0ce 51:5d3fb2f3aa21
47 PKK_MODE_ANKI: u"<a href='https://kaino.kotus.fi/cgi-bin/kks/karjala.cgi?a={href}'>{text}</a>", 47 PKK_MODE_ANKI: u"<a href='https://kaino.kotus.fi/cgi-bin/kks/karjala.cgi?a={href}'>{text}</a>",
48 }, 48 },
49 49
50 "word_fmt": { 50 "word_fmt": {
51 PKK_MODE_NORMAL: "\"{word}\"{search}{attr}\n{hyphenation}{main_sense}{other_senses}\n", 51 PKK_MODE_NORMAL: "\"{word}\"{search}{attr}\n{hyphenation}{main_sense}{other_senses}\n",
52 PKK_MODE_ANKI: "\"{word}\"{search}{attr}{hyphenation};{main_sense};{other_senses}\n\n", 52 PKK_MODE_ANKI: "\"{word}\"{search}{attr}{hyphenation};{main_sense};{other_senses}\n",
53 }, 53 },
54 "word_attr_list": { 54 "word_attr_list": {
55 PKK_MODE_NORMAL: " ({alist}) ", 55 PKK_MODE_NORMAL: " ({alist}) ",
56 PKK_MODE_NORMAL: " ({alist})", 56 PKK_MODE_NORMAL: " ({alist})",
57 }, 57 },
146 146
147 147
148 ### 148 ###
149 ### Misc. helper functions, etc 149 ### Misc. helper functions, etc
150 ### 150 ###
151 def pkk_cleanup():
152 return 0
153
154 151
155 ## Print string to stdout using normalized Unicode if enabled 152 ## Print string to stdout using normalized Unicode if enabled
156 def pkk_print(smsg): 153 def pkk_print(smsg):
157 try: 154 try:
158 if pkk_cfg.normalize: 155 if pkk_cfg.normalize:
180 sys.exit(1) 177 sys.exit(1)
181 178
182 179
183 ## Handler for SIGINT signals 180 ## Handler for SIGINT signals
184 def pkk_signal_handler(signal, frame): 181 def pkk_signal_handler(signal, frame):
185 pkk_cleanup()
186 print(u"\nQuitting due to SIGINT / Ctrl+C!") 182 print(u"\nQuitting due to SIGINT / Ctrl+C!")
187 sys.exit(1) 183 sys.exit(1)
188 184
189 185
190 class pkk_set_mode(argparse.Action): 186 class pkk_set_mode(argparse.Action):
536 532
537 except (BrokenPipeError, IOError) as e: 533 except (BrokenPipeError, IOError) as e:
538 sys.stderr.close() 534 sys.stderr.close()
539 sys.exit(1) 535 sys.exit(1)
540 536
541 pkk_cleanup()
542 sys.exit(0) 537 sys.exit(0)