Include port in console run hint
This PR adds the --port argument to the run hint provided by the Textual dev console.
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!
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'.
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?
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'
You have old code. Please update Textual abs textual-dev
You have old code. Please update Textual abs textual-dev
Well, sorry, my fault.
No worries!