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.
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/PKG-INFO +35 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/README.md +32 -13
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/pyproject.toml +7 -1
- dasha_framework-0.0.2/src/dasha/__init__.py +10 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/__main__.py +96 -89
- dasha_framework-0.0.2/src/dasha/animation.py +86 -0
- dasha_framework-0.0.2/src/dasha/application.py +205 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/border.py +1 -1
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/canvas.py +85 -83
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/client.py +143 -81
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/clipboard.py +16 -30
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/config.py +9 -21
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/desktop.py +21 -23
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/dialog.py +182 -122
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/events.py +79 -108
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/filedialog.py +52 -74
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/help.py +155 -110
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/index.md +1 -1
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/menus.md +4 -2
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/settings.md +2 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/windows.md +1 -1
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/host.py +21 -25
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/hosting.py +209 -194
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/inbox.py +15 -43
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/install.py +61 -41
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/keytest.py +9 -11
- dasha_framework-0.0.2/src/dasha/logs.py +94 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/manager.py +431 -550
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/markdown.py +196 -97
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/menu.py +292 -177
- dasha_framework-0.0.2/src/dasha/printing.py +33 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/processes.py +39 -42
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/protocol.py +168 -91
- dasha_framework-0.0.2/src/dasha/pseudoterminal/__init__.py +27 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/pseudoterminal/_posix.py +6 -6
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/pseudoterminal/_windows.py +7 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/pseudoterminal/base.py +45 -37
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/recovery.py +46 -82
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/registry.py +128 -111
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/remote.py +109 -60
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/rundialog.py +42 -65
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/scrollbar.py +62 -61
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/__init__.py +41 -44
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/appearance.py +30 -29
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/applications.py +7 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/colours.py +10 -8
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/settings/keys.py +25 -24
- dasha_framework-0.0.2/src/dasha/settings/lists.py +11 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/shell.py +11 -34
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/shortcuts.py +67 -78
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/statusbar.py +40 -33
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/style.py +31 -60
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/__init__.py +24 -60
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/_posix.py +4 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/_winbuffer.py +33 -26
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/_windows.py +18 -52
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/terminal/ansi.py +7 -6
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/theme.py +134 -113
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/vt.py +150 -132
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/__init__.py +1 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/autocomplete.py +29 -48
- dasha_framework-0.0.2/src/dasha/widgets/base.py +284 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/button.py +57 -58
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/checkbox.py +7 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/cluster.py +83 -101
- dasha_framework-0.0.2/src/dasha/widgets/collapsible.py +171 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/combobox.py +37 -44
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/container.py +40 -53
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/editing.py +40 -35
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/groupbox.py +11 -29
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/label.py +30 -16
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/listbox.py +110 -129
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/paragraph.py +49 -48
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/password.py +7 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/progressbar.py +30 -73
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/radiobutton.py +8 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/scrollbar.py +40 -35
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/slider.py +43 -43
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/spinbox.py +55 -59
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/splitter.py +47 -66
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/switch.py +38 -49
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/table.py +76 -82
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/tabs.py +149 -77
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/terminalview.py +99 -89
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/textarea.py +194 -210
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/textbox.py +99 -174
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/widgets/tree.py +75 -103
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/window.py +233 -254
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/windowmenu.py +19 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/PKG-INFO +35 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/SOURCES.txt +7 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_alignment.py +12 -9
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_animation.py +30 -32
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_application.py +28 -18
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_atomic_writes.py +8 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_autocomplete.py +13 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_canvas.py +1 -3
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_client.py +24 -20
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_clipboard.py +19 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_clusters.py +28 -27
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_collapsible.py +15 -20
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_combobox.py +16 -7
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_command_line.py +20 -31
- dasha_framework-0.0.2/tests/test_command_line_problems.py +96 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_command_prompt.py +33 -31
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_container.py +8 -10
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_context_menu.py +57 -37
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_crash_restore.py +16 -18
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_desktop.py +9 -5
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_dialog.py +19 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_editing.py +18 -23
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_escape_injection.py +21 -23
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_escape_timeout.py +2 -5
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_events.py +20 -25
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_filedialog.py +17 -8
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_footer.py +15 -17
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_frozen.py +5 -13
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_fuzz.py +38 -34
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_groupbox.py +3 -5
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_grow.py +2 -3
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_help.py +62 -23
- dasha_framework-0.0.2/tests/test_hosted_windows.py +254 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_hosting.py +67 -69
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_inbox.py +15 -23
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_inert_menus.py +14 -6
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_install.py +135 -27
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_key_hints.py +8 -8
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_key_release.py +4 -7
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_keyboard_adjust.py +14 -21
- dasha_framework-0.0.2/tests/test_keytest.py +74 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_large_text.py +15 -17
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_line_numbers.py +19 -17
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_listbox.py +38 -32
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_loading.py +54 -54
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_manager.py +54 -22
- dasha_framework-0.0.2/tests/test_manager_edges.py +241 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_markdown.py +20 -8
- dasha_framework-0.0.2/tests/test_markdown_edges.py +113 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_menu.py +148 -18
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_package.py +2 -5
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_paragraph.py +9 -3
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_password.py +1 -2
- dasha_framework-0.0.2/tests/test_popups.py +172 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_processes.py +27 -17
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_progressbar.py +7 -6
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_pseudoterminal.py +19 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_recovery.py +29 -37
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_registry.py +6 -3
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_repeat_and_clicks.py +19 -6
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_resize.py +31 -7
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_rgb.py +13 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_robustness.py +27 -19
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_rundialog.py +22 -25
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_scroll.py +32 -17
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_security.py +87 -52
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_settings.py +331 -44
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_shadow.py +4 -1
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_shell.py +8 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_shortcuts.py +9 -4
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_show_mouse.py +13 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_slider.py +11 -4
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_spinbox.py +15 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_splitter.py +23 -22
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_statusbar.py +26 -26
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_submenus.py +27 -24
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_switch.py +13 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_table.py +23 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_tabs.py +53 -8
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_terminal.py +9 -13
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_terminalview.py +162 -40
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_textarea.py +39 -31
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_textbox.py +43 -36
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_theme.py +42 -12
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_theme_switching.py +209 -29
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_titles_and_system_menu.py +10 -3
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_tree.py +29 -36
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_tutorial.py +12 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_vt.py +15 -15
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_vt_keys.py +4 -8
- dasha_framework-0.0.2/tests/test_vt_sequences.py +475 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_waiting_dialogs.py +17 -13
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_wake.py +36 -19
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_widget_edge_cases.py +38 -41
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_widgets.py +23 -7
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_winbuffer.py +17 -14
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_window_colours.py +12 -11
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_window_states.py +18 -23
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_windowmenu.py +11 -4
- dasha_framework-0.0.2/tests/test_windows_console.py +331 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/tests/test_word_wrap.py +25 -23
- dasha_framework-0.0.1/src/dasha/__init__.py +0 -9
- dasha_framework-0.0.1/src/dasha/animation.py +0 -90
- dasha_framework-0.0.1/src/dasha/application.py +0 -276
- dasha_framework-0.0.1/src/dasha/logs.py +0 -104
- dasha_framework-0.0.1/src/dasha/printing.py +0 -42
- dasha_framework-0.0.1/src/dasha/pseudoterminal/__init__.py +0 -43
- dasha_framework-0.0.1/src/dasha/settings/lists.py +0 -11
- dasha_framework-0.0.1/src/dasha/widgets/base.py +0 -298
- dasha_framework-0.0.1/src/dasha/widgets/collapsible.py +0 -224
- dasha_framework-0.0.1/tests/test_windows_console.py +0 -174
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/LICENSE +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/setup.cfg +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/applications.md +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/keyboard.md +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/helppages/running.md +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha/py.typed +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/dependency_links.txt +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/entry_points.txt +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/requires.txt +0 -0
- {dasha_framework-0.0.1 → dasha_framework-0.0.2}/src/dasha_framework.egg-info/top_level.txt +0 -0
- {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.
|
|
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
|
-
|
|
155
|
-
run.
|
|
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
|
|
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 = [
|
|
203
|
-
|
|
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/
|
|
225
|
-
and [Installing applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/
|
|
226
|
-
in the
|
|
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
|
|
280
|
-
|
|
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/
|
|
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
|
-
|
|
111
|
-
run.
|
|
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
|
|
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 = [
|
|
159
|
-
|
|
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/
|
|
181
|
-
and [Installing applications](https://github.com/dashasierra/dasha-framework/blob/HEAD/docs/
|
|
182
|
-
in the
|
|
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
|
|
236
|
-
|
|
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/
|
|
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
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
"""Command-line entry point
|
|
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
|
-
"""
|
|
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
|
-
"""
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
89
|
-
|
|
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
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
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
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
"""
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
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
|
|
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
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
|
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, "
|
|
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
|
|
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
|
|
377
|
-
|
|
378
|
-
|
|
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
|
-
"""
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
"""
|
|
471
|
-
|
|
472
|
-
desktop
|
|
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
|
-
"""
|
|
482
|
-
|
|
483
|
-
|
|
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
|
|
491
|
-
|
|
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
|
|
528
|
-
|
|
529
|
-
|
|
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
|
|