textual-dev icon indicating copy to clipboard operation
textual-dev copied to clipboard

Include port in console run hint

Open rafraser opened this issue 2 years ago • 6 comments

This PR adds the --port argument to the run hint provided by the Textual dev console.

image

Unfortunately, something I'm working on also uses port 8081, so whenever I'm using the Textual console I'm always using a different port. This is a pretty minor addition but it'd make things ever-so-slightly easier for me!

rafraser avatar Jul 26 '23 02:07 rafraser

I've stumbled over the same problem. Currently I'm using the pull request sources to use the --dev mode but would like to switch back to the regular version as I face problems with 'textual keys'.

steven-r avatar Aug 30 '23 08:08 steven-r

I've stumbled over the same problem. Currently I'm using the pull request sources to use the --dev mode but would like to switch back to the regular version as I face problems with 'textual keys'.

This PR displays the port, but it doesn't implement the --dev switch which has existed for months. What problem are you having with textual keys?

willmcgugan avatar Aug 30 '23 08:08 willmcgugan

This PR displays the port, but it doesn't implement the --dev switch which has existed for months. What problem are you having with textual keys?

This was misleading... I wanted to refer to the --port-option. When using the this branch and starttextual keys, I get the following stacktrace:

  File "/Users/.../Documents/GitHub/mybook/venv/bin/textual", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/textual_dev/cli.py", line 225, in keys
    from textual_dev.previews import KeysApp
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/textual_dev/previews/__init__.py", line 6, in <module>
    from .keys import KeysApp
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/textual_dev/previews/keys.py", line 11, in <module>
    from textual.widgets import Button, Header, TextLog
  File "/Users/.../Documents/GitHub/mybook/venv/lib/python3.11/site-packages/textual/widgets/__init__.py", line 96, in __getattr__
    raise ImportError(f"Package 'textual.widgets' has no class '{widget_class}'")
ImportError: Package 'textual.widgets' has no class 'TextLog'

steven-r avatar Aug 31 '23 18:08 steven-r

You have old code. Please update Textual abs textual-dev

willmcgugan avatar Aug 31 '23 19:08 willmcgugan

You have old code. Please update Textual abs textual-dev

Well, sorry, my fault.

steven-r avatar Sep 01 '23 15:09 steven-r

No worries!

willmcgugan avatar Sep 01 '23 15:09 willmcgugan