-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Crash on adding a workspace (only first?) #161
Comments
Ah this must be due to py 3.8, I think I fixed it but didn't merge into main Edit: The PyPi package is not updated. Doing rn |
Done! Can you re-check? |
Ah damn I need to bump textual as well. Gimme 5 mins :D |
One more try :D |
Ok what did you do ? |
|
Hmmm...That's weird. Can't replicate the same behaviour |
Can you copy paste the whole error and paste it here/somewhere else? |
PS C:\Users\f8808> dooit
╭─────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────╮
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\screens\index.py:59 in on_key │
│ │
│ 56 │ │ event.stop() │
│ 57 │ │ │
│ 58 │ │ key = self.resolve_key(event) │
│ ❱ 59 │ │ await self.send_keypress(key) │
│ 60 │ │
│ 61 │ async def send_keypress(self, key: str): │
│ 62 │ │ if self.bar.status == "SEARCH": │
│ │
│ ╭───────────────────────────── locals ─────────────────────────────╮ │
│ │ event = Key(key='a', character='a', name='a', is_printable=True) │ │
│ │ key = 'a' │ │
│ │ self = MainScreen(name='main') │ │
│ ╰──────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\screens\index.py:66 in send_keypress │
│ │
│ 63 │ │ │ return await self.query_one(Searcher).keypress(key) │
│ 64 │ │ │
│ 65 │ │ visible_focused = [i for i in self.query(".focus") if i.display][0] │
│ ❱ 66 │ │ await visible_focused.keypress(key) │
│ 67 │ │
│ 68 │ async def clear_right(self) -> None: │
│ 69 │ │ try: │
│ │
│ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮ │
│ │ key = 'a' │ │
│ │ self = MainScreen(name='main') │ │
│ │ visible_focused = WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31') │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\widgets\tree.py:493 in keypress │
│ │
│ 490 │ │ if self.current and self.current._is_editing(): │
│ 491 │ │ │ return await self.current.keypress(key) │
│ 492 │ │ │
│ ❱ 493 │ │ await super().keypress(key) │
│ 494 │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ key = 'a' │ │
│ │ self = WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31') │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\widgets\base.py:42 in keypress │
│ │
│ 39 │ │ │ │ if bind.check_for_cursor and not self.is_cursor_available: │
│ 40 │ │ │ │ │ return │
│ 41 │ │ │ │ │
│ ❱ 42 │ │ │ │ res = await func(*bind.params) │
│ 43 │ │ │ │ if isinstance(res, Result) and res.message: │
│ 44 │ │ │ │ │ self.post_message(Notify(res.text())) │
│ 45 │
│ │
│ ╭──────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────╮ │
│ │ bind = <dooit.utils.keybinder.Bind object at 0x00000273752D49A0> │ │
│ │ func = <bound method Tree.add_sibling of WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31')> │ │
│ │ key = 'a' │ │
│ │ self = WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31') │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\widgets\tree.py:370 in add_sibling │
│ │
│ 367 │ │ await self.add_node("child") │
│ 368 │ │
│ 369 │ async def add_sibling(self) -> None: │
│ ❱ 370 │ │ await self.add_node("sibling") │
│ 371 │ │
│ 372 │ async def toggle_expand(self) -> None: │
│ 373 │ │ if not self.current: │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ self = WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31') │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\widgets\tree.py:295 in add_node │
│ │
│ 292 │ │ self, type_: Literal["child", "sibling"], edit: bool = True │
│ 293 │ ) -> None: │
│ 294 │ │ if not self.get_children(self.model) or not self.current: │
│ ❱ 295 │ │ │ return await self.add_first_child() │
│ 296 │ │ │
│ 297 │ │ if type_ == "child" and not self.current.expanded: │
│ 298 │ │ │ self.current.toggle_expand() │
│ │
│ ╭─────────────────────────────────── locals ────────────────────────────────────╮ │
│ │ edit = True │ │
│ │ self = WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31') │ │
│ │ type_ = 'sibling' │ │
│ ╰───────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\ui\widgets\tree.py:285 in add_first_child │
│ │
│ 282 │ │ │ self.styles.overflow_x = "auto" │
│ 283 │ │ │ await i.remove() │
│ 284 │ │ │
│ ❱ 285 │ │ child = self.model.add_child(self.ModelType.class_kind) │
│ 286 │ │ new_widget = self.WidgetType(child) │
│ 287 │ │ await self.mount(new_widget) │
│ 288 │ │ self.current = new_widget │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ i = EmptyWidget() │ │
│ │ self = WorkspaceTree(id='Tree-manager_cbdf80c9-f486-4b40-814a-783521584d31') │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\api\model.py:249 in add_child │
│ │
│ 246 │ │ │ │ child._effort._value = 0 │
│ 247 │ │ │ │ child.edit("status", "PENDING") │
│ 248 │ │ │
│ ❱ 249 │ │ children = self._get_children(kind) │
│ 250 │ │ children.insert(index, child) │
│ 251 │ │ │
│ 252 │ │ return child │
│ │
│ ╭──────────────────────────────── locals ─────────────────────────────────╮ │
│ │ child = <dooit.api.todo.Todo object at 0x00000273751E76A0> │ │
│ │ index = 0 │ │
│ │ inherit = False │ │
│ │ kind = <bound method ? of <class 'dooit.api.workspace.Workspace'>> │ │
│ │ self = <dooit.api.manager.Manager object at 0x0000027374ED0AF0> │ │
│ │ Todo = <class 'dooit.api.todo.Todo'> │ │
│ │ Workspace = <class 'dooit.api.workspace.Workspace'> │ │
│ ╰─────────────────────────────────────────────────────────────────────────╯ │
│ │
│ C:\Users\f8808\AppData\Local\pipx\pipx\venvs\dooit\lib\site-packages\dooit\api\model.py:126 in _get_children │
│ │
│ 123 │ │ Get children list (workspace/todo) │
│ 124 │ │ """ │
│ 125 │ │ if kind not in ["workspace", "todo"]: │
│ ❱ 126 │ │ │ raise TypeError(f"Cannot perform this operation for type {kind}") │
│ 127 │ │ │
│ 128 │ │ return self.workspaces if kind.lower() == "workspace" else self.todos │
│ 129 │
│ │
│ ╭────────────────────────────── locals ──────────────────────────────╮ │
│ │ kind = <bound method ? of <class 'dooit.api.workspace.Workspace'>> │ │
│ │ self = <dooit.api.manager.Manager object at 0x0000027374ED0AF0> │ │
│ ╰────────────────────────────────────────────────────────────────────╯ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Cannot perform this operation for type <bound method ? of <class 'dooit.api.workspace.Workspace'>> |
Ugh, not sure what's going on here. Looks like you're on a windows machine so lemme try that :) |
Hmm...Can you retry by getting the latest win binary and temporarily remove any configurations that you might've made in the config file :) |
pip install dooit
still get TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
win binary works, thank you! |
Awesome. It's really weird tho |
Did we solve your problem? Consider sponsoring my work through github sponsors 😄 |
Describe the bug 🐛
Install by
pip install dooit
turns out it contains old code.To Reproduce 🐣
Steps to reproduce the behavior:
pip install dooit
Expected behavior 🤔
Program can't launch
Desktop (please complete the following information): 🤖
Python
Additional context 📝
Require manual change the code(from pip install originally) from
to
After the change, the program is able to launch
The text was updated successfully, but these errors were encountered: