Skip to content
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

Error while populate is running for the summ-example #3

Closed
ursuad opened this issue Feb 19, 2023 · 11 comments
Closed

Error while populate is running for the summ-example #3

ursuad opened this issue Feb 19, 2023 · 11 comments

Comments

@ursuad
Copy link

ursuad commented Feb 19, 2023

Hi, I'm just running the summ-example command.
If I click on the screen while the populate is running (on the interface and on the name of the text files on the left), I get the following error and the program crashes:

summ-example
Starting up, please hold...
ACTION select_cursor DirectoryTree(pseudo_classes={'focus', 'focus-within', 'hover'})
ACTION select_cursor DirectoryTree(pseudo_classes={'focus', 'focus-within', 'hover'})
ACTION select_cursor DirectoryTree(pseudo_classes={'focus', 'focus-within', 'hover'})
╭───────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────────╮
│ /opt/homebrew/Cellar/summ-lib/0.1.14/libexec/lib/python3.11/site-packages/summ/cli/widgets/output_tree.py:84 in _on_node                                                                                     │
│                                                                                                                                                                                                              │
│    81 │                                                                                                                                                                                                      │
│    82 │   def _on_node(self, entry: Node):                                                                                                                                                                   │
│    83 │   │   self.log(entry)                                                                                                                                                                                │
│ ❱  84 │   │   self.screen.post_message_no_wait(self.UpdateTokens(self, Chain.tokens_used()))                                                                                                                 │
│    85 │   │                                                                                                                                                                                                  │
│    86 │   │   if entry.parent:                                                                                                                                                                               │
│    87 │   │   │   parent = self.nodes.get(entry.parent)                                                                                                                                                      │
│                                                                                                                                                                                                              │
│ ╭────────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────╮                       │
│ │ entry = Entry(                                                                                                                                                                     │                       │
│ │         │   thread=1204907,                                                                                                                                                        │                       │
│ │         │   color='magenta',                                                                                                                                                       │                       │
│ │         │   indent=1,                                                                                                                                                              │                       │
│ │         │   title='Document [?/12]',                                                                                                                                               │                       │
│ │         │   text='c2534',                                                                                                                                                          │                       │
│ │         │   parent=Entry(                                                                                                                                                          │                       │
│ │         │   │   thread=1204907,                                                                                                                                                    │                       │
│ │         │   │   color=None,                                                                                                                                                        │                       │
│ │         │   │   indent=2,                                                                                                                                                          │                       │
│ │         │   │   title='',                                                                                                                                                          │                       │
│ │         │   │   text='Counted, a sea lion, is undergoing a delicate brain surgery. The surgeons and nu'+173,                                                                       │                       │
│ │         │   │   parent=None                                                                                                                                                        │                       │
│ │         │   )                                                                                                                                                                      │                       │
│ │         )                                                                                                                                                                          │                       │
│ │  self = OutputTree(id='output-tree')                                                                                                                                               │                       │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                       │
│                                                                                                                                                                                                              │
│ /opt/homebrew/Cellar/summ-lib/0.1.14/libexec/lib/python3.11/site-packages/textual/dom.py:358 in screen                                                                                                       │
│                                                                                                                                                                                                              │
│   355 │   │   while node is not None and not isinstance(node, Screen):                         ╭───────────────── locals ─────────────────╮                                                                  │
│   356 │   │   │   node = node._parent                                                          │   node = None                            │                                                                  │
│   357 │   │   if not isinstance(node, Screen):                                                 │ Screen = <class 'textual.screen.Screen'> │                                                                  │
│ ❱ 358 │   │   │   raise NoScreen("node has no screen")                                         │   self = OutputTree(id='output-tree')    │                                                                  │
│   359 │   │   return node                                                                      ╰──────────────────────────────────────────╯                                                                  │
│   360 │                                                                                                                                                                                                      │
│   361 │   @property                                                                                                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NoScreen: node has no screen
@yasyf
Copy link
Owner

yasyf commented Feb 19, 2023

Looking into it!

@yasyf
Copy link
Owner

yasyf commented Feb 20, 2023

@ursuad what version of python are you using?

@francisverhoeven
Copy link

I'm having the same issue @yasyf.

python --version returns Python 2.7.16
python3 --version returns Python 3.8.9

@francisverhoeven
Copy link

francisverhoeven commented Mar 9, 2023

Actually, after lots of updating & upgrading, I'm getting a different error.

pyenv is set to 3.11.2

Running "summ-example", everything works until I click the "populate" button. Then it loads for 50%, and returns the following error:

CleanShot 2023-03-10 at 00 11 51@2x

CleanShot 2023-03-10 at 00 17 06@2x

Would really love to try this out (code isn't my strong suit unfortunately)

@jeffcatania
Copy link

I am getting the same error. I suspect that the current main branch / v0.1.14 is broken.

The Screen class does not have a post_message_no_wait method.

Similarly, if I comment out the erroneous line, I get a new error. This error points to the calling function not having the same number of positional arguments as expected.
image

Is there a stable version that I can revert to?

@jeffcatania
Copy link

Following up from my previous post, it looks like textual has updated its API in version 0.14 to drop the ‘post_no_wait’ method. My current suspicion is that this error is caused by incorrect dependency versioning.

https://textual.textualize.io/blog/2023/03/09/textual-0140-shakes-up-posting-messages/

@yasyf
Copy link
Owner

yasyf commented Mar 16, 2023

@jeffcatania ah, that'll do it. I'll pin the dependency

@yasyf
Copy link
Owner

yasyf commented Mar 16, 2023

@willmcgugan breaking changes without a major version bump! grumble grumble 😛

Textualize/textual#1940

@willmcgugan
Copy link

Textual is zero ver, so it is best to pin or keep a close eye on the release notes...

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

@yasyf yasyf closed this as completed in 592b42a Mar 16, 2023
@yasyf
Copy link
Owner

yasyf commented Mar 16, 2023

@willmcgugan fair enough! will do :)

@yasyf
Copy link
Owner

yasyf commented Mar 16, 2023

@jeffcatania should be fixed in 0.1.16!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants