dasha-framework 0.0.1__tar.gz → 0.0.2__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 (211) hide show
  1. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/PKG-INFO +35 -15
  2. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/README.md +32 -13
  3. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/pyproject.toml +7 -1
  4. dasha_framework-0.0.2/src/dasha/__init__.py +10 -0
  5. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/__main__.py +96 -89
  6. dasha_framework-0.0.2/src/dasha/animation.py +86 -0
  7. dasha_framework-0.0.2/src/dasha/application.py +205 -0
  8. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/border.py +1 -1
  9. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/canvas.py +85 -83
  10. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/client.py +143 -81
  11. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/clipboard.py +16 -30
  12. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/config.py +9 -21
  13. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/desktop.py +21 -23
  14. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/dialog.py +182 -122
  15. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/events.py +79 -108
  16. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/filedialog.py +52 -74
  17. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/help.py +155 -110
  18. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/index.md +1 -1
  19. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/menus.md +4 -2
  20. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/settings.md +2 -0
  21. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/windows.md +1 -1
  22. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/host.py +21 -25
  23. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/hosting.py +209 -194
  24. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/inbox.py +15 -43
  25. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/install.py +61 -41
  26. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/keytest.py +9 -11
  27. dasha_framework-0.0.2/src/dasha/logs.py +94 -0
  28. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/manager.py +431 -550
  29. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/markdown.py +196 -97
  30. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/menu.py +292 -177
  31. dasha_framework-0.0.2/src/dasha/printing.py +33 -0
  32. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/processes.py +39 -42
  33. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/protocol.py +168 -91
  34. dasha_framework-0.0.2/src/dasha/pseudoterminal/__init__.py +27 -0
  35. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/pseudoterminal/_posix.py +6 -6
  36. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/pseudoterminal/_windows.py +7 -11
  37. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/pseudoterminal/base.py +45 -37
  38. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/recovery.py +46 -82
  39. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/registry.py +128 -111
  40. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/remote.py +109 -60
  41. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/rundialog.py +42 -65
  42. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/scrollbar.py +62 -61
  43. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/__init__.py +41 -44
  44. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/appearance.py +30 -29
  45. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/applications.py +7 -15
  46. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/colours.py +10 -8
  47. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/keys.py +25 -24
  48. dasha_framework-0.0.2/src/dasha/settings/lists.py +11 -0
  49. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/shell.py +11 -34
  50. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/shortcuts.py +67 -78
  51. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/statusbar.py +40 -33
  52. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/style.py +31 -60
  53. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/__init__.py +24 -60
  54. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/_posix.py +4 -15
  55. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/_winbuffer.py +33 -26
  56. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/_windows.py +18 -52
  57. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/ansi.py +7 -6
  58. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/theme.py +134 -113
  59. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/vt.py +150 -132
  60. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/__init__.py +1 -11
  61. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/autocomplete.py +29 -48
  62. dasha_framework-0.0.2/src/dasha/widgets/base.py +284 -0
  63. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/button.py +57 -58
  64. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/checkbox.py +7 -11
  65. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/cluster.py +83 -101
  66. dasha_framework-0.0.2/src/dasha/widgets/collapsible.py +171 -0
  67. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/combobox.py +37 -44
  68. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/container.py +40 -53
  69. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/editing.py +40 -35
  70. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/groupbox.py +11 -29
  71. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/label.py +30 -16
  72. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/listbox.py +110 -129
  73. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/paragraph.py +49 -48
  74. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/password.py +7 -12
  75. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/progressbar.py +30 -73
  76. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/radiobutton.py +8 -11
  77. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/scrollbar.py +40 -35
  78. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/slider.py +43 -43
  79. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/spinbox.py +55 -59
  80. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/splitter.py +47 -66
  81. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/switch.py +38 -49
  82. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/table.py +76 -82
  83. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/tabs.py +149 -77
  84. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/terminalview.py +99 -89
  85. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/textarea.py +194 -210
  86. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/textbox.py +99 -174
  87. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/tree.py +75 -103
  88. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/window.py +233 -254
  89. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/windowmenu.py +19 -12
  90. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/PKG-INFO +35 -15
  91. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/SOURCES.txt +7 -0
  92. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_alignment.py +12 -9
  93. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_animation.py +30 -32
  94. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_application.py +28 -18
  95. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_atomic_writes.py +8 -15
  96. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_autocomplete.py +13 -11
  97. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_canvas.py +1 -3
  98. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_client.py +24 -20
  99. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_clipboard.py +19 -15
  100. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_clusters.py +28 -27
  101. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_collapsible.py +15 -20
  102. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_combobox.py +16 -7
  103. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_command_line.py +20 -31
  104. dasha_framework-0.0.2/tests/test_command_line_problems.py +96 -0
  105. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_command_prompt.py +33 -31
  106. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_container.py +8 -10
  107. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_context_menu.py +57 -37
  108. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_crash_restore.py +16 -18
  109. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_desktop.py +9 -5
  110. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_dialog.py +19 -12
  111. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_editing.py +18 -23
  112. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_escape_injection.py +21 -23
  113. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_escape_timeout.py +2 -5
  114. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_events.py +20 -25
  115. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_filedialog.py +17 -8
  116. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_footer.py +15 -17
  117. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_frozen.py +5 -13
  118. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_fuzz.py +38 -34
  119. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_groupbox.py +3 -5
  120. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_grow.py +2 -3
  121. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_help.py +62 -23
  122. dasha_framework-0.0.2/tests/test_hosted_windows.py +254 -0
  123. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_hosting.py +67 -69
  124. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_inbox.py +15 -23
  125. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_inert_menus.py +14 -6
  126. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_install.py +135 -27
  127. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_key_hints.py +8 -8
  128. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_key_release.py +4 -7
  129. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_keyboard_adjust.py +14 -21
  130. dasha_framework-0.0.2/tests/test_keytest.py +74 -0
  131. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_large_text.py +15 -17
  132. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_line_numbers.py +19 -17
  133. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_listbox.py +38 -32
  134. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_loading.py +54 -54
  135. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_manager.py +54 -22
  136. dasha_framework-0.0.2/tests/test_manager_edges.py +241 -0
  137. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_markdown.py +20 -8
  138. dasha_framework-0.0.2/tests/test_markdown_edges.py +113 -0
  139. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_menu.py +148 -18
  140. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_package.py +2 -5
  141. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_paragraph.py +9 -3
  142. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_password.py +1 -2
  143. dasha_framework-0.0.2/tests/test_popups.py +172 -0
  144. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_processes.py +27 -17
  145. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_progressbar.py +7 -6
  146. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_pseudoterminal.py +19 -12
  147. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_recovery.py +29 -37
  148. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_registry.py +6 -3
  149. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_repeat_and_clicks.py +19 -6
  150. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_resize.py +31 -7
  151. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_rgb.py +13 -15
  152. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_robustness.py +27 -19
  153. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_rundialog.py +22 -25
  154. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_scroll.py +32 -17
  155. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_security.py +87 -52
  156. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_settings.py +331 -44
  157. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_shadow.py +4 -1
  158. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_shell.py +8 -11
  159. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_shortcuts.py +9 -4
  160. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_show_mouse.py +13 -12
  161. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_slider.py +11 -4
  162. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_spinbox.py +15 -11
  163. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_splitter.py +23 -22
  164. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_statusbar.py +26 -26
  165. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_submenus.py +27 -24
  166. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_switch.py +13 -12
  167. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_table.py +23 -11
  168. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_tabs.py +53 -8
  169. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_terminal.py +9 -13
  170. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_terminalview.py +162 -40
  171. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_textarea.py +39 -31
  172. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_textbox.py +43 -36
  173. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_theme.py +42 -12
  174. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_theme_switching.py +209 -29
  175. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_titles_and_system_menu.py +10 -3
  176. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_tree.py +29 -36
  177. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_tutorial.py +12 -15
  178. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_vt.py +15 -15
  179. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_vt_keys.py +4 -8
  180. dasha_framework-0.0.2/tests/test_vt_sequences.py +475 -0
  181. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_waiting_dialogs.py +17 -13
  182. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_wake.py +36 -19
  183. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_widget_edge_cases.py +38 -41
  184. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_widgets.py +23 -7
  185. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_winbuffer.py +17 -14
  186. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_window_colours.py +12 -11
  187. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_window_states.py +18 -23
  188. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_windowmenu.py +11 -4
  189. dasha_framework-0.0.2/tests/test_windows_console.py +331 -0
  190. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_word_wrap.py +25 -23
  191. dasha_framework-0.0.1/src/dasha/__init__.py +0 -9
  192. dasha_framework-0.0.1/src/dasha/animation.py +0 -90
  193. dasha_framework-0.0.1/src/dasha/application.py +0 -276
  194. dasha_framework-0.0.1/src/dasha/logs.py +0 -104
  195. dasha_framework-0.0.1/src/dasha/printing.py +0 -42
  196. dasha_framework-0.0.1/src/dasha/pseudoterminal/__init__.py +0 -43
  197. dasha_framework-0.0.1/src/dasha/settings/lists.py +0 -11
  198. dasha_framework-0.0.1/src/dasha/widgets/base.py +0 -298
  199. dasha_framework-0.0.1/src/dasha/widgets/collapsible.py +0 -224
  200. dasha_framework-0.0.1/tests/test_windows_console.py +0 -174
  201. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/LICENSE +0 -0
  202. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/setup.cfg +0 -0
  203. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/applications.md +0 -0
  204. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/keyboard.md +0 -0
  205. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/running.md +0 -0
  206. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/py.typed +0 -0
  207. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/dependency_links.txt +0 -0
  208. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/entry_points.txt +0 -0
  209. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/requires.txt +0 -0
  210. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/top_level.txt +0 -0
  211. {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_window.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dasha-framework
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Dasha Framework: a dependency-free text-mode desktop and application framework for local and SSH terminals.
5
5
  Author: Dasha Sierra
6
6
  License-Expression: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/dashasierra/dasha-framework
8
- Project-URL: Documentation, https://dasha.readthedocs.io/
8
+ Project-URL: Documentation, https://dasha-framework.readthedocs.io/
9
9
  Project-URL: Source, https://github.com/dashasierra/dasha-framework
10
10
  Project-URL: Issues, https://github.com/dashasierra/dasha-framework/issues
11
11
  Project-URL: Changelog, https://github.com/dashasierra/dasha-framework/blob/HEAD/CHANGELOG.md
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
23
  Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Programming Language :: Python :: 3.15
24
25
  Classifier: Topic :: Terminals
25
26
  Classifier: Topic :: Software Development :: User Interfaces
26
27
  Classifier: Typing :: Typed
@@ -62,7 +63,7 @@ terminal directly.
62
63
  context menus; and a status bar showing help and clickable key hints.
63
64
  - Several applications side by side, each in its own process, so one that
64
65
  crashes or hangs affects only its own windows.
65
- - Themes (Default, Dark, Monochrome, or your own) and animations, both of
66
+ - Themes (Default, Dark, Monochrome, Vision, or your own) and animations, both of
66
67
  which can be changed while Dasha Framework is running and are remembered.
67
68
  - Settings... in the system menu changes everything that the command line
68
69
  and the settings files do: the theme and every colour, the keyboard
@@ -151,11 +152,11 @@ or, for short:
151
152
  dasha-desktop
152
153
  ```
153
154
 
154
- `dasha` on its own only says what it needs: `desktop`, or an application to
155
- run. Dasha Framework starts with an empty desktop. The Applications submenu of the
155
+ Run on its own, `dasha` only shows its usage: it needs `desktop`, or an
156
+ application to run. The desktop starts empty. The Applications submenu of the
156
157
  system menu (`≡`) lists the installed applications. None come with the
157
- package, but the repository's `apps/` folder has two to try: Notepad, and a
158
- Demo of the widgets (see [apps/README.md](https://github.com/dashasierra/dasha-framework/blob/HEAD/apps/README.md)).
158
+ package, but the repository's `apps/` folder has three to try: Notepad, a
159
+ Demo of the widgets, and Terminal, which runs your shell in a window (see [apps/README.md](https://github.com/dashasierra/dasha-framework/blob/HEAD/apps/README.md)).
159
160
  Install them with:
160
161
 
161
162
  ```bash
@@ -166,6 +167,10 @@ dasha install-app apps/notepad.py
166
167
  dasha install-app apps/demo.py
167
168
  ```
168
169
 
170
+ ```bash
171
+ dasha install-app apps/terminal.py
172
+ ```
173
+
169
174
  Then start the desktop (`dasha desktop`) and choose them from the
170
175
  Applications menu, or name them to start them on it straight away:
171
176
 
@@ -183,6 +188,11 @@ dasha notepad
183
188
 
184
189
  ## Writing an application
185
190
 
191
+ > [!CAUTION]
192
+ > Do not develop an application using the `master` branch of the dasha-framework repository as it contains code not yet released and will likely change. (Consider it a development branch).
193
+ >
194
+ > Either use a [Release](https://github.com/dashasierra/dasha-framework/releases) or [Tag](https://github.com/dashasierra/dasha-framework/tags), or use the latest [dasha-framework PyPI release](https://pypi.org/project/dasha-framework/).
195
+
186
196
  An application is a class with a `start` method, which sets up its menus
187
197
  and opens its windows. It keeps running until it exits (File > Exit, here),
188
198
  not merely until its windows are closed. It can run on its own, with no
@@ -199,8 +209,17 @@ class Hello(Application):
199
209
  name = "Hello"
200
210
 
201
211
  def start(self) -> None:
202
- self.menus = [Menu("&File", [MenuItem("E&xit", self.exit)])]
203
- self.open(Window("Hello", Rect(2, 2, 6, 30), ["Hello, world"], closable=True))
212
+ self.menus = [
213
+ Menu(title="&File", items=[MenuItem(label="E&xit", action=self.exit)])
214
+ ]
215
+ self.open(
216
+ window=Window(
217
+ title="Hello",
218
+ rect=Rect(row=2, column=2, height=6, width=30),
219
+ lines=["Hello, world"],
220
+ closable=True,
221
+ )
222
+ )
204
223
 
205
224
 
206
225
  if __name__ == "__main__":
@@ -221,9 +240,9 @@ dasha install-app hello.py --create-venv --pip "nltk==3.8.1"
221
240
 
222
241
  `dasha list-apps` lists the installed applications, and `dasha
223
242
  hello` runs this one on its own, just as `python hello.py` does. For more,
224
- see [Applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/architecture.md#applications-dashaapplication)
225
- and [Installing applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/architecture.md#installing-applications-dasharegistry-dashainstall)
226
- in the architecture guide, and the example applications in `apps/`.
243
+ see [Applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/guide.md#applications-dashaapplication)
244
+ and [Installing applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/guide.md#installing-applications-dasharegistry-dashainstall)
245
+ in the developer guide, and the example applications in `apps/`.
227
246
 
228
247
  ### Command-line options
229
248
 
@@ -276,8 +295,9 @@ dasha --key-test
276
295
  ```
277
296
 
278
297
  For a terminal without colour, run `dasha desktop --monochrome`, or set
279
- `NO_COLOR`. To change the colours while Dasha Framework is running, choose a
280
- theme from the system menu's Themes: Default, Dark, Monochrome, or one of
298
+ `NO_COLOR` to keep colour out altogether (the themes cannot be changed until
299
+ it is removed). To change the colours while Dasha Framework is running, choose a
300
+ theme from the system menu's Themes: Default, Dark, Monochrome, Vision, or one of
281
301
  your own in `~/.dasha/themes/` (see [docs/colours.md](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/colours.md)).
282
302
  Menus drop down, and windows zoom as they are minimised, maximised and
283
303
  restored. To turn these animations off, or back on, choose Animations from
@@ -320,7 +340,7 @@ The built pages are written to `docs/_build/html`.
320
340
  ## Project layout
321
341
 
322
342
  ```
323
- src/dasha/ the package (src layout, so tests run against the installed code)
343
+ src/dasha/ the package (src layout, so tests run against the installed code)
324
344
  frozen/ the entry point of a PyInstaller build of dasha (dasha.spec)
325
345
  tests/ unittest test suite
326
346
  apps/ example applications and their tests (not in the package)
@@ -18,7 +18,7 @@ terminal directly.
18
18
  context menus; and a status bar showing help and clickable key hints.
19
19
  - Several applications side by side, each in its own process, so one that
20
20
  crashes or hangs affects only its own windows.
21
- - Themes (Default, Dark, Monochrome, or your own) and animations, both of
21
+ - Themes (Default, Dark, Monochrome, Vision, or your own) and animations, both of
22
22
  which can be changed while Dasha Framework is running and are remembered.
23
23
  - Settings... in the system menu changes everything that the command line
24
24
  and the settings files do: the theme and every colour, the keyboard
@@ -107,11 +107,11 @@ or, for short:
107
107
  dasha-desktop
108
108
  ```
109
109
 
110
- `dasha` on its own only says what it needs: `desktop`, or an application to
111
- run. Dasha Framework starts with an empty desktop. The Applications submenu of the
110
+ Run on its own, `dasha` only shows its usage: it needs `desktop`, or an
111
+ application to run. The desktop starts empty. The Applications submenu of the
112
112
  system menu (`≡`) lists the installed applications. None come with the
113
- package, but the repository's `apps/` folder has two to try: Notepad, and a
114
- Demo of the widgets (see [apps/README.md](https://github.com/dashasierra/dasha-framework/blob/HEAD/apps/README.md)).
113
+ package, but the repository's `apps/` folder has three to try: Notepad, a
114
+ Demo of the widgets, and Terminal, which runs your shell in a window (see [apps/README.md](https://github.com/dashasierra/dasha-framework/blob/HEAD/apps/README.md)).
115
115
  Install them with:
116
116
 
117
117
  ```bash
@@ -122,6 +122,10 @@ dasha install-app apps/notepad.py
122
122
  dasha install-app apps/demo.py
123
123
  ```
124
124
 
125
+ ```bash
126
+ dasha install-app apps/terminal.py
127
+ ```
128
+
125
129
  Then start the desktop (`dasha desktop`) and choose them from the
126
130
  Applications menu, or name them to start them on it straight away:
127
131
 
@@ -139,6 +143,11 @@ dasha notepad
139
143
 
140
144
  ## Writing an application
141
145
 
146
+ > [!CAUTION]
147
+ > Do not develop an application using the `master` branch of the dasha-framework repository as it contains code not yet released and will likely change. (Consider it a development branch).
148
+ >
149
+ > Either use a [Release](https://github.com/dashasierra/dasha-framework/releases) or [Tag](https://github.com/dashasierra/dasha-framework/tags), or use the latest [dasha-framework PyPI release](https://pypi.org/project/dasha-framework/).
150
+
142
151
  An application is a class with a `start` method, which sets up its menus
143
152
  and opens its windows. It keeps running until it exits (File > Exit, here),
144
153
  not merely until its windows are closed. It can run on its own, with no
@@ -155,8 +164,17 @@ class Hello(Application):
155
164
  name = "Hello"
156
165
 
157
166
  def start(self) -> None:
158
- self.menus = [Menu("&File", [MenuItem("E&xit", self.exit)])]
159
- self.open(Window("Hello", Rect(2, 2, 6, 30), ["Hello, world"], closable=True))
167
+ self.menus = [
168
+ Menu(title="&File", items=[MenuItem(label="E&xit", action=self.exit)])
169
+ ]
170
+ self.open(
171
+ window=Window(
172
+ title="Hello",
173
+ rect=Rect(row=2, column=2, height=6, width=30),
174
+ lines=["Hello, world"],
175
+ closable=True,
176
+ )
177
+ )
160
178
 
161
179
 
162
180
  if __name__ == "__main__":
@@ -177,9 +195,9 @@ dasha install-app hello.py --create-venv --pip "nltk==3.8.1"
177
195
 
178
196
  `dasha list-apps` lists the installed applications, and `dasha
179
197
  hello` runs this one on its own, just as `python hello.py` does. For more,
180
- see [Applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/architecture.md#applications-dashaapplication)
181
- and [Installing applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/architecture.md#installing-applications-dasharegistry-dashainstall)
182
- in the architecture guide, and the example applications in `apps/`.
198
+ see [Applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/guide.md#applications-dashaapplication)
199
+ and [Installing applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/guide.md#installing-applications-dasharegistry-dashainstall)
200
+ in the developer guide, and the example applications in `apps/`.
183
201
 
184
202
  ### Command-line options
185
203
 
@@ -232,8 +250,9 @@ dasha --key-test
232
250
  ```
233
251
 
234
252
  For a terminal without colour, run `dasha desktop --monochrome`, or set
235
- `NO_COLOR`. To change the colours while Dasha Framework is running, choose a
236
- theme from the system menu's Themes: Default, Dark, Monochrome, or one of
253
+ `NO_COLOR` to keep colour out altogether (the themes cannot be changed until
254
+ it is removed). To change the colours while Dasha Framework is running, choose a
255
+ theme from the system menu's Themes: Default, Dark, Monochrome, Vision, or one of
237
256
  your own in `~/.dasha/themes/` (see [docs/colours.md](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/colours.md)).
238
257
  Menus drop down, and windows zoom as they are minimised, maximised and
239
258
  restored. To turn these animations off, or back on, choose Animations from
@@ -276,7 +295,7 @@ The built pages are written to `docs/_build/html`.
276
295
  ## Project layout
277
296
 
278
297
  ```
279
- src/dasha/ the package (src layout, so tests run against the installed code)
298
+ src/dasha/ the package (src layout, so tests run against the installed code)
280
299
  frozen/ the entry point of a PyInstaller build of dasha (dasha.spec)
281
300
  tests/ unittest test suite
282
301
  apps/ example applications and their tests (not in the package)
@@ -36,6 +36,7 @@ classifiers = [
36
36
  "Programming Language :: Python :: 3.12",
37
37
  "Programming Language :: Python :: 3.13",
38
38
  "Programming Language :: Python :: 3.14",
39
+ "Programming Language :: Python :: 3.15",
39
40
  "Topic :: Terminals",
40
41
  "Topic :: Software Development :: User Interfaces",
41
42
  "Typing :: Typed",
@@ -43,7 +44,7 @@ classifiers = [
43
44
 
44
45
  [project.urls]
45
46
  Homepage = "https://github.com/dashasierra/dasha-framework"
46
- Documentation = "https://dasha.readthedocs.io/"
47
+ Documentation = "https://dasha-framework.readthedocs.io/"
47
48
  Source = "https://github.com/dashasierra/dasha-framework"
48
49
  Issues = "https://github.com/dashasierra/dasha-framework/issues"
49
50
  Changelog = "https://github.com/dashasierra/dasha-framework/blob/HEAD/CHANGELOG.md"
@@ -102,6 +103,11 @@ branch = true
102
103
  patch = ["subprocess"]
103
104
  parallel = true
104
105
 
106
+ [tool.coverage.paths]
107
+ # CI combines the data from Linux, macOS and Windows, each measured in a
108
+ # checkout of its own: every checkout's src/dasha is this one's.
109
+ source = ["src/dasha", "*/src/dasha", "*\\src\\dasha"]
110
+
105
111
  [tool.coverage.report]
106
112
  show_missing = true
107
113
  skip_covered = false
@@ -0,0 +1,10 @@
1
+ """Dasha Framework: a text-mode desktop and application framework."""
2
+
3
+ from pkgutil import extend_path
4
+
5
+ # Enable packages to use the dasha namespace
6
+ __path__ = extend_path(__path__, __name__)
7
+
8
+ __all__ = ["__version__"]
9
+
10
+ __version__ = "0.0.2"
@@ -1,10 +1,4 @@
1
- """Command-line entry point, used by ``python -m dasha`` and the ``dasha``
2
- and ``dasha-desktop`` scripts.
3
-
4
- ``dasha`` needs to be told what to run: ``dasha desktop`` for the desktop
5
- (with any applications named after it started on it), or applications by
6
- id (``dasha notepad``) to run on their own. ``dasha-desktop`` is ``dasha
7
- desktop``: ``dasha-desktop notepad`` starts the desktop with Notepad on it."""
1
+ """Command-line entry point."""
8
2
 
9
3
  import argparse
10
4
  import os
@@ -23,8 +17,7 @@ from dasha.shortcuts import DEFAULT_PATH, Shortcuts, ShortcutsError
23
17
  from dasha.terminal import Terminal
24
18
 
25
19
  DESKTOP = registry.DESKTOP_ID
26
- """What starts the desktop: ``dasha desktop``, followed by any applications
27
- to start on it. No application can have it as its id."""
20
+ """The command word that starts the desktop."""
28
21
 
29
22
 
30
23
  def _desktop( # pylint: disable=too-many-arguments
@@ -41,25 +34,20 @@ def _desktop( # pylint: disable=too-many-arguments
41
34
  show_mouse: bool = False,
42
35
  escape_timeout: int = registry.ESCAPE_TIMEOUT,
43
36
  ) -> PresentationManager:
44
- """An empty desktop offering the applications Dasha Framework knows (the
45
- installed ones, unless given ``entries``), with the named
46
- ones started: each in a process of its own, unless ``processes`` is
47
- false. ``theme_name`` is the theme it starts with (``None``: the colours
48
- file's colours), and a theme chosen later is remembered; so is turning
49
- ``animations`` (on, unless told otherwise) on or off. ``colour_depth``
50
- is how it draws colours (``style.COLOUR_DEPTHS``), and
51
- ``show_mouse`` whether it inverts the cell under the mouse, which is
52
- remembered when it is turned on or off.
53
-
54
- ``alone`` runs just the named applications, as each would run on its
55
- own (``PresentationManager.stand_alone``): no system menu, and it ends
56
- when they do. ``dasha notepad`` is so the same as running Notepad's
57
- script, and ``dasha desktop notepad`` (or ``dasha-desktop notepad``) the
58
- desktop with Notepad on it.
59
-
60
- ``paths`` are the shortcuts file and the colours file, to which
61
- Settings... saves (by default, ``~/.dasha/shortcuts.json`` and
62
- ``~/.dasha/colours.json``)."""
37
+ """Run the desktop with the named applications.
38
+
39
+ :param shortcuts: Key bindings, or ``None`` for the defaults.
40
+ :param names: Ids of the applications to start.
41
+ :param processes: Whether each application gets its own process.
42
+ :param entries: Known applications, or ``None`` for the installed ones.
43
+ :param theme_name: Starting theme, or ``None`` for the colours file's.
44
+ :param alone: Whether to run the applications on their own.
45
+ :param animations: Whether animations are on.
46
+ :param paths: Shortcuts and colours files, if not the defaults.
47
+ :param colour_depth: How colours are drawn.
48
+ :param show_mouse: Whether the cell under the mouse is inverted.
49
+ :param escape_timeout: Milliseconds to wait after Escape.
50
+ """
63
51
  if entries is None:
64
52
  entries, _ = install.known_applications()
65
53
  manager = PresentationManager(shortcuts=shortcuts)
@@ -85,20 +73,21 @@ def _desktop( # pylint: disable=too-many-arguments
85
73
 
86
74
 
87
75
  def _listed(names: Sequence[str]) -> str:
88
- """Names as a sentence lists them: "Notepad", "Notepad and Demo",
89
- "Notepad, Demo and Clock"."""
76
+ """Names joined as a sentence lists them.
77
+
78
+ :param names: The names.
79
+ """
90
80
  if len(names) < 2:
91
81
  return "".join(names)
92
82
  return f"{', '.join(names[:-1])} and {names[-1]}"
93
83
 
94
84
 
95
85
  def _find(name: str, entries: dict[str, AppEntry]) -> list[str]:
96
- """The ids of the applications that ``name``, given on the command line,
97
- means: the one with that id; failing that, the one whose id it is in
98
- another case (``NOTEPAD``); failing that, those that are called it,
99
- ignoring case (``git``, for an application ``dasha-github`` called
100
- "Git"). More than one is a name too many applications have; none, a
101
- name no application has."""
86
+ """The application ids a command-line name means.
87
+
88
+ :param name: The name given.
89
+ :param entries: Known applications.
90
+ """
102
91
  if name in entries:
103
92
  return [name]
104
93
  wanted = name.casefold()
@@ -113,14 +102,11 @@ def _find(name: str, entries: dict[str, AppEntry]) -> list[str]:
113
102
  def _startup(
114
103
  names: Sequence[str], *, desktop: bool = False
115
104
  ) -> tuple[dict[str, AppEntry], list[str]] | None:
116
- """The applications Dasha Framework knows, and the ids of those to start: the
117
- ones named, by id or by name (``_find``), and, for the ``desktop``,
118
- first those ``autostart`` in the settings (an application both named
119
- and autostart's is started once). Problems with manifests are reported
120
- and those left out; an unknown name, one that more than one application
121
- has, or a settings file that cannot be read, is reported and gives
122
- ``None``; as is starting inside the command prompt of a desktop already
123
- running (see ``dasha.shell``)."""
105
+ """The known applications and the ids to start, or ``None``.
106
+
107
+ :param names: Names given on the command line.
108
+ :param desktop: Whether the desktop is starting.
109
+ """
124
110
  if os.environ.get(shell.SUSPENDED_VARIABLE):
125
111
  say(
126
112
  "dasha: Dasha Framework is already running in this terminal; "
@@ -165,11 +151,11 @@ def _startup(
165
151
  def _parse_arguments(
166
152
  argv: Sequence[str] | None, *, desktop: bool = False
167
153
  ) -> argparse.Namespace:
168
- """The command line, as ``dasha`` (or, if ``desktop``, as ``dasha-desktop``)
169
- takes it. ``apps`` are the applications to start, and ``desktop``
170
- whether to start them on the desktop. With nothing to run, the usage is
171
- shown and the program ends (``SystemExit``), as for any mistake in the
172
- arguments."""
154
+ """Parse the command line.
155
+
156
+ :param argv: Arguments, or ``None`` for ``sys.argv``.
157
+ :param desktop: Whether this is ``dasha-desktop``.
158
+ """
173
159
  parser = argparse.ArgumentParser(
174
160
  prog="dasha-desktop" if desktop else "dasha",
175
161
  description="Dasha Framework - a text-mode desktop and application framework.",
@@ -274,7 +260,12 @@ def _parse_arguments(
274
260
 
275
261
 
276
262
  def _write_new_file(path: Path, text: str, what: str) -> int:
277
- """Write a settings file for the user to edit, never overwriting one."""
263
+ """Write a new settings file, never overwriting.
264
+
265
+ :param path: Where to write.
266
+ :param text: File contents.
267
+ :param what: What the file is, for messages.
268
+ """
278
269
  if path.exists():
279
270
  say(f"dasha: {path} already exists; not overwriting it", file=sys.stderr)
280
271
  return 1
@@ -289,7 +280,12 @@ def _write_new_file(path: Path, text: str, what: str) -> int:
289
280
 
290
281
 
291
282
  def _report_problems(kind: str, path: Path, error: Exception) -> None:
292
- """Explain why a settings file cannot be used."""
283
+ """Explain why a settings file cannot be used.
284
+
285
+ :param kind: What the file is.
286
+ :param path: The file.
287
+ :param error: What went wrong.
288
+ """
293
289
  say(f"dasha: cannot use the {kind} file {path}:", file=sys.stderr)
294
290
  for problem in str(error).splitlines():
295
291
  say(f" - {problem}", file=sys.stderr)
@@ -301,9 +297,7 @@ class _Reported(Exception):
301
297
 
302
298
 
303
299
  def _saved_theme() -> tuple[theme.Theme, str] | None:
304
- """The theme last chosen from the system menu (``theme`` in the
305
- settings), if one is remembered. Raises ``_Reported`` once it has said
306
- why it cannot be used."""
300
+ """The remembered theme, if any."""
307
301
  try:
308
302
  name = registry.read_theme_setting(registry.SETTINGS_PATH)
309
303
  except ManifestError as error:
@@ -327,21 +321,17 @@ def _saved_theme() -> tuple[theme.Theme, str] | None:
327
321
  def _load_colours( # pylint: disable=too-many-return-statements
328
322
  path: Path, explicit: bool, monochrome: bool
329
323
  ) -> tuple[theme.Theme, str | None] | None:
330
- """The colours to start with, and the theme's name (``None`` for the
331
- colours file's), or ``None`` after reporting why they cannot be used.
332
-
333
- ``--monochrome``, or a terminal with no colours, comes first, and is the
334
- Monochrome theme exactly, as the Themes menu gives it: a colours file's
335
- changes are left out, as they may well add colours. Then ``--colours``,
336
- then the theme last
337
- chosen from the system menu (``theme`` in the settings), then the
338
- colours file, then the default theme (or ``NO_COLOR``'s monochrome)."""
324
+ """The starting colours and theme name, or ``None``.
325
+
326
+ :param path: The colours file.
327
+ :param explicit: Whether the file was given on the command line.
328
+ :param monochrome: Whether monochrome was asked for.
329
+ """
339
330
  if explicit and not path.exists():
340
331
  say(f"dasha: colours file {path} does not exist", file=sys.stderr)
341
332
  return None
342
- if monochrome or not style.terminal_has_colours():
333
+ if monochrome or theme.no_colour_set() or not style.terminal_has_colours():
343
334
  return theme.load_named_theme("monochrome"), "monochrome"
344
- no_colour = bool(os.environ.get("NO_COLOR"))
345
335
  try:
346
336
  saved = None if explicit else _saved_theme()
347
337
  except _Reported:
@@ -349,17 +339,21 @@ def _load_colours( # pylint: disable=too-many-return-statements
349
339
  if saved is not None:
350
340
  return saved # the colours file is not needed, nor read
351
341
  try:
352
- colours = theme.load_theme(path, no_colour=no_colour)
342
+ colours = theme.load_theme(path)
353
343
  except theme.ThemeError as error:
354
344
  _report_problems("colours", path, error)
355
345
  return None
356
346
  if path.exists():
357
347
  return colours, None
358
- return colours, "monochrome" if no_colour else "default"
348
+ return colours, "default"
359
349
 
360
350
 
361
351
  def _load_shortcuts(path: Path, explicit: bool) -> Shortcuts | None:
362
- """Load the shortcuts file, or report why it cannot be used."""
352
+ """Load the shortcuts file, or report why not.
353
+
354
+ :param path: The shortcuts file.
355
+ :param explicit: Whether the file was given on the command line.
356
+ """
363
357
  if explicit and not path.exists():
364
358
  say(f"dasha: shortcuts file {path} does not exist", file=sys.stderr)
365
359
  return None
@@ -373,9 +367,12 @@ def _load_shortcuts(path: Path, explicit: bool) -> Shortcuts | None:
373
367
  def _load_settings(
374
368
  args: argparse.Namespace, shortcuts_path: Path, colours_path: Path
375
369
  ) -> tuple[Shortcuts | None, tuple[theme.Theme, str | None]] | None:
376
- """The shortcuts (not needed for the key test) and the colour theme
377
- with its name, or ``None`` after reporting why a settings file cannot
378
- be used."""
370
+ """The shortcuts, colours and theme name, or ``None``.
371
+
372
+ :param args: Parsed arguments.
373
+ :param shortcuts_path: The shortcuts file.
374
+ :param colours_path: The colours file.
375
+ """
379
376
  shortcuts = None
380
377
  if not args.key_test:
381
378
  shortcuts = _load_shortcuts(shortcuts_path, explicit=args.shortcuts is not None)
@@ -390,10 +387,10 @@ def _load_settings(
390
387
 
391
388
 
392
389
  def _remember_options(args: argparse.Namespace) -> None:
393
- """Keep ``--colour-depth`` and ``--show-mouse`` in the settings, as
394
- Settings... does, so they need not be given every time
395
- (``--colour-depth auto`` forgets the depth). A settings file that
396
- cannot be written is reported, and Dasha Framework starts anyway."""
390
+ """Remember ``--colour-depth`` and ``--show-mouse``.
391
+
392
+ :param args: Parsed arguments.
393
+ """
397
394
  try:
398
395
  if args.colour_depth is not None:
399
396
  registry.save_colour_depth_setting(
@@ -411,9 +408,13 @@ def _take_the_screen(
411
408
  theme_name: str | None,
412
409
  paths: tuple[Path, Path],
413
410
  ) -> int:
414
- """Run the key test, or the desktop with its applications; an exit code.
415
- What would stop it is reported before the screen is taken over.
416
- ``paths`` are the shortcuts and colours files in use."""
411
+ """Run the key test or the desktop; return an exit code.
412
+
413
+ :param args: Parsed arguments.
414
+ :param shortcuts: Key bindings, if loaded.
415
+ :param theme_name: Starting theme name, if any.
416
+ :param paths: Shortcuts and colours files.
417
+ """
417
418
  startup = None if args.key_test else _startup(args.apps, desktop=args.desktop)
418
419
  if startup is None and not args.key_test:
419
420
  return 1
@@ -467,9 +468,10 @@ def _take_the_screen(
467
468
 
468
469
 
469
470
  def _report_errors(desktop: PresentationManager) -> bool:
470
- """Say where the log is, if anything went wrong in the desktop's own
471
- code while it ran; returns whether it went wrong so often that the
472
- desktop gave up."""
471
+ """Report logged errors; return whether the desktop gave up.
472
+
473
+ :param desktop: The desktop that ran.
474
+ """
473
475
  recovery = desktop.recovery
474
476
  if recovery is None:
475
477
  return False
@@ -478,17 +480,21 @@ def _report_errors(desktop: PresentationManager) -> bool:
478
480
 
479
481
 
480
482
  def _report_unsaid(desktop: PresentationManager) -> None:
481
- """What the desktop had to say but ended before it could (an
482
- application that could not start, when it was the only one): said on
483
- the terminal instead, once the screen is given back."""
483
+ """Print messages the desktop could not show.
484
+
485
+ :param desktop: The desktop that ran.
486
+ """
484
487
  server = desktop.server
485
488
  for title, message in server.notices if server is not None else []:
486
489
  say(f"dasha: {title}: {' '.join(message.split())}", file=sys.stderr)
487
490
 
488
491
 
489
492
  def main(argv: Sequence[str] | None = None, *, desktop: bool = False) -> int:
490
- """Run the Dasha Framework command line (the ``dasha`` command, or, if
491
- ``desktop``, ``dasha-desktop``) and return a process exit code."""
493
+ """Run the ``dasha`` command; return an exit code.
494
+
495
+ :param argv: Arguments, or ``None`` for ``sys.argv``.
496
+ :param desktop: Whether this is ``dasha-desktop``.
497
+ """
492
498
  arguments = list(sys.argv[1:] if argv is None else argv)
493
499
  if arguments and arguments[0] in install.COMMANDS:
494
500
  return install.run(arguments)
@@ -524,9 +530,10 @@ def main(argv: Sequence[str] | None = None, *, desktop: bool = False) -> int:
524
530
 
525
531
 
526
532
  def desktop_main(argv: Sequence[str] | None = None) -> int:
527
- """Run the ``dasha-desktop`` command, which is ``dasha desktop``: the
528
- desktop, with any applications named started on it. Returns a process
529
- exit code."""
533
+ """Run the ``dasha-desktop`` command; return an exit code.
534
+
535
+ :param argv: Arguments, or ``None`` for ``sys.argv``.
536
+ """
530
537
  return main(argv, desktop=True)
531
538
 
532
539