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

Almost there, blocked by Terminal errors in ListBoxes #71

Merged
merged 26 commits into from
Sep 22, 2020

Conversation

d0c-s4vage
Copy link
Owner

fixes #29 , further development blocked by urwid/urwid#95

@d0c-s4vage d0c-s4vage added the stuck For stuck work label Feb 28, 2020
@d0c-s4vage
Copy link
Owner Author

urwid/urwid#95 is fixed now, waiting on a new urwid release to update requirements.txt

@d0c-s4vage
Copy link
Owner Author

Thanks to some prodding from new users (thanks @lanox!), I looked into the current state of things again and found that this is good to go!

@d0c-s4vage d0c-s4vage merged commit 13e89f6 into develop Sep 22, 2020
@d0c-s4vage d0c-s4vage deleted the feature/29-vertically_scrollable branch September 22, 2020 04:20
@m986883511
Copy link

I test it in your pull request , not work in python 3.9, am I something wrong?

(py39) [root@host177 tui_urwind_demo]# pip uninstall urwid -y
Found existing installation: urwid 2.1.1.dev0
Uninstalling urwid-2.1.1.dev0:
  Successfully uninstalled urwid-2.1.1.dev0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv


(py39) [root@host177 tui_urwind_demo]# cd pull/urwid/
(py39) [root@host177 urwid]# pip install -e .
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Obtaining file:///mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid
  Preparing metadata (setup.py) ... done
Installing collected packages: urwid
  Running setup.py develop for urwid
Successfully installed urwid-2.1.1.dev0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv


(py39) [root@host177 urwid]# python ../../src/tt.py 
Traceback (most recent call last):
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/../../src/tt.py", line 8, in <module>
    loop.run()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 287, in run
    self._run()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 385, in _run
    self.event_loop.run()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 790, in run
    self._loop()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 818, in _loop
    self._entering_idle()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 779, in _entering_idle
    callback()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 574, in entering_idle
    self.draw_screen()
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/main_loop.py", line 588, in draw_screen
    canvas = self._topmost_widget.render(self.screen_size, focus=True)
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/widget.py", line 145, in cached_render
    canv = fn(self, size, focus=focus)
  File "/mnt/smbshare/code/mine/tui_urwind_demo/pull/urwid/urwid/listbox.py", line 451, in render
    raise ListBoxError("Focus Widget %r at position %r within listbox calculated cursor coords %r but rendered cursor coords %r!" %(focus_widget,focus_pos,cursor,c_cursor))
urwid.listbox.ListBoxError: Focus Widget <BoxAdapter selectable flow widget <Terminal selectable box widget> height=20> at position 0 within listbox calculated cursor coords (0, 0) but rendered cursor coords (0, 2)!


(py39) [root@host177 urwid]# git branch -a
* (HEAD detached at origin/hotfix/95-vterm_in_listbox)
(py39) [root@host177 urwid]# cat ../../src/tt.py 
import urwid

container = urwid.ListBox([
    urwid.BoxAdapter(urwid.Terminal(["ping", '192.168.1.1']), 20),
])

loop = urwid.MainLoop(container)

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

Successfully merging this pull request may close these issues.

2 participants