todooit 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- todooit-1.0.0/.gitignore +28 -0
- todooit-1.0.0/LICENSE +23 -0
- todooit-1.0.0/PKG-INFO +163 -0
- todooit-1.0.0/README.md +132 -0
- todooit-1.0.0/pyproject.toml +144 -0
- todooit-1.0.0/todooit/__init__.py +0 -0
- todooit-1.0.0/todooit/__main__.py +71 -0
- todooit-1.0.0/todooit/api/__init__.py +90 -0
- todooit-1.0.0/todooit/api/cadence.py +179 -0
- todooit-1.0.0/todooit/api/exceptions.py +25 -0
- todooit-1.0.0/todooit/api/expansion.py +33 -0
- todooit-1.0.0/todooit/api/fixed_projects.py +422 -0
- todooit-1.0.0/todooit/api/history.py +376 -0
- todooit-1.0.0/todooit/api/hooks/fix_hooks.py +40 -0
- todooit-1.0.0/todooit/api/hooks/validation_hooks.py +30 -0
- todooit-1.0.0/todooit/api/lifecycle.py +509 -0
- todooit-1.0.0/todooit/api/manager.py +113 -0
- todooit-1.0.0/todooit/api/model.py +233 -0
- todooit-1.0.0/todooit/api/note_migration.py +159 -0
- todooit-1.0.0/todooit/api/orphan_migration.py +51 -0
- todooit-1.0.0/todooit/api/pinned_note.py +69 -0
- todooit-1.0.0/todooit/api/placement.py +68 -0
- todooit-1.0.0/todooit/api/project.py +201 -0
- todooit-1.0.0/todooit/api/recycle.py +152 -0
- todooit-1.0.0/todooit/api/theme.py +86 -0
- todooit-1.0.0/todooit/api/todo.py +363 -0
- todooit-1.0.0/todooit/paths.py +57 -0
- todooit-1.0.0/todooit/ui/__init__.py +0 -0
- todooit-1.0.0/todooit/ui/api/__init__.py +24 -0
- todooit-1.0.0/todooit/ui/api/api_components/__init__.py +19 -0
- todooit-1.0.0/todooit/ui/api/api_components/_base.py +2 -0
- todooit-1.0.0/todooit/ui/api/api_components/bar.py +20 -0
- todooit-1.0.0/todooit/ui/api/api_components/formatters/__init__.py +9 -0
- todooit-1.0.0/todooit/ui/api/api_components/formatters/_decorators.py +8 -0
- todooit-1.0.0/todooit/ui/api/api_components/formatters/_model_formatter_base.py +21 -0
- todooit-1.0.0/todooit/ui/api/api_components/formatters/formatter.py +13 -0
- todooit-1.0.0/todooit/ui/api/api_components/formatters/formatter_store.py +141 -0
- todooit-1.0.0/todooit/ui/api/api_components/formatters/model_formatters.py +28 -0
- todooit-1.0.0/todooit/ui/api/api_components/keys.py +229 -0
- todooit-1.0.0/todooit/ui/api/api_components/layout.py +33 -0
- todooit-1.0.0/todooit/ui/api/api_components/vars.py +178 -0
- todooit-1.0.0/todooit/ui/api/api_components/vim.py +21 -0
- todooit-1.0.0/todooit/ui/api/bar_widgets.py +76 -0
- todooit-1.0.0/todooit/ui/api/event_handlers.py +29 -0
- todooit-1.0.0/todooit/ui/api/events/__init__.py +51 -0
- todooit-1.0.0/todooit/ui/api/events/events.py +191 -0
- todooit-1.0.0/todooit/ui/api/formatter_presets.py +86 -0
- todooit-1.0.0/todooit/ui/api/loader.py +47 -0
- todooit-1.0.0/todooit/ui/api/plug.py +89 -0
- todooit-1.0.0/todooit/ui/api/todooit_api.py +532 -0
- todooit-1.0.0/todooit/ui/api/widgets.py +22 -0
- todooit-1.0.0/todooit/ui/pane_layout.py +259 -0
- todooit-1.0.0/todooit/ui/screens/__init__.py +18 -0
- todooit-1.0.0/todooit/ui/screens/base.py +69 -0
- todooit-1.0.0/todooit/ui/screens/calendar.py +327 -0
- todooit-1.0.0/todooit/ui/screens/help.py +238 -0
- todooit-1.0.0/todooit/ui/screens/index.py +566 -0
- todooit-1.0.0/todooit/ui/screens/move.py +198 -0
- todooit-1.0.0/todooit/ui/screens/note/__init__.py +13 -0
- todooit-1.0.0/todooit/ui/screens/note/disp/__init__.py +12 -0
- todooit-1.0.0/todooit/ui/screens/note/disp/document.py +464 -0
- todooit-1.0.0/todooit/ui/screens/note/disp/markdown.py +272 -0
- todooit-1.0.0/todooit/ui/screens/note/disp/markup.py +429 -0
- todooit-1.0.0/todooit/ui/screens/note/disp/theme.py +153 -0
- todooit-1.0.0/todooit/ui/screens/note/disp/view.py +410 -0
- todooit-1.0.0/todooit/ui/screens/note/screens/__init__.py +12 -0
- todooit-1.0.0/todooit/ui/screens/note/screens/attachments.py +221 -0
- todooit-1.0.0/todooit/ui/screens/note/screens/help.py +269 -0
- todooit-1.0.0/todooit/ui/screens/note/screens/pinned.py +27 -0
- todooit-1.0.0/todooit/ui/screens/note/screens/screen.py +623 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/__init__.py +13 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/buffer.py +208 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/clipboard.py +200 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/editing.py +229 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/editor.py +125 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/history.py +61 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/host.py +48 -0
- todooit-1.0.0/todooit/ui/screens/note/vim/modes.py +509 -0
- todooit-1.0.0/todooit/ui/screens/panel.py +115 -0
- todooit-1.0.0/todooit/ui/screens/project_completion.py +380 -0
- todooit-1.0.0/todooit/ui/screens/quick_add.py +334 -0
- todooit-1.0.0/todooit/ui/screens/search.py +634 -0
- todooit-1.0.0/todooit/ui/slim_cursor.py +83 -0
- todooit-1.0.0/todooit/ui/styles.tcss +297 -0
- todooit-1.0.0/todooit/ui/tui.py +109 -0
- todooit-1.0.0/todooit/ui/widgets/__init__.py +7 -0
- todooit-1.0.0/todooit/ui/widgets/bars/__init__.py +12 -0
- todooit-1.0.0/todooit/ui/widgets/bars/_base.py +61 -0
- todooit-1.0.0/todooit/ui/widgets/bars/bar_switcher.py +85 -0
- todooit-1.0.0/todooit/ui/widgets/bars/confirm_bar/__init__.py +3 -0
- todooit-1.0.0/todooit/ui/widgets/bars/confirm_bar/bar.py +52 -0
- todooit-1.0.0/todooit/ui/widgets/bars/field_bar/__init__.py +3 -0
- todooit-1.0.0/todooit/ui/widgets/bars/field_bar/bar.py +77 -0
- todooit-1.0.0/todooit/ui/widgets/bars/notification_bar/__init__.py +3 -0
- todooit-1.0.0/todooit/ui/widgets/bars/notification_bar/bar.py +114 -0
- todooit-1.0.0/todooit/ui/widgets/bars/status_bar/__init__.py +4 -0
- todooit-1.0.0/todooit/ui/widgets/bars/status_bar/bar.py +38 -0
- todooit-1.0.0/todooit/ui/widgets/bars/status_bar/bar_widget.py +44 -0
- todooit-1.0.0/todooit/ui/widgets/inputs/_input.py +360 -0
- todooit-1.0.0/todooit/ui/widgets/inputs/model_inputs.py +216 -0
- todooit-1.0.0/todooit/ui/widgets/inputs/simple_input.py +81 -0
- todooit-1.0.0/todooit/ui/widgets/inputs/vim_input.py +279 -0
- todooit-1.0.0/todooit/ui/widgets/renderers/__init__.py +11 -0
- todooit-1.0.0/todooit/ui/widgets/renderers/base_renderer.py +394 -0
- todooit-1.0.0/todooit/ui/widgets/renderers/project_renderer.py +11 -0
- todooit-1.0.0/todooit/ui/widgets/renderers/todo_renderer.py +27 -0
- todooit-1.0.0/todooit/ui/widgets/trees/__init__.py +25 -0
- todooit-1.0.0/todooit/ui/widgets/trees/_decorators.py +88 -0
- todooit-1.0.0/todooit/ui/widgets/trees/_render_dict.py +54 -0
- todooit-1.0.0/todooit/ui/widgets/trees/base_tree.py +71 -0
- todooit-1.0.0/todooit/ui/widgets/trees/bin_todos_tree.py +23 -0
- todooit-1.0.0/todooit/ui/widgets/trees/fixed_todos_tree.py +275 -0
- todooit-1.0.0/todooit/ui/widgets/trees/flash_jump.py +216 -0
- todooit-1.0.0/todooit/ui/widgets/trees/model_tree.py +1125 -0
- todooit-1.0.0/todooit/ui/widgets/trees/projects_tree.py +369 -0
- todooit-1.0.0/todooit/ui/widgets/trees/todos_tree.py +362 -0
- todooit-1.0.0/todooit/utils/__init__.py +71 -0
- todooit-1.0.0/todooit/utils/clipboard.py +218 -0
- todooit-1.0.0/todooit/utils/colors.py +13 -0
- todooit-1.0.0/todooit/utils/css_manager.py +106 -0
- todooit-1.0.0/todooit/utils/database.py +10 -0
- todooit-1.0.0/todooit/utils/date_parser.py +515 -0
- todooit-1.0.0/todooit/utils/day_names.py +24 -0
- todooit-1.0.0/todooit/utils/default_config.py +981 -0
- todooit-1.0.0/todooit/utils/files.py +399 -0
- todooit-1.0.0/todooit/utils/holidays.py +102 -0
- todooit-1.0.0/todooit/utils/links.py +629 -0
- todooit-1.0.0/todooit/utils/project_complete.py +257 -0
- todooit-1.0.0/todooit/utils/quick_add.py +350 -0
- todooit-1.0.0/todooit/vim_engine/__init__.py +64 -0
- todooit-1.0.0/todooit/vim_engine/buffer.py +125 -0
- todooit-1.0.0/todooit/vim_engine/engine.py +1735 -0
- todooit-1.0.0/todooit/vim_engine/keymap.py +184 -0
- todooit-1.0.0/todooit/vim_engine/motions.py +282 -0
- todooit-1.0.0/todooit/vim_engine/register.py +87 -0
- todooit-1.0.0/todooit/vim_engine/search.py +67 -0
- todooit-1.0.0/todooit/vim_engine/text_objects.py +293 -0
- todooit-1.0.0/todooit/vim_engine/vim_flash.py +191 -0
todooit-1.0.0/.gitignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# environments
|
|
2
|
+
.venv/
|
|
3
|
+
venv/
|
|
4
|
+
|
|
5
|
+
# python build artifacts
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*.egg-info/
|
|
9
|
+
build/
|
|
10
|
+
dist/
|
|
11
|
+
|
|
12
|
+
# tool caches
|
|
13
|
+
.pytest_cache/
|
|
14
|
+
.ruff_cache/
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
.coverage
|
|
17
|
+
htmlcov/
|
|
18
|
+
|
|
19
|
+
# editors
|
|
20
|
+
.vscode/
|
|
21
|
+
.idea/
|
|
22
|
+
|
|
23
|
+
# local scratch / databases
|
|
24
|
+
*.db
|
|
25
|
+
playground/
|
|
26
|
+
.local_planning
|
|
27
|
+
.claude
|
|
28
|
+
TMP_CLAUDE
|
todooit-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Georg Slamanig
|
|
4
|
+
Copyright (c) 2022 Murli Tawari (dooit)
|
|
5
|
+
Copyright (c) 2024 Dooit (dooit-extras)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
todooit-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: todooit
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A beautiful, versatile todo app in your terminal for a keyboard based workflow.
|
|
5
|
+
Project-URL: Homepage, https://github.com/gslama12/todooit
|
|
6
|
+
Project-URL: Documentation, https://gslama12.github.io/todooit/
|
|
7
|
+
Project-URL: Repository, https://github.com/gslama12/todooit
|
|
8
|
+
Project-URL: Issues, https://github.com/gslama12/todooit/issues
|
|
9
|
+
Author-email: Georg Slamanig <georgslamanig@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: productivity,terminal,textual,todo,tui,vim
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Topic :: Office/Business :: Scheduling
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: click>=8.1.8
|
|
24
|
+
Requires-Dist: platformdirs>=4.4.0
|
|
25
|
+
Requires-Dist: pyperclip>=1.10.0
|
|
26
|
+
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
27
|
+
Requires-Dist: sqlalchemy<3,>=2.0.43
|
|
28
|
+
Requires-Dist: textual<9,>=6.1.0
|
|
29
|
+
Requires-Dist: typing-extensions>=4.5.0
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# todooit
|
|
33
|
+
|
|
34
|
+
[](https://gslama12.github.io/todooit/)
|
|
35
|
+
[](https://pypi.org/project/todooit/)
|
|
36
|
+
[](https://github.com/gslama12/todooit/blob/main/LICENSE)
|
|
37
|
+
|
|
38
|
+
A keyboard-driven todo app for the terminal: todos in a tree of projects, vim-like
|
|
39
|
+
keys, markdown notes with vim editing, natural-language dates and search. Started as a fork of
|
|
40
|
+
[dooit](https://github.com/dooit-org/dooit) and extended with the parts of Todoist
|
|
41
|
+
it was missing.
|
|
42
|
+
|
|
43
|
+
<p align="center">
|
|
44
|
+
<img src="https://raw.githubusercontent.com/gslama12/todooit/main/site/docs/public/demo.gif" alt="todooit" width="900">
|
|
45
|
+
</p>
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
- **Fixed views** — Today, Upcoming and a Bin, built from your real projects and jumped to with `gt` / `gu` / `gb`.
|
|
50
|
+
- **Done stays put** — a ticked task stays in its project, hidden; `.` shows completed tasks in place, struck through.
|
|
51
|
+
- **Nested projects and tasks** — both nest as deep as you want; `h` folds, `I` / `U` indent. A task's dates hold its steps: planning a task plans its steps, and no step is due after its task.
|
|
52
|
+
- **Dates in words** — scheduled (`s`) and due (`d`) typed as `tom`, `next friday`, `in 2w`, `eom`, `19.07.`, or picked off a calendar (`cal`).
|
|
53
|
+
- **Smart recurrence** — `r` repeats a task every `3d`, `2w`, `1m`, or on the last *working* day of the month with `eom`.
|
|
54
|
+
- **Flash jumps** *(new)* — `f` labels every row on screen; type a label and the cursor is there.
|
|
55
|
+
- **Markdown notes** — every task has a note (`space`) with headings, quotes, emphasis, bullets and numbered lists that continue and renumber themselves; `m` opens a pinned scratchpad.
|
|
56
|
+
- **File attachments** — copy a file anywhere and `ctrl+v` it into a note; it is pinned to the note by path.
|
|
57
|
+
- **Vim editing** — notes are edited with real vim keys (motions, operators, text objects, VISUAL, search & replace, flash), and `e` edits a task's description with the same keys.
|
|
58
|
+
- **Quick add** — `C` types a whole task in one line, with its project, priority and day.
|
|
59
|
+
- **Finder** — `/` searches every task in the database and walks the cursor to the one you pick; start with `>` to search inside notes.
|
|
60
|
+
- **The small things** — `xx` to the Bin and `R` back, `u` / `ctrl+r` undo and redo everything, `ctrl+c` / `ctrl+v` copy and paste tasks, `ctrl+n` copies a note, `M` moves a task to another project, `SP` / `SD` / `SS` sort, `o` opens a link, `c0`–`c9` color a project.
|
|
61
|
+
|
|
62
|
+
> [!TIP]
|
|
63
|
+
> **Press `?` for a list of every key**, always matching your config. Inside a note, `space` `?` lists the note's vim keys. More in the [documentation](https://gslama12.github.io/todooit/).
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Install
|
|
67
|
+
|
|
68
|
+
Needs Python 3.9+ on macOS, Linux or WSL, and a
|
|
69
|
+
[Nerd Font](https://www.nerdfonts.com/font-downloads) in your terminal. Tested on [WezTerm](https://wezterm.org/).
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
uv tool install todooit # or: pipx install todooit
|
|
73
|
+
todooit # run from anywhere
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Update with `uv tool upgrade todooit` (or `pipx upgrade todooit`). Also check
|
|
77
|
+
out the [installation guide](https://gslama12.github.io/todooit/guide/installation).
|
|
78
|
+
|
|
79
|
+
## Keyboard layout
|
|
80
|
+
|
|
81
|
+
The default keys are set up for a **QWERTZ** keyboard, with `j` `k` `l` `ö` as the navigation keys (one key to the right of vim's `h` `j` `k` `l`), and a few note keys moved to where a German keyboard has room for them.
|
|
82
|
+
|
|
83
|
+
| Key | Moves |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| `j` / `ö` | To the projects / tasks pane |
|
|
86
|
+
| `k` / `l` | Up / down |
|
|
87
|
+
|
|
88
|
+
The [`config/`](https://github.com/gslama12/todooit/tree/main/config) folder has two drop-in configs that switch everything to
|
|
89
|
+
**standard vim keys** instead — `qwertz_vim.py` and `qwerty_vim.py`: `h` `j` `k` `l`
|
|
90
|
+
in the panes, and vim's own `0` `^` `$` `-` `+` `;` `,` `/` inside notes.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
mkdir -p "$(dirname "$(todooit config-loc)")"
|
|
94
|
+
curl -fLo "$(todooit config-loc)" \
|
|
95
|
+
https://raw.githubusercontent.com/gslama12/todooit/main/config/qwerty_vim.py
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
or download it anywhere and try it out first with `todooit -c qwerty_vim.py`. See
|
|
99
|
+
[Vim layouts](https://gslama12.github.io/todooit/guide/keybindings#vim-layouts).
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## Configuration
|
|
103
|
+
|
|
104
|
+
Keybinds, colors, columns and the status bar are all set in Python
|
|
105
|
+
in `todooit/utils/default_config.py`, and your own file on top of it overrides any
|
|
106
|
+
of them — see [Configuration](https://gslama12.github.io/todooit/reference/configuration).
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## Data
|
|
110
|
+
|
|
111
|
+
Todos live in `~/.local/share/todooit/todooit.db`, with generated CSS cached in
|
|
112
|
+
`~/.cache/todooit` and an optional config file in `~/.config/todooit`.
|
|
113
|
+
|
|
114
|
+
> Setting `TODOOIT_HOME` moves all three into that one directory instead, giving a fully isolated instance; `todooit --dev` is shorthand for one at `~/.local/share/todooit-dev`, handy for trying changes out without touching your real todos.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Coming from dooit
|
|
118
|
+
|
|
119
|
+
The migration script isn't part of the installed package. Download it and run
|
|
120
|
+
it against todooit with [uv](https://docs.astral.sh/uv/):
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
curl -fLO https://raw.githubusercontent.com/gslama12/todooit/main/migration/db_migration.py
|
|
124
|
+
uv run --with todooit db_migration.py --dry-run # what would move, nothing written
|
|
125
|
+
uv run --with todooit db_migration.py # reads ~/.local/share/dooit/dooit.db
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
From a checkout of the repo, `uv run python migration/db_migration.py` does the same.
|
|
129
|
+
|
|
130
|
+
This copies a dooit v3 database (v3.0 to v3.3.4) into todooit's. The dooit file
|
|
131
|
+
is opened read-only, and an existing todooit database is only replaced with
|
|
132
|
+
`--force`, which backs it up first. Effort is dropped, minute recurrences round
|
|
133
|
+
up to hours, and each family of steps is fitted to todooit's rules (open steps
|
|
134
|
+
of a done task are completed, nested recurrences end). Details are in
|
|
135
|
+
[Migrating from dooit](https://gslama12.github.io/todooit/reference/data#migrating-from-dooit).
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## Contributing
|
|
139
|
+
|
|
140
|
+
For development, install from source — editable, so editing the code edits the
|
|
141
|
+
running app:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
git clone https://github.com/gslama12/todooit
|
|
145
|
+
cd todooit
|
|
146
|
+
uv venv .venv && source .venv/bin/activate
|
|
147
|
+
uv pip install -e .
|
|
148
|
+
todooit
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Then:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
uv sync
|
|
155
|
+
uv run pytest -q # -m smoke -n 4 for the quick check
|
|
156
|
+
uv run todooit --dev # the app against a throwaway database
|
|
157
|
+
```
|
|
158
|
+
More in [Development](https://gslama12.github.io/todooit/reference/development).
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## Credits
|
|
162
|
+
|
|
163
|
+
MIT licensed. Based on [dooit](https://github.com/dooit-org/dooit) (upstream v3.3.4) and [dooit-extras](https://github.com/dooit-org/dooit-extras) by kraanzu and contributors; both source histories are preserved in this repo's git log.
|
todooit-1.0.0/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# todooit
|
|
2
|
+
|
|
3
|
+
[](https://gslama12.github.io/todooit/)
|
|
4
|
+
[](https://pypi.org/project/todooit/)
|
|
5
|
+
[](https://github.com/gslama12/todooit/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
A keyboard-driven todo app for the terminal: todos in a tree of projects, vim-like
|
|
8
|
+
keys, markdown notes with vim editing, natural-language dates and search. Started as a fork of
|
|
9
|
+
[dooit](https://github.com/dooit-org/dooit) and extended with the parts of Todoist
|
|
10
|
+
it was missing.
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://raw.githubusercontent.com/gslama12/todooit/main/site/docs/public/demo.gif" alt="todooit" width="900">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **Fixed views** — Today, Upcoming and a Bin, built from your real projects and jumped to with `gt` / `gu` / `gb`.
|
|
19
|
+
- **Done stays put** — a ticked task stays in its project, hidden; `.` shows completed tasks in place, struck through.
|
|
20
|
+
- **Nested projects and tasks** — both nest as deep as you want; `h` folds, `I` / `U` indent. A task's dates hold its steps: planning a task plans its steps, and no step is due after its task.
|
|
21
|
+
- **Dates in words** — scheduled (`s`) and due (`d`) typed as `tom`, `next friday`, `in 2w`, `eom`, `19.07.`, or picked off a calendar (`cal`).
|
|
22
|
+
- **Smart recurrence** — `r` repeats a task every `3d`, `2w`, `1m`, or on the last *working* day of the month with `eom`.
|
|
23
|
+
- **Flash jumps** *(new)* — `f` labels every row on screen; type a label and the cursor is there.
|
|
24
|
+
- **Markdown notes** — every task has a note (`space`) with headings, quotes, emphasis, bullets and numbered lists that continue and renumber themselves; `m` opens a pinned scratchpad.
|
|
25
|
+
- **File attachments** — copy a file anywhere and `ctrl+v` it into a note; it is pinned to the note by path.
|
|
26
|
+
- **Vim editing** — notes are edited with real vim keys (motions, operators, text objects, VISUAL, search & replace, flash), and `e` edits a task's description with the same keys.
|
|
27
|
+
- **Quick add** — `C` types a whole task in one line, with its project, priority and day.
|
|
28
|
+
- **Finder** — `/` searches every task in the database and walks the cursor to the one you pick; start with `>` to search inside notes.
|
|
29
|
+
- **The small things** — `xx` to the Bin and `R` back, `u` / `ctrl+r` undo and redo everything, `ctrl+c` / `ctrl+v` copy and paste tasks, `ctrl+n` copies a note, `M` moves a task to another project, `SP` / `SD` / `SS` sort, `o` opens a link, `c0`–`c9` color a project.
|
|
30
|
+
|
|
31
|
+
> [!TIP]
|
|
32
|
+
> **Press `?` for a list of every key**, always matching your config. Inside a note, `space` `?` lists the note's vim keys. More in the [documentation](https://gslama12.github.io/todooit/).
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## Install
|
|
36
|
+
|
|
37
|
+
Needs Python 3.9+ on macOS, Linux or WSL, and a
|
|
38
|
+
[Nerd Font](https://www.nerdfonts.com/font-downloads) in your terminal. Tested on [WezTerm](https://wezterm.org/).
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv tool install todooit # or: pipx install todooit
|
|
42
|
+
todooit # run from anywhere
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Update with `uv tool upgrade todooit` (or `pipx upgrade todooit`). Also check
|
|
46
|
+
out the [installation guide](https://gslama12.github.io/todooit/guide/installation).
|
|
47
|
+
|
|
48
|
+
## Keyboard layout
|
|
49
|
+
|
|
50
|
+
The default keys are set up for a **QWERTZ** keyboard, with `j` `k` `l` `ö` as the navigation keys (one key to the right of vim's `h` `j` `k` `l`), and a few note keys moved to where a German keyboard has room for them.
|
|
51
|
+
|
|
52
|
+
| Key | Moves |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `j` / `ö` | To the projects / tasks pane |
|
|
55
|
+
| `k` / `l` | Up / down |
|
|
56
|
+
|
|
57
|
+
The [`config/`](https://github.com/gslama12/todooit/tree/main/config) folder has two drop-in configs that switch everything to
|
|
58
|
+
**standard vim keys** instead — `qwertz_vim.py` and `qwerty_vim.py`: `h` `j` `k` `l`
|
|
59
|
+
in the panes, and vim's own `0` `^` `$` `-` `+` `;` `,` `/` inside notes.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
mkdir -p "$(dirname "$(todooit config-loc)")"
|
|
63
|
+
curl -fLo "$(todooit config-loc)" \
|
|
64
|
+
https://raw.githubusercontent.com/gslama12/todooit/main/config/qwerty_vim.py
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
or download it anywhere and try it out first with `todooit -c qwerty_vim.py`. See
|
|
68
|
+
[Vim layouts](https://gslama12.github.io/todooit/guide/keybindings#vim-layouts).
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## Configuration
|
|
72
|
+
|
|
73
|
+
Keybinds, colors, columns and the status bar are all set in Python
|
|
74
|
+
in `todooit/utils/default_config.py`, and your own file on top of it overrides any
|
|
75
|
+
of them — see [Configuration](https://gslama12.github.io/todooit/reference/configuration).
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Data
|
|
79
|
+
|
|
80
|
+
Todos live in `~/.local/share/todooit/todooit.db`, with generated CSS cached in
|
|
81
|
+
`~/.cache/todooit` and an optional config file in `~/.config/todooit`.
|
|
82
|
+
|
|
83
|
+
> Setting `TODOOIT_HOME` moves all three into that one directory instead, giving a fully isolated instance; `todooit --dev` is shorthand for one at `~/.local/share/todooit-dev`, handy for trying changes out without touching your real todos.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Coming from dooit
|
|
87
|
+
|
|
88
|
+
The migration script isn't part of the installed package. Download it and run
|
|
89
|
+
it against todooit with [uv](https://docs.astral.sh/uv/):
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
curl -fLO https://raw.githubusercontent.com/gslama12/todooit/main/migration/db_migration.py
|
|
93
|
+
uv run --with todooit db_migration.py --dry-run # what would move, nothing written
|
|
94
|
+
uv run --with todooit db_migration.py # reads ~/.local/share/dooit/dooit.db
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
From a checkout of the repo, `uv run python migration/db_migration.py` does the same.
|
|
98
|
+
|
|
99
|
+
This copies a dooit v3 database (v3.0 to v3.3.4) into todooit's. The dooit file
|
|
100
|
+
is opened read-only, and an existing todooit database is only replaced with
|
|
101
|
+
`--force`, which backs it up first. Effort is dropped, minute recurrences round
|
|
102
|
+
up to hours, and each family of steps is fitted to todooit's rules (open steps
|
|
103
|
+
of a done task are completed, nested recurrences end). Details are in
|
|
104
|
+
[Migrating from dooit](https://gslama12.github.io/todooit/reference/data#migrating-from-dooit).
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## Contributing
|
|
108
|
+
|
|
109
|
+
For development, install from source — editable, so editing the code edits the
|
|
110
|
+
running app:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/gslama12/todooit
|
|
114
|
+
cd todooit
|
|
115
|
+
uv venv .venv && source .venv/bin/activate
|
|
116
|
+
uv pip install -e .
|
|
117
|
+
todooit
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Then:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
uv sync
|
|
124
|
+
uv run pytest -q # -m smoke -n 4 for the quick check
|
|
125
|
+
uv run todooit --dev # the app against a throwaway database
|
|
126
|
+
```
|
|
127
|
+
More in [Development](https://gslama12.github.io/todooit/reference/development).
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## Credits
|
|
131
|
+
|
|
132
|
+
MIT licensed. Based on [dooit](https://github.com/dooit-org/dooit) (upstream v3.3.4) and [dooit-extras](https://github.com/dooit-org/dooit-extras) by kraanzu and contributors; both source histories are preserved in this repo's git log.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "todooit"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "A beautiful, versatile todo app in your terminal for a keyboard based workflow."
|
|
5
|
+
requires-python = ">=3.9"
|
|
6
|
+
authors = [
|
|
7
|
+
{name = "Georg Slamanig", email = "georgslamanig@gmail.com"}
|
|
8
|
+
]
|
|
9
|
+
license = "MIT"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
keywords = ["todo", "tui", "terminal", "vim", "textual", "productivity"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 5 - Production/Stable",
|
|
14
|
+
"Environment :: Console",
|
|
15
|
+
"Intended Audience :: End Users/Desktop",
|
|
16
|
+
"Operating System :: MacOS",
|
|
17
|
+
"Operating System :: POSIX :: Linux",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Topic :: Office/Business :: Scheduling",
|
|
21
|
+
"Topic :: Utilities",
|
|
22
|
+
]
|
|
23
|
+
# Upper bounds only on the majors that have broken apps before: users install
|
|
24
|
+
# from PyPI without uv.lock, so an unbounded Textual or SQLAlchemy major would
|
|
25
|
+
# reach them untested. Raise a bound after testing against the new major.
|
|
26
|
+
dependencies = [
|
|
27
|
+
"click>=8.1.8",
|
|
28
|
+
"platformdirs>=4.4.0",
|
|
29
|
+
"pyperclip>=1.10.0",
|
|
30
|
+
"python-dateutil>=2.9.0.post0",
|
|
31
|
+
"sqlalchemy>=2.0.43,<3",
|
|
32
|
+
"textual>=6.1.0,<9",
|
|
33
|
+
"typing-extensions>=4.5.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Homepage = "https://github.com/gslama12/todooit"
|
|
38
|
+
Documentation = "https://gslama12.github.io/todooit/"
|
|
39
|
+
Repository = "https://github.com/gslama12/todooit"
|
|
40
|
+
Issues = "https://github.com/gslama12/todooit/issues"
|
|
41
|
+
|
|
42
|
+
[project.scripts]
|
|
43
|
+
todooit = "todooit.__main__:main"
|
|
44
|
+
|
|
45
|
+
[dependency-groups]
|
|
46
|
+
dev = [
|
|
47
|
+
"coverage>=7.10.7",
|
|
48
|
+
"faker>=37.8.0",
|
|
49
|
+
"mypy>=1.19.1",
|
|
50
|
+
"pre-commit>=4.3.0",
|
|
51
|
+
"pytest>=8.4.2",
|
|
52
|
+
"pytest-asyncio>=1.2.0",
|
|
53
|
+
"pytest-timeout>=2.3.1",
|
|
54
|
+
"pytest-xdist>=3.6.1",
|
|
55
|
+
"ruff>=0.13.1",
|
|
56
|
+
"textual-dev>=1.7.0",
|
|
57
|
+
"types-pyperclip>=1.9.0.20250801",
|
|
58
|
+
"types-python-dateutil>=2.9.0.20260124",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[build-system]
|
|
62
|
+
requires = ["hatchling"]
|
|
63
|
+
build-backend = "hatchling.build"
|
|
64
|
+
|
|
65
|
+
[tool.hatch.build.targets.wheel]
|
|
66
|
+
packages = ["todooit"]
|
|
67
|
+
|
|
68
|
+
# Without this the sdist ships the whole repo (docs site, tests, scripts)
|
|
69
|
+
[tool.hatch.build.targets.sdist]
|
|
70
|
+
include = ["/todooit", "/README.md", "/LICENSE"]
|
|
71
|
+
|
|
72
|
+
[tool.pytest.ini_options]
|
|
73
|
+
asyncio_mode = "auto"
|
|
74
|
+
testpaths = ["tests"]
|
|
75
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
76
|
+
addopts = "--strict-markers"
|
|
77
|
+
# Applied by filename in the root conftest, not by hand -- see FEATURE_BY_MODULE.
|
|
78
|
+
# `pytest -m <feature>` is the mechanical form of CLAUDE.md's "only run tests
|
|
79
|
+
# relevant to the change"; --strict-markers turns a typo into an error rather
|
|
80
|
+
# than a run that quietly selects nothing.
|
|
81
|
+
markers = [
|
|
82
|
+
"core: pure-logic tests, no Textual app",
|
|
83
|
+
"ui: drives a real Todooit app through a pilot",
|
|
84
|
+
"smoke: the always-run sanity subset",
|
|
85
|
+
"model: the base model",
|
|
86
|
+
"todos: todos and the tasks pane",
|
|
87
|
+
"projects: projects and the projects pane",
|
|
88
|
+
"colors: project colors",
|
|
89
|
+
"fixed: Today/Upcoming/Completed/Bin",
|
|
90
|
+
"recycle: the recycle bin",
|
|
91
|
+
"undo: undo and redo",
|
|
92
|
+
"hooks: model hooks and validation",
|
|
93
|
+
"quickadd: quick add",
|
|
94
|
+
"links: links and the clipboard",
|
|
95
|
+
"dates: date parsing, recurrence, the calendar",
|
|
96
|
+
"notes: todo notes and the pinned note",
|
|
97
|
+
"theming: themes and CSS",
|
|
98
|
+
"persistence: paths, the database, sync polling",
|
|
99
|
+
"shell: app shell, navigation, cross-feature workflows",
|
|
100
|
+
"help: the help screen",
|
|
101
|
+
"bar: the status bar and its widgets",
|
|
102
|
+
"formatters: the render pipeline",
|
|
103
|
+
"move: moving and refiling",
|
|
104
|
+
"sort: sorting",
|
|
105
|
+
"search: search and goto",
|
|
106
|
+
"flash: flash mode (t) row labels",
|
|
107
|
+
"editing: inline editing and the cursor",
|
|
108
|
+
"config: the config API, loader and keys",
|
|
109
|
+
"lifecycle: the todo lifecycle and the one refresh signal",
|
|
110
|
+
"placement: where a todo lives (its home, root and bin row)",
|
|
111
|
+
"layout: the rows a pane draws (guides, blocks, context rows, banding)",
|
|
112
|
+
"migration: migrating a dooit database (migration/db_migration.py)",
|
|
113
|
+
"vim: the vim engine and the note editor it drives",
|
|
114
|
+
]
|
|
115
|
+
|
|
116
|
+
[tool.ruff.lint]
|
|
117
|
+
# An explicit set rather than ruff's defaults: those grow between releases,
|
|
118
|
+
# and ruff is unpinned here, so an upgrade would otherwise change the rules
|
|
119
|
+
select = [
|
|
120
|
+
"E4", "E7", "E9", "F", # pycodestyle errors + pyflakes (ruff's classic defaults)
|
|
121
|
+
"I", # import sorting
|
|
122
|
+
"B", # bugbear: likely bugs
|
|
123
|
+
"SIM", # simplifications
|
|
124
|
+
"PIE", # unnecessary code
|
|
125
|
+
"RUF100", # noqa comments that no longer suppress anything
|
|
126
|
+
]
|
|
127
|
+
# `== True` / `== False` is how SQLAlchemy filters are written
|
|
128
|
+
ignore = ["E712"]
|
|
129
|
+
|
|
130
|
+
[tool.mypy]
|
|
131
|
+
# `uv run mypy` with no arguments checks all of these
|
|
132
|
+
files = ["todooit", "migration", "tests", "conftest.py"]
|
|
133
|
+
# The oldest target mypy still accepts; requires-python says 3.9
|
|
134
|
+
python_version = "3.10"
|
|
135
|
+
# tests/ has no __init__.py, so the root conftest.py and
|
|
136
|
+
# tests/test_ui/conftest.py would both be module "conftest" without this
|
|
137
|
+
explicit_package_bases = true
|
|
138
|
+
# Most of the package is unannotated; without this mypy skips those bodies
|
|
139
|
+
check_untyped_defs = true
|
|
140
|
+
warn_unused_ignores = true
|
|
141
|
+
warn_redundant_casts = true
|
|
142
|
+
|
|
143
|
+
[tool.coverage.report]
|
|
144
|
+
omit = ["todooit/utils/default_config.py"]
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from importlib.metadata import version as _package_version
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
import click
|
|
7
|
+
|
|
8
|
+
from todooit.paths import DEV_HOME, HOME_ENV_VAR, config_file
|
|
9
|
+
|
|
10
|
+
# pyproject.toml is the one place the version is written
|
|
11
|
+
VERSION = _package_version("todooit")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def run_todooit(config: Optional[str] = None, db_path: Optional[str] = None):
|
|
15
|
+
config_path = None if not config else Path(config)
|
|
16
|
+
|
|
17
|
+
if config_path and not (config_path.exists() and config_path.is_file()):
|
|
18
|
+
print(f"Config file {config} not found.")
|
|
19
|
+
return
|
|
20
|
+
|
|
21
|
+
from todooit.api.note_migration import BackupFailed
|
|
22
|
+
from todooit.ui.tui import Todooit
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
app = Todooit(config=config_path, db_path=db_path)
|
|
26
|
+
except BackupFailed as error:
|
|
27
|
+
raise click.ClickException(str(error)) from error
|
|
28
|
+
|
|
29
|
+
app.run()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@click.group(
|
|
33
|
+
context_settings={"help_option_names": ["-h", "--help"]},
|
|
34
|
+
invoke_without_command=True,
|
|
35
|
+
)
|
|
36
|
+
@click.option(
|
|
37
|
+
"--version",
|
|
38
|
+
"-v",
|
|
39
|
+
is_flag=True,
|
|
40
|
+
help="Show version and exit.",
|
|
41
|
+
)
|
|
42
|
+
@click.option("-c", "--config", default=None, help="Path to config file")
|
|
43
|
+
@click.option("--db", default=None, help="Path to database file")
|
|
44
|
+
@click.option(
|
|
45
|
+
"--dev",
|
|
46
|
+
is_flag=True,
|
|
47
|
+
help="Run an isolated dev instance (own database, cache and config).",
|
|
48
|
+
)
|
|
49
|
+
@click.pass_context
|
|
50
|
+
def main(ctx, version: bool, config: str, db: str, dev: bool) -> None:
|
|
51
|
+
if version:
|
|
52
|
+
return print(f"todooit - {VERSION}")
|
|
53
|
+
|
|
54
|
+
# Must happen before anything imports the package: Todooit.CSS_PATH is
|
|
55
|
+
# evaluated in the class body, so the cache dir is resolved at import time.
|
|
56
|
+
# setdefault so an explicit TODOOIT_HOME still wins over --dev.
|
|
57
|
+
if dev:
|
|
58
|
+
os.environ.setdefault(HOME_ENV_VAR, str(DEV_HOME))
|
|
59
|
+
|
|
60
|
+
if ctx.invoked_subcommand is None:
|
|
61
|
+
run_todooit(config=config, db_path=db)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@main.command(help="Show config location.")
|
|
65
|
+
def config_loc() -> None:
|
|
66
|
+
"""Print the location of the configuration file."""
|
|
67
|
+
print(config_file())
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
main()
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from . import lifecycle
|
|
2
|
+
from .cadence import Cadence
|
|
3
|
+
from .fixed_projects import (
|
|
4
|
+
BIN,
|
|
5
|
+
TODAY,
|
|
6
|
+
UPCOMING,
|
|
7
|
+
FixedProject,
|
|
8
|
+
TodoGroup,
|
|
9
|
+
TodoRow,
|
|
10
|
+
binned_tasks,
|
|
11
|
+
fixed_project_from_id,
|
|
12
|
+
fixed_project_from_key,
|
|
13
|
+
fixed_projects,
|
|
14
|
+
)
|
|
15
|
+
from .history import ChangedRows, History
|
|
16
|
+
from .hooks import fix_hooks, validation_hooks
|
|
17
|
+
from .manager import manager
|
|
18
|
+
from .model import BaseModel, TodooitModel
|
|
19
|
+
from .pinned_note import PINNED_NOTE_ID, PinnedNote
|
|
20
|
+
from .project import Project
|
|
21
|
+
from .recycle import (
|
|
22
|
+
REVIVED_PREFIX,
|
|
23
|
+
empty_bin,
|
|
24
|
+
move_project_to_bin,
|
|
25
|
+
move_todo_to_bin,
|
|
26
|
+
restore_todo,
|
|
27
|
+
revive_home,
|
|
28
|
+
)
|
|
29
|
+
from .todo import (
|
|
30
|
+
SORT_KEYS,
|
|
31
|
+
Todo,
|
|
32
|
+
TodoSortModeType,
|
|
33
|
+
freeze_sort_order,
|
|
34
|
+
sort_todos,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def drop_blank_models() -> None:
|
|
39
|
+
"""
|
|
40
|
+
Delete childless items with a blank description (left over from quitting mid-edit)
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def is_blank(model) -> bool:
|
|
44
|
+
return not (model.description or "").strip()
|
|
45
|
+
|
|
46
|
+
for project in Project.all():
|
|
47
|
+
if is_blank(project) and not project.projects and not project.todos:
|
|
48
|
+
project.drop()
|
|
49
|
+
|
|
50
|
+
for todo in Todo.all():
|
|
51
|
+
if is_blank(todo) and not todo.todos:
|
|
52
|
+
todo.drop()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
__all__ = [
|
|
56
|
+
"BaseModel",
|
|
57
|
+
"TodooitModel",
|
|
58
|
+
"Cadence",
|
|
59
|
+
"Todo",
|
|
60
|
+
"TodoSortModeType",
|
|
61
|
+
"SORT_KEYS",
|
|
62
|
+
"sort_todos",
|
|
63
|
+
"freeze_sort_order",
|
|
64
|
+
"Project",
|
|
65
|
+
"PinnedNote",
|
|
66
|
+
"PINNED_NOTE_ID",
|
|
67
|
+
"FixedProject",
|
|
68
|
+
"TodoGroup",
|
|
69
|
+
"TodoRow",
|
|
70
|
+
"TODAY",
|
|
71
|
+
"UPCOMING",
|
|
72
|
+
"BIN",
|
|
73
|
+
"REVIVED_PREFIX",
|
|
74
|
+
"empty_bin",
|
|
75
|
+
"move_project_to_bin",
|
|
76
|
+
"move_todo_to_bin",
|
|
77
|
+
"restore_todo",
|
|
78
|
+
"revive_home",
|
|
79
|
+
"fixed_project_from_id",
|
|
80
|
+
"fixed_project_from_key",
|
|
81
|
+
"fixed_projects",
|
|
82
|
+
"binned_tasks",
|
|
83
|
+
"ChangedRows",
|
|
84
|
+
"History",
|
|
85
|
+
"manager",
|
|
86
|
+
"lifecycle",
|
|
87
|
+
"drop_blank_models",
|
|
88
|
+
"fix_hooks",
|
|
89
|
+
"validation_hooks",
|
|
90
|
+
]
|