chgksuite 0.26.0b11__tar.gz → 0.27.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. chgksuite-0.27.0/.github/workflows/build.yml +291 -0
  2. chgksuite-0.27.0/.gitignore +10 -0
  3. chgksuite-0.27.0/.gitlab-ci.yml +17 -0
  4. chgksuite-0.27.0/.hgignore +2 -0
  5. chgksuite-0.27.0/.~lock.results.xlsx# +1 -0
  6. {chgksuite-0.26.0b11/chgksuite.egg-info → chgksuite-0.27.0}/PKG-INFO +10 -19
  7. chgksuite-0.27.0/adhoc/regexes_fixer.py +66 -0
  8. chgksuite-0.27.0/author_counter.py +24 -0
  9. chgksuite-0.27.0/chgksuite/_html2md.py +90 -0
  10. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/cli.py +38 -8
  11. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/common.py +16 -12
  12. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/__init__.py +9 -7
  13. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/chgksuite_parser.py +20 -9
  14. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/composer_common.py +30 -3
  15. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/db.py +1 -2
  16. chgksuite-0.27.0/chgksuite/composer/docx.py +725 -0
  17. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/latex.py +3 -4
  18. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/lj.py +1 -2
  19. chgksuite-0.26.0b11/chgksuite/composer/reddit.py → chgksuite-0.27.0/chgksuite/composer/markdown.py +35 -25
  20. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/openquiz.py +2 -3
  21. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/pptx.py +18 -6
  22. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/telegram.py +22 -10
  23. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/handouter/gen.py +11 -7
  24. chgksuite-0.27.0/chgksuite/handouter/runner.py +461 -0
  25. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/handouter/tex_internals.py +12 -13
  26. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/handouter/utils.py +22 -1
  27. chgksuite-0.27.0/chgksuite/lastdir +1 -0
  28. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/parser.py +218 -37
  29. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/parser_db.py +4 -6
  30. chgksuite-0.27.0/chgksuite/resources/labels_az.toml +22 -0
  31. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_by.toml +1 -2
  32. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_by_tar.toml +1 -2
  33. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_en.toml +1 -2
  34. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_kz_cyr.toml +1 -2
  35. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_ru.toml +1 -2
  36. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_sr.toml +1 -2
  37. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_ua.toml +1 -2
  38. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_uz.toml +0 -3
  39. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/labels_uz_cyr.toml +1 -2
  40. chgksuite-0.27.0/chgksuite/resources/regexes_az.json +17 -0
  41. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_by.json +3 -2
  42. chgksuite-0.27.0/chgksuite/resources/regexes_by_tar.json +17 -0
  43. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_en.json +3 -2
  44. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_kz_cyr.json +3 -2
  45. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_ru.json +3 -2
  46. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_sr.json +3 -2
  47. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_ua.json +3 -2
  48. chgksuite-0.27.0/chgksuite/resources/regexes_uz.json +16 -0
  49. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/regexes_uz_cyr.json +3 -2
  50. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/trello.py +8 -9
  51. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/typotools.py +9 -8
  52. chgksuite-0.27.0/chgksuite/version.py +1 -0
  53. chgksuite-0.27.0/debug_0.txt +3 -0
  54. chgksuite-0.27.0/debug_1.json +10 -0
  55. chgksuite-0.27.0/debug_1a.json +10 -0
  56. chgksuite-0.27.0/debug_2.json +10 -0
  57. chgksuite-0.27.0/debug_3.json +10 -0
  58. chgksuite-0.27.0/debug_4.json +14 -0
  59. chgksuite-0.27.0/debug_5.json +14 -0
  60. chgksuite-0.27.0/debug_6.json +10 -0
  61. chgksuite-0.27.0/debug_final.json +10 -0
  62. chgksuite-0.27.0/dev_readme.md +25 -0
  63. chgksuite-0.27.0/docs/.cache/.gitignore +1 -0
  64. chgksuite-0.27.0/docs/.cache/12897346880794287463 +43 -0
  65. chgksuite-0.27.0/docs/.cache/13071136909783630831 +27 -0
  66. chgksuite-0.27.0/docs/.cache/13307108790744403429 +58 -0
  67. chgksuite-0.27.0/docs/.cache/13333983167045209281 +27 -0
  68. chgksuite-0.27.0/docs/.cache/14085495286103177657 +4 -0
  69. chgksuite-0.27.0/docs/.cache/15213489598760314030 +149 -0
  70. chgksuite-0.27.0/docs/.cache/15319492834190874243 +4 -0
  71. chgksuite-0.27.0/docs/.cache/17387058097034297385 +4 -0
  72. chgksuite-0.27.0/docs/.cache/17722115158263369208 +4 -0
  73. chgksuite-0.27.0/docs/.cache/18247088324849079572 +4 -0
  74. chgksuite-0.27.0/docs/.cache/1840587404175770520 +43 -0
  75. chgksuite-0.27.0/docs/.cache/2517734129797249711 +4 -0
  76. chgksuite-0.27.0/docs/.cache/273431981325847810 +164 -0
  77. chgksuite-0.27.0/docs/.cache/2872065536916780406 +27 -0
  78. chgksuite-0.27.0/docs/.cache/3476900567878811119 +4 -0
  79. chgksuite-0.27.0/docs/.cache/4757258273854424423 +58 -0
  80. chgksuite-0.27.0/docs/.cache/5728722062471071239 +58 -0
  81. chgksuite-0.27.0/docs/.cache/6061198691539556612 +4 -0
  82. chgksuite-0.27.0/docs/.cache/6079179394456200124 +4 -0
  83. chgksuite-0.27.0/docs/.cache/735877668610100612 +73 -0
  84. chgksuite-0.27.0/docs/.cache/9345880734637750342 +4 -0
  85. chgksuite-0.27.0/docs/.cache/9490951945832949972 +4 -0
  86. chgksuite-0.27.0/docs/docs/4s.md +229 -0
  87. chgksuite-0.27.0/docs/docs/add_stats.md +9 -0
  88. chgksuite-0.27.0/docs/docs/base.md +43 -0
  89. chgksuite-0.27.0/docs/docs/i14n.md +31 -0
  90. chgksuite-0.27.0/docs/docs/images/base.png +0 -0
  91. chgksuite-0.27.0/docs/docs/images/douplet_problem.png +0 -0
  92. chgksuite-0.27.0/docs/docs/images/i14n.png +0 -0
  93. chgksuite-0.27.0/docs/docs/images/i14n_parse.png +0 -0
  94. chgksuite-0.27.0/docs/docs/images/lj.png +0 -0
  95. chgksuite-0.27.0/docs/docs/images/main.png +0 -0
  96. chgksuite-0.27.0/docs/docs/images/openquiz.png +0 -0
  97. chgksuite-0.27.0/docs/docs/images/openquiz2.png +0 -0
  98. chgksuite-0.27.0/docs/docs/images/parse.png +0 -0
  99. chgksuite-0.27.0/docs/docs/images/pptx.png +0 -0
  100. chgksuite-0.27.0/docs/docs/images/pptx_additional_conf.png +0 -0
  101. chgksuite-0.27.0/docs/docs/images/pptx_slide_a.png +0 -0
  102. chgksuite-0.27.0/docs/docs/images/pptx_slide_q.png +0 -0
  103. chgksuite-0.27.0/docs/docs/images/roenko.png +0 -0
  104. chgksuite-0.27.0/docs/docs/images/rozhdsushkov.png +0 -0
  105. chgksuite-0.27.0/docs/docs/images/stats.png +0 -0
  106. chgksuite-0.27.0/docs/docs/images/telegram.png +0 -0
  107. chgksuite-0.27.0/docs/docs/images/trello_download.png +0 -0
  108. chgksuite-0.27.0/docs/docs/images/trello_token.png +0 -0
  109. chgksuite-0.27.0/docs/docs/images/trello_upload.png +0 -0
  110. chgksuite-0.27.0/docs/docs/images/word.png +0 -0
  111. chgksuite-0.27.0/docs/docs/index.md +59 -0
  112. chgksuite-0.27.0/docs/docs/lj.md +9 -0
  113. chgksuite-0.27.0/docs/docs/openquiz.md +7 -0
  114. chgksuite-0.27.0/docs/docs/pptx.md +66 -0
  115. chgksuite-0.27.0/docs/docs/stylesheets/extra.css +29 -0
  116. chgksuite-0.27.0/docs/docs/telegram.md +46 -0
  117. chgksuite-0.27.0/docs/docs/trello.md +31 -0
  118. chgksuite-0.27.0/docs/docs/word.md +24 -0
  119. chgksuite-0.27.0/docs/mkdocs.yml +35 -0
  120. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/history.md +25 -1
  121. chgksuite-0.27.0/hook-dateparser.py +12 -0
  122. chgksuite-0.27.0/packer.py +172 -0
  123. chgksuite-0.27.0/pyproject.toml +64 -0
  124. chgksuite-0.27.0/pytest.ini +5 -0
  125. chgksuite-0.27.0/pytest.sh +7 -0
  126. chgksuite-0.27.0/re_helper.py +24 -0
  127. chgksuite-0.27.0/requirements_dev.txt +2 -0
  128. chgksuite-0.27.0/results.xlsx +0 -0
  129. chgksuite-0.27.0/ruff.toml +2 -0
  130. chgksuite-0.27.0/test_multiple_images.txt +3 -0
  131. chgksuite-0.27.0/test_oschr/404.jpg +0 -0
  132. chgksuite-0.27.0/test_oschr/Arhipova_Shtirlic-shel-po-koridoru-.803300.pdf/stirlitz_was_walking.fbd +525 -0
  133. chgksuite-0.27.0/test_oschr/Arhipova_Shtirlic-shel-po-koridoru-.803300.pdf/stirlitz_was_walking.pdf +0 -0
  134. chgksuite-0.27.0/test_oschr/alexeeva.jpeg +0 -0
  135. chgksuite-0.27.0/test_oschr/arhipova.txt +1030 -0
  136. chgksuite-0.27.0/test_oschr/ber.png +0 -0
  137. chgksuite-0.27.0/test_oschr/columns.txt +35 -0
  138. chgksuite-0.27.0/test_oschr/columns_ru.pdf +0 -0
  139. chgksuite-0.27.0/test_oschr/cool.pdf +0 -0
  140. chgksuite-0.27.0/test_oschr/cool.png +0 -0
  141. chgksuite-0.27.0/test_oschr/dish.png +0 -0
  142. chgksuite-0.27.0/test_oschr/dubinki.png +0 -0
  143. chgksuite-0.27.0/test_oschr/duran01.jpg +0 -0
  144. chgksuite-0.27.0/test_oschr/duran02.jpg +0 -0
  145. chgksuite-0.27.0/test_oschr/duran03.jpg +0 -0
  146. chgksuite-0.27.0/test_oschr/duran04.jpg +0 -0
  147. chgksuite-0.27.0/test_oschr/duran05.jpg +0 -0
  148. chgksuite-0.27.0/test_oschr/duran06.jpg +0 -0
  149. chgksuite-0.27.0/test_oschr/duran07.jpg +0 -0
  150. chgksuite-0.27.0/test_oschr/duran08.jpg +0 -0
  151. chgksuite-0.27.0/test_oschr/duran09.jpg +0 -0
  152. chgksuite-0.27.0/test_oschr/duran10.jpg +0 -0
  153. chgksuite-0.27.0/test_oschr/eisenhower.png +0 -0
  154. chgksuite-0.27.0/test_oschr/emo.pdf +0 -0
  155. chgksuite-0.27.0/test_oschr/emo.png +0 -0
  156. chgksuite-0.27.0/test_oschr/emosong.png +0 -0
  157. chgksuite-0.27.0/test_oschr/emosong1.png +0 -0
  158. chgksuite-0.27.0/test_oschr/emosong2.png +0 -0
  159. chgksuite-0.27.0/test_oschr/handouts_test.txt +30 -0
  160. chgksuite-0.27.0/test_oschr/handouts_test_ru.tex +296 -0
  161. chgksuite-0.27.0/test_oschr/karikatura_razdatka.png +0 -0
  162. chgksuite-0.27.0/test_oschr/kuzmin-tat.png +0 -0
  163. chgksuite-0.27.0/test_oschr/kuzmin.txt +13242 -0
  164. chgksuite-0.27.0/test_oschr/otbor_studchr.txt +79 -0
  165. chgksuite-0.27.0/test_oschr/otbor_studchr_handouts.txt +16 -0
  166. chgksuite-0.27.0/test_oschr/otbor_studchr_handouts_ru.pdf +0 -0
  167. chgksuite-0.27.0/test_oschr/panchenko.txt +23670 -0
  168. chgksuite-0.27.0/test_oschr/zine.png +0 -0
  169. chgksuite-0.27.0/test_with_image.txt +3 -0
  170. chgksuite-0.27.0/test_with_real_image.txt +3 -0
  171. chgksuite-0.27.0/tests/2019-07-23_beln19_u.docx +0 -0
  172. chgksuite-0.27.0/tests/2019-07-23_beln19_u.docx.canon +690 -0
  173. chgksuite-0.27.0/tests/Kubok_knyagini_Olgi-2015.docx +0 -0
  174. chgksuite-0.27.0/tests/Kubok_knyagini_Olgi-2015.docx.canon +644 -0
  175. chgksuite-0.27.0/tests/Shkolny_Chemp_Estonii-2014_(48v).docx +0 -0
  176. chgksuite-0.27.0/tests/Shkolny_Chemp_Estonii-2014_(48v).docx.canon +361 -0
  177. chgksuite-0.27.0/tests/__init__.py +0 -0
  178. chgksuite-0.27.0/tests/balt09-1.txt +783 -0
  179. chgksuite-0.27.0/tests/balt09-1.txt.canon +286 -0
  180. chgksuite-0.27.0/tests/borromeo.txt +11 -0
  181. chgksuite-0.27.0/tests/borromeo.txt.canon +16 -0
  182. chgksuite-0.27.0/tests/canonize.py +69 -0
  183. chgksuite-0.27.0/tests/chgksuite_test.py +364 -0
  184. chgksuite-0.27.0/tests/conftest.py +21 -0
  185. chgksuite-0.27.0/tests/encrypt_test_files.py +147 -0
  186. chgksuite-0.27.0/tests/haifa2025.docx +0 -0
  187. chgksuite-0.27.0/tests/haifa2025.docx.canon +349 -0
  188. chgksuite-0.27.0/tests/haifa2025.docx.encrypted +0 -0
  189. chgksuite-0.27.0/tests/haifa2025.docx.encrypted.canon +0 -0
  190. chgksuite-0.27.0/tests/link_unwrap.docx +0 -0
  191. chgksuite-0.27.0/tests/link_unwrap.docx.canon +10 -0
  192. chgksuite-0.27.0/tests/ljcredentials +1 -0
  193. chgksuite-0.27.0/tests/long_handout.png +0 -0
  194. chgksuite-0.27.0/tests/malkin_papkov_synchr.docx +0 -0
  195. chgksuite-0.27.0/tests/malkin_papkov_synchr.docx.canon +99 -0
  196. chgksuite-0.27.0/tests/octo2021_khmelkov.docx +0 -0
  197. chgksuite-0.27.0/tests/octo2021_khmelkov.docx.canon +102 -0
  198. chgksuite-0.27.0/tests/ovsch_boronenko_3.4s +334 -0
  199. chgksuite-0.27.0/tests/ovsch_boronenko_3.docx +0 -0
  200. chgksuite-0.27.0/tests/ovsch_boronenko_3.docx.canon +334 -0
  201. chgksuite-0.27.0/tests/pass1.docx +0 -0
  202. chgksuite-0.27.0/tests/pass1.docx.canon +183 -0
  203. chgksuite-0.27.0/tests/settings.json +3 -0
  204. chgksuite-0.27.0/tests/single_number_line_test.docx +0 -0
  205. chgksuite-0.27.0/tests/single_number_line_test.docx.canon +46 -0
  206. chgksuite-0.27.0/tests/smalltest.4s +6 -0
  207. chgksuite-0.27.0/tests/test.jpg +0 -0
  208. chgksuite-0.27.0/tests/test_blitz.txt +8 -0
  209. chgksuite-0.27.0/tests/test_blitz.txt.canon +9 -0
  210. chgksuite-0.27.0/tests/tourrev_with_razmin.docx +0 -0
  211. chgksuite-0.27.0/tests/tourrev_with_razmin.docx.canon +34 -0
  212. chgksuite-0.27.0/tests//320/241/320/247/320/240_/320/250/320/265/321/200/320/265/320/264/320/265/320/263/320/260_/320/225/321/200/320/274/320/270/321/210/320/272/320/270/320/275.docx +0 -0
  213. chgksuite-0.27.0/tests//320/241/320/247/320/240_/320/250/320/265/321/200/320/265/320/264/320/265/320/263/320/260_/320/225/321/200/320/274/320/270/321/210/320/272/320/270/320/275.docx.canon +13 -0
  214. chgksuite-0.27.0/uv.lock +1454 -0
  215. chgksuite-0.27.0//320/235/320/276/321/207/321/214/320/241/320/276/320/263/321/200/320/265/320/262/320/260/321/216/321/211/320/265/320/263/320/276/320/236/321/207/320/260/320/263/320/2602025_001.jpeg +0 -0
  216. chgksuite-0.27.0//320/235/320/276/321/207/321/214/320/241/320/276/320/263/321/200/320/265/320/262/320/260/321/216/321/211/320/265/320/263/320/276/320/236/321/207/320/260/320/263/320/2602025_with_stats1.4s +373 -0
  217. chgksuite-0.27.0//320/235/320/276/321/207/321/214/320/241/320/276/320/263/321/200/320/265/320/262/320/260/321/216/321/211/320/265/320/263/320/276/320/236/321/207/320/260/320/263/320/2602025_with_stats1.dbg +562 -0
  218. chgksuite-0.27.0//320/235/320/276/321/207/321/214/320/241/320/276/320/263/321/200/320/265/320/262/320/260/321/216/321/211/320/265/320/263/320/276/320/236/321/207/320/260/320/263/320/2602025_with_stats1.docx +0 -0
  219. chgksuite-0.27.0//321/216 +0 -0
  220. chgksuite-0.26.0b11/PKG-INFO +0 -47
  221. chgksuite-0.26.0b11/chgksuite/composer/docx.py +0 -475
  222. chgksuite-0.26.0b11/chgksuite/composer/telegram_parser.py +0 -230
  223. chgksuite-0.26.0b11/chgksuite/handouter/runner.py +0 -234
  224. chgksuite-0.26.0b11/chgksuite/version.py +0 -1
  225. chgksuite-0.26.0b11/chgksuite.egg-info/SOURCES.txt +0 -64
  226. chgksuite-0.26.0b11/chgksuite.egg-info/dependency_links.txt +0 -1
  227. chgksuite-0.26.0b11/chgksuite.egg-info/entry_points.txt +0 -2
  228. chgksuite-0.26.0b11/chgksuite.egg-info/requires.txt +0 -18
  229. chgksuite-0.26.0b11/chgksuite.egg-info/top_level.txt +0 -1
  230. chgksuite-0.26.0b11/setup.cfg +0 -4
  231. chgksuite-0.26.0b11/setup.py +0 -66
  232. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/LICENSE +0 -0
  233. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/MANIFEST.in +0 -0
  234. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/README.md +0 -0
  235. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/__init__.py +0 -0
  236. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/__main__.py +0 -0
  237. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/stats.py +0 -0
  238. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/composer/telegram_bot.py +0 -0
  239. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/handouter/__init__.py +0 -0
  240. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/handouter/installer.py +0 -0
  241. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/handouter/pack.py +0 -0
  242. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/cheader.tex +0 -0
  243. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/fix-unnumbered-sections.sty +0 -0
  244. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/pptx_config.toml +0 -0
  245. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/template.docx +0 -0
  246. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/template.pptx +0 -0
  247. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/resources/trello.json +0 -0
  248. {chgksuite-0.26.0b11 → chgksuite-0.27.0}/chgksuite/vulture_whitelist.py +0 -0
@@ -0,0 +1,291 @@
1
+ name: Build Standalone Executables
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: 'Tag to build and release (e.g., v0.26.1). Leave empty for build-only.'
11
+ required: false
12
+ default: ''
13
+
14
+ jobs:
15
+ build:
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ include:
20
+ - os: ubuntu-24.04
21
+ platform: linux-x64
22
+ rust_target: x86_64-unknown-linux-gnu
23
+ - os: ubuntu-24.04-arm
24
+ platform: linux-arm64
25
+ rust_target: aarch64-unknown-linux-gnu
26
+ - os: macos-15-intel
27
+ platform: macos-x64
28
+ rust_target: x86_64-apple-darwin
29
+ - os: macos-latest
30
+ platform: macos-arm64
31
+ rust_target: aarch64-apple-darwin
32
+ - os: windows-latest
33
+ platform: windows-x64
34
+ rust_target: x86_64-pc-windows-msvc
35
+
36
+ runs-on: ${{ matrix.os }}
37
+
38
+ steps:
39
+ - name: Checkout chgksuite
40
+ uses: actions/checkout@v4
41
+
42
+ - name: Checkout pyapp
43
+ uses: actions/checkout@v4
44
+ with:
45
+ repository: ofek/pyapp
46
+ path: pyapp
47
+ ref: v0.29.0
48
+
49
+ - name: Install Rust
50
+ uses: dtolnay/rust-toolchain@stable
51
+ with:
52
+ targets: ${{ matrix.rust_target }}
53
+
54
+ - name: Create build directory
55
+ shell: bash
56
+ run: mkdir -p artifacts
57
+
58
+ # Determine versions and create requirements files
59
+ - name: Setup build configuration
60
+ id: config
61
+ shell: bash
62
+ run: |
63
+ TAG="${{ inputs.tag || github.ref_name }}"
64
+
65
+ # Check if this is a release build (tag) or dev build (branch)
66
+ IS_RELEASE="false"
67
+ if [[ "${{ github.ref }}" == refs/tags/* ]] || [[ -n "${{ inputs.tag }}" ]]; then
68
+ IS_RELEASE="true"
69
+ fi
70
+
71
+ # Extract version from tag (remove 'v' prefix if present)
72
+ if [[ "$TAG" =~ ^v ]]; then
73
+ VERSION="${TAG:1}"
74
+ else
75
+ VERSION="$TAG"
76
+ fi
77
+
78
+ # Fallback to reading from version.py if no tag
79
+ if [ -z "$VERSION" ] || [[ ! "$VERSION" =~ ^[0-9] ]]; then
80
+ VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]+' chgksuite/version.py 2>/dev/null || \
81
+ grep -o '__version__\s*=\s*"[^"]*"' chgksuite/version.py | cut -d'"' -f2 || \
82
+ echo "0.0.0")
83
+ fi
84
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
85
+ echo "is_release=$IS_RELEASE" >> $GITHUB_OUTPUT
86
+
87
+ # For non-release builds, always use --pre to get latest beta versions
88
+ if [ "$IS_RELEASE" = "false" ]; then
89
+ PIP_PRE="--pre"
90
+ elif [[ "$VERSION" =~ (a|b|rc)[0-9]+ ]]; then
91
+ PIP_PRE="--pre"
92
+ else
93
+ PIP_PRE=""
94
+ fi
95
+ echo "pip_pre=$PIP_PRE" >> $GITHUB_OUTPUT
96
+
97
+ echo "Build configuration:"
98
+ echo " Version: $VERSION"
99
+ echo " Is release: $IS_RELEASE"
100
+ echo " Pip pre flag: $PIP_PRE"
101
+
102
+ # Create requirements files in pyapp directory to avoid Windows path issues
103
+ - name: Create requirements files
104
+ shell: bash
105
+ run: |
106
+ # Qt requirements
107
+ echo "chgksuite" > pyapp/requirements-qt.txt
108
+ echo "chgksuite-qt" >> pyapp/requirements-qt.txt
109
+
110
+ # Tk requirements
111
+ echo "chgksuite" > pyapp/requirements-tk.txt
112
+ echo "chgksuite-tk" >> pyapp/requirements-tk.txt
113
+
114
+ echo "=== Qt requirements ==="
115
+ cat pyapp/requirements-qt.txt
116
+ echo "=== Tk requirements ==="
117
+ cat pyapp/requirements-tk.txt
118
+
119
+ # Build Qt GUI (skip on linux-arm64 - no PyQt6 wheel)
120
+ - name: Build Qt GUI
121
+ if: matrix.platform != 'linux-arm64'
122
+ shell: bash
123
+ working-directory: pyapp
124
+ run: |
125
+ export PYAPP_PROJECT_NAME="chgksuite-qt"
126
+ export PYAPP_PROJECT_VERSION="${{ steps.config.outputs.version }}"
127
+ export PYAPP_PROJECT_DEPENDENCY_FILE="$(pwd)/requirements-qt.txt"
128
+ export PYAPP_EXEC_SPEC="chgksuite_qt.__main__:main"
129
+ export PYAPP_PYTHON_VERSION="3.12"
130
+ export PYAPP_IS_GUI="1"
131
+ export PYAPP_UV_ENABLED="1"
132
+ export PYAPP_PIP_EXTRA_ARGS="${{ steps.config.outputs.pip_pre }}"
133
+
134
+ echo "Building Qt GUI with:"
135
+ echo " PYAPP_PROJECT_DEPENDENCY_FILE=$PYAPP_PROJECT_DEPENDENCY_FILE"
136
+ echo " PYAPP_PIP_EXTRA_ARGS=$PYAPP_PIP_EXTRA_ARGS"
137
+
138
+ cargo build --release --target ${{ matrix.rust_target }}
139
+
140
+ # Copy binary with platform-specific naming
141
+ if [ "${{ runner.os }}" = "Windows" ]; then
142
+ cp target/${{ matrix.rust_target }}/release/pyapp.exe ../artifacts/chgkq-${{ matrix.platform }}.exe
143
+ else
144
+ cp target/${{ matrix.rust_target }}/release/pyapp ../artifacts/chgkq-${{ matrix.platform }}
145
+ fi
146
+
147
+ # Build Tk GUI
148
+ - name: Build Tk GUI
149
+ shell: bash
150
+ working-directory: pyapp
151
+ run: |
152
+ export PYAPP_PROJECT_NAME="chgksuite-tk"
153
+ export PYAPP_PROJECT_VERSION="${{ steps.config.outputs.version }}"
154
+ export PYAPP_PROJECT_DEPENDENCY_FILE="$(pwd)/requirements-tk.txt"
155
+ export PYAPP_EXEC_SPEC="chgksuite_tk.__main__:main"
156
+ export PYAPP_PYTHON_VERSION="3.12"
157
+ export PYAPP_IS_GUI="1"
158
+ export PYAPP_UV_ENABLED="1"
159
+ export PYAPP_PIP_EXTRA_ARGS="${{ steps.config.outputs.pip_pre }}"
160
+
161
+ echo "Building Tk GUI with:"
162
+ echo " PYAPP_PROJECT_DEPENDENCY_FILE=$PYAPP_PROJECT_DEPENDENCY_FILE"
163
+ echo " PYAPP_PIP_EXTRA_ARGS=$PYAPP_PIP_EXTRA_ARGS"
164
+
165
+ cargo build --release --target ${{ matrix.rust_target }}
166
+
167
+ # Copy binary with platform-specific naming
168
+ if [ "${{ runner.os }}" = "Windows" ]; then
169
+ cp target/${{ matrix.rust_target }}/release/pyapp.exe ../artifacts/chgkt-${{ matrix.platform }}.exe
170
+ else
171
+ cp target/${{ matrix.rust_target }}/release/pyapp ../artifacts/chgkt-${{ matrix.platform }}
172
+ fi
173
+
174
+ # Create macOS .app bundles (required for Finder launch)
175
+ - name: Create macOS app bundles
176
+ if: runner.os == 'macOS'
177
+ shell: bash
178
+ run: |
179
+ # Create Qt .app bundle
180
+ if [ -f "artifacts/chgkq-${{ matrix.platform }}" ]; then
181
+ mkdir -p "artifacts/chgkq.app/Contents/MacOS"
182
+ mv "artifacts/chgkq-${{ matrix.platform }}" "artifacts/chgkq.app/Contents/MacOS/chgkq"
183
+ cat > "artifacts/chgkq.app/Contents/Info.plist" << 'EOF'
184
+ <?xml version="1.0" encoding="UTF-8"?>
185
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
186
+ <plist version="1.0">
187
+ <dict>
188
+ <key>CFBundleExecutable</key>
189
+ <string>chgkq</string>
190
+ <key>CFBundleIdentifier</key>
191
+ <string>me.pecheny.chgkq</string>
192
+ <key>CFBundleName</key>
193
+ <string>chgksuite-qt</string>
194
+ <key>CFBundlePackageType</key>
195
+ <string>APPL</string>
196
+ <key>CFBundleVersion</key>
197
+ <string>${{ steps.config.outputs.version }}</string>
198
+ <key>CFBundleShortVersionString</key>
199
+ <string>${{ steps.config.outputs.version }}</string>
200
+ <key>LSMinimumSystemVersion</key>
201
+ <string>10.15</string>
202
+ <key>NSHighResolutionCapable</key>
203
+ <true/>
204
+ <key>LSEnvironment</key>
205
+ <dict>
206
+ <key>PYAPP</key>
207
+ <string>1</string>
208
+ </dict>
209
+ </dict>
210
+ </plist>
211
+ EOF
212
+ # Ad-hoc sign the app bundle to prevent "damaged" error
213
+ codesign --force --deep --sign - "artifacts/chgkq.app"
214
+ # Zip the .app bundle
215
+ cd artifacts && zip -r "chgkq-${{ matrix.platform }}.zip" chgkq.app && rm -rf chgkq.app && cd ..
216
+ fi
217
+
218
+ # Create Tk .app bundle
219
+ if [ -f "artifacts/chgkt-${{ matrix.platform }}" ]; then
220
+ mkdir -p "artifacts/chgkt.app/Contents/MacOS"
221
+ mv "artifacts/chgkt-${{ matrix.platform }}" "artifacts/chgkt.app/Contents/MacOS/chgkt"
222
+ cat > "artifacts/chgkt.app/Contents/Info.plist" << 'EOF'
223
+ <?xml version="1.0" encoding="UTF-8"?>
224
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
225
+ <plist version="1.0">
226
+ <dict>
227
+ <key>CFBundleExecutable</key>
228
+ <string>chgkt</string>
229
+ <key>CFBundleIdentifier</key>
230
+ <string>me.pecheny.chgkt</string>
231
+ <key>CFBundleName</key>
232
+ <string>chgksuite-tk</string>
233
+ <key>CFBundlePackageType</key>
234
+ <string>APPL</string>
235
+ <key>CFBundleVersion</key>
236
+ <string>${{ steps.config.outputs.version }}</string>
237
+ <key>CFBundleShortVersionString</key>
238
+ <string>${{ steps.config.outputs.version }}</string>
239
+ <key>LSMinimumSystemVersion</key>
240
+ <string>10.15</string>
241
+ <key>NSHighResolutionCapable</key>
242
+ <true/>
243
+ <key>LSEnvironment</key>
244
+ <dict>
245
+ <key>PYAPP</key>
246
+ <string>1</string>
247
+ </dict>
248
+ </dict>
249
+ </plist>
250
+ EOF
251
+ # Ad-hoc sign the app bundle to prevent "damaged" error
252
+ codesign --force --deep --sign - "artifacts/chgkt.app"
253
+ # Zip the .app bundle
254
+ cd artifacts && zip -r "chgkt-${{ matrix.platform }}.zip" chgkt.app && rm -rf chgkt.app && cd ..
255
+ fi
256
+
257
+ - name: List artifacts
258
+ shell: bash
259
+ run: ls -lh artifacts/
260
+
261
+ - name: Upload artifacts
262
+ uses: actions/upload-artifact@v4
263
+ with:
264
+ name: builds-${{ matrix.platform }}
265
+ path: artifacts/*
266
+
267
+ release:
268
+ needs: build
269
+ runs-on: ubuntu-latest
270
+ if: startsWith(github.ref, 'refs/tags/') || inputs.tag != ''
271
+ permissions:
272
+ contents: write
273
+
274
+ steps:
275
+ - name: Download all artifacts
276
+ uses: actions/download-artifact@v4
277
+ with:
278
+ path: artifacts
279
+ merge-multiple: true
280
+
281
+ - name: List artifacts
282
+ run: ls -la artifacts/
283
+
284
+ - name: Create Release
285
+ uses: softprops/action-gh-release@v1
286
+ with:
287
+ tag_name: ${{ inputs.tag || github.ref_name }}
288
+ files: artifacts/*
289
+ generate_release_notes: true
290
+ env:
291
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,10 @@
1
+ build
2
+ build_specs
3
+ docs/public
4
+ __pycache__
5
+ dist
6
+ *.egg-info
7
+ *.log
8
+ *.debug
9
+ tmp*
10
+ tests_password.txt
@@ -0,0 +1,17 @@
1
+ image: python:3.14-trixie
2
+
3
+ before_script:
4
+ - pip install zensical
5
+
6
+ pages:
7
+ stage: deploy
8
+ script:
9
+ - cd docs
10
+ - zensical build
11
+ - mv public ../public
12
+ - cd ..
13
+ artifacts:
14
+ paths:
15
+ - public
16
+ rules:
17
+ - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
@@ -0,0 +1,2 @@
1
+ __pycache__
2
+ .trello_token
@@ -0,0 +1 @@
1
+ ,pecheny,pecheny-CQ5TXQ57J0,20.04.2025 22:07,file:///Users/pecheny/Library/Application%20Support/LibreOffice/4;
@@ -1,23 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chgksuite
3
- Version: 0.26.0b11
3
+ Version: 0.27.0
4
4
  Summary: A package for chgk automation
5
- Home-page: https://gitlab.com/peczony/chgksuite
6
- Author: Alexander Pecheny
7
- Author-email: ap@pecheny.me
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Description-Content-Type: text/markdown
5
+ Project-URL: Homepage, https://gitlab.com/peczony/chgksuite
6
+ Author-email: Alexander Pecheny <ap@pecheny.me>
7
+ License-Expression: MIT
12
8
  License-File: LICENSE
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.9
13
12
  Requires-Dist: beautifulsoup4
14
13
  Requires-Dist: chardet
15
- Requires-Dist: dashtable
16
14
  Requires-Dist: dateparser
17
15
  Requires-Dist: mammoth
18
16
  Requires-Dist: openpyxl
19
17
  Requires-Dist: parse
20
- Requires-Dist: Pillow
18
+ Requires-Dist: pillow
21
19
  Requires-Dist: ply
22
20
  Requires-Dist: pypandoc
23
21
  Requires-Dist: pypdf
@@ -27,16 +25,9 @@ Requires-Dist: python-pptx
27
25
  Requires-Dist: python-telegram-bot
28
26
  Requires-Dist: requests
29
27
  Requires-Dist: toml
28
+ Requires-Dist: urllib3>=2.6.2
30
29
  Requires-Dist: watchdog
31
- Dynamic: author
32
- Dynamic: author-email
33
- Dynamic: classifier
34
- Dynamic: description
35
- Dynamic: description-content-type
36
- Dynamic: home-page
37
- Dynamic: license-file
38
- Dynamic: requires-dist
39
- Dynamic: summary
30
+ Description-Content-Type: text/markdown
40
31
 
41
32
  **chgksuite** is an utility that helps chgk editors.
42
33
 
@@ -0,0 +1,66 @@
1
+ import os
2
+ import json
3
+ import re
4
+
5
+
6
+ def process_json_files(directory):
7
+ # Pattern to match filenames starting with "regexes_" and ending with ".json"
8
+ pattern = re.compile(r"^regexes_.*\.json$")
9
+
10
+ # Count for reporting
11
+ processed_files = 0
12
+
13
+ # Walk through the directory
14
+ for root, _, files in os.walk(directory):
15
+ for filename in files:
16
+ # Check if the filename matches our pattern
17
+ if pattern.match(filename):
18
+ filepath = os.path.join(root, filename)
19
+ print(f"Processing file: {filepath}")
20
+
21
+ try:
22
+ # Load the JSON content
23
+ with open(filepath, "r", encoding="utf-8") as file:
24
+ data = json.load(file)
25
+
26
+ # Make sure it's a dictionary
27
+ if not isinstance(data, dict):
28
+ print(
29
+ f" Warning: {filepath} does not contain a dictionary. Skipping."
30
+ )
31
+ continue
32
+
33
+ # Replace spaces with '\s' in all values
34
+ modified = False
35
+ for key, value in data.items():
36
+ if isinstance(value, str) and " " in value:
37
+ data[key] = value.replace(" ", "\\s")
38
+ modified = True
39
+
40
+ # Save the modified content only if changes were made
41
+ if modified:
42
+ with open(filepath, "w", encoding="utf-8") as file:
43
+ json.dump(data, file, ensure_ascii=False, indent=4)
44
+ print(f" Updated {filepath}")
45
+ else:
46
+ print(f" No spaces found in values of {filepath}")
47
+
48
+ processed_files += 1
49
+
50
+ except json.JSONDecodeError:
51
+ print(f" Error: {filepath} is not a valid JSON file. Skipping.")
52
+ except Exception as e:
53
+ print(f" Error processing {filepath}: {str(e)}")
54
+
55
+ print(f"\nSummary: Processed {processed_files} JSON files.")
56
+
57
+
58
+ if __name__ == "__main__":
59
+ # Get the directory from user
60
+ directory = input("Enter the directory path to search: ")
61
+
62
+ # Validate directory exists
63
+ if not os.path.isdir(directory):
64
+ print(f"Error: '{directory}' is not a valid directory.")
65
+ else:
66
+ process_json_files(directory)
@@ -0,0 +1,24 @@
1
+ #!usr/bin/env python
2
+ #! -*- coding: utf-8 -*-
3
+ import argparse
4
+ from collections import Counter
5
+
6
+ from chgksuite.composer import parse_4s
7
+
8
+ parser = argparse.ArgumentParser()
9
+ parser.add_argument("filename")
10
+ args = parser.parse_args()
11
+
12
+ authors = Counter()
13
+
14
+ with open(args.filename, "r", encoding="utf-8") as f:
15
+ structure = parse_4s(f.read().replace("\r", ""))
16
+
17
+ for element in structure:
18
+ if element[0] == "Question":
19
+ if "author" in element[1]:
20
+ authors[element[1]["author"].replace("`", "")] += 1
21
+
22
+ for au in authors.most_common():
23
+ print("{}\t{}".format(au[0], au[1]))
24
+ print("Total: {}".format(sum(authors.values())))
@@ -0,0 +1,90 @@
1
+ """Simple HTML table to Markdown converter.
2
+
3
+ Replaces dashtable.html2md with a minimal implementation that avoids
4
+ deprecated BeautifulSoup methods.
5
+ """
6
+
7
+ from bs4 import BeautifulSoup
8
+
9
+
10
+ def html2md(html_string: str) -> str:
11
+ """Convert an HTML table to a Markdown table string.
12
+
13
+ Parameters
14
+ ----------
15
+ html_string : str
16
+ HTML string containing a table
17
+
18
+ Returns
19
+ -------
20
+ str
21
+ The table formatted as Markdown
22
+ """
23
+ soup = BeautifulSoup(html_string, "html.parser")
24
+ table = soup.find("table")
25
+
26
+ if not table:
27
+ return ""
28
+
29
+ rows = table.find_all("tr")
30
+ if not rows:
31
+ return ""
32
+
33
+ # Extract all rows as lists of cell texts
34
+ data = []
35
+ for row in rows:
36
+ # Check for header cells first, then data cells
37
+ cells = row.find_all("th")
38
+ if not cells:
39
+ cells = row.find_all("td")
40
+
41
+ row_data = []
42
+ for cell in cells:
43
+ # Get text, normalize whitespace
44
+ text = " ".join(cell.get_text().split())
45
+ row_data.append(text)
46
+ if row_data:
47
+ data.append(row_data)
48
+
49
+ if not data:
50
+ return ""
51
+
52
+ # Normalize row lengths (pad shorter rows)
53
+ max_cols = max(len(row) for row in data)
54
+ for row in data:
55
+ while len(row) < max_cols:
56
+ row.append("")
57
+
58
+ # Calculate column widths (minimum 3 for markdown separator)
59
+ # Add 2 for space cushions on each side
60
+ widths = []
61
+ for col in range(max_cols):
62
+ width = max(len(row[col]) for row in data)
63
+ widths.append(max(width + 2, 3))
64
+
65
+ # Build markdown table
66
+ lines = []
67
+
68
+ # Header row (centered, with padding)
69
+ header = "|" + "|".join(_center(cell, widths[i]) for i, cell in enumerate(data[0])) + "|"
70
+ lines.append(header)
71
+
72
+ # Separator row (no spaces to avoid typotools converting --- to em-dash)
73
+ separator = "|" + "|".join("-" * w for w in widths) + "|"
74
+ lines.append(separator)
75
+
76
+ # Data rows (centered, with padding)
77
+ for row in data[1:]:
78
+ line = "|" + "|".join(_center(cell, widths[i]) for i, cell in enumerate(row)) + "|"
79
+ lines.append(line)
80
+
81
+ return "\n".join(lines)
82
+
83
+
84
+ def _center(text: str, width: int) -> str:
85
+ """Center text within width, with space padding."""
86
+ text = text.strip()
87
+ padding = width - len(text)
88
+ left = padding // 2
89
+ right = padding - left
90
+ return " " * left + text + " " * right
@@ -13,12 +13,14 @@ from chgksuite.common import (
13
13
  )
14
14
  from chgksuite.composer import gui_compose
15
15
  from chgksuite.handouter.runner import gui_handouter
16
- from chgksuite.handouter.tex_internals import GREYTEXT_LANGS
17
16
  from chgksuite.parser import gui_parse
18
17
  from chgksuite.trello import gui_trello
19
18
  from chgksuite.version import __version__
20
19
 
21
- LANGS = ["by", "by_tar", "en", "kz_cyr", "ru", "sr", "ua", "uz", "uz_cyr"] + ["custom"]
20
+ LANGS = ["az", "by", "by_tar", "en", "kz_cyr", "ru", "sr", "ua", "uz", "uz_cyr"] + [
21
+ "custom"
22
+ ]
23
+ HANDOUT_LANGS = [lang for lang in LANGS if lang != "custom"]
22
24
 
23
25
  debug = False
24
26
 
@@ -277,6 +279,14 @@ class ArgparseBuilder:
277
279
  advanced=True,
278
280
  argtype="radiobutton",
279
281
  )
282
+ self.add_argument(
283
+ cmdparse,
284
+ "--download_images",
285
+ action="store_true",
286
+ help="download images from direct URLs and replace with local references",
287
+ caption="Скачивать изображения по прямым ссылкам",
288
+ advanced=True,
289
+ )
280
290
  self.add_argument(
281
291
  cmdparse,
282
292
  "--add_ts",
@@ -436,6 +446,15 @@ class ArgparseBuilder:
436
446
  advanced=True,
437
447
  caption='Без переноса строки после "Вопрос N."',
438
448
  )
449
+
450
+ self.add_argument(
451
+ cmdcompose_docx,
452
+ "--only_question_number",
453
+ action="store_true",
454
+ help="only show question number",
455
+ advanced=True,
456
+ caption='Без слова "Вопрос" в "Вопрос N."',
457
+ )
439
458
  self.add_argument(
440
459
  cmdcompose_docx,
441
460
  "--randomize",
@@ -577,6 +596,15 @@ class ArgparseBuilder:
577
596
  caption="Имя 4s-файла",
578
597
  filetypes=[("chgksuite markup files", "*.4s")],
579
598
  )
599
+ cmdcompose_markdown = cmdcompose_filetype.add_parser("markdown")
600
+ self.add_argument(
601
+ cmdcompose_markdown,
602
+ "filename",
603
+ nargs="*",
604
+ help="file(s) to compose from.",
605
+ caption="Имя 4s-файла",
606
+ filetypes=[("chgksuite markup files", "*.4s")],
607
+ )
580
608
  cmdcompose_pptx = cmdcompose_filetype.add_parser("pptx")
581
609
  self.add_argument(
582
610
  cmdcompose_pptx,
@@ -872,10 +900,11 @@ class ArgparseBuilder:
872
900
  )
873
901
  self.add_argument(
874
902
  cmdhandouts_run,
875
- "--lang",
903
+ "--language",
904
+ "-lang",
876
905
  default="ru",
877
906
  argtype="radiobutton",
878
- choices=sorted(GREYTEXT_LANGS.keys()),
907
+ choices=sorted(HANDOUT_LANGS),
879
908
  help="language",
880
909
  caption="Язык",
881
910
  advanced=True,
@@ -995,12 +1024,13 @@ class ArgparseBuilder:
995
1024
  )
996
1025
  self.add_argument(
997
1026
  cmdhandouts_generate,
998
- "--lang",
1027
+ "--language",
1028
+ "-lang",
999
1029
  default="ru",
1000
1030
  help="language",
1001
1031
  caption="Язык",
1002
1032
  argtype="radiobutton",
1003
- choices=sorted(GREYTEXT_LANGS.keys()),
1033
+ choices=sorted(HANDOUT_LANGS),
1004
1034
  advanced=True,
1005
1035
  )
1006
1036
  self.add_argument(
@@ -1067,9 +1097,9 @@ def single_action(args, use_wrapper, resourcedir):
1067
1097
  args.console_mode = True
1068
1098
 
1069
1099
  if args.language in LANGS:
1100
+ args.regexes_file = os.path.join(resourcedir, f"regexes_{args.language}.json")
1070
1101
  if args.action == "parse":
1071
- regex_lang = "by" if args.language == "by_tar" else args.language
1072
- args.regexes = os.path.join(resourcedir, f"regexes_{regex_lang}.json")
1102
+ args.regexes = args.regexes_file
1073
1103
  args.labels_file = os.path.join(resourcedir, f"labels_{args.language}.toml")
1074
1104
  if not args.docx_template:
1075
1105
  args.docx_template = os.path.join(resourcedir, "template.docx")