urwid

How to create nested listboxes in urwid?

醉酒当歌 提交于 2019-12-19 19:03:58
问题 Is it possible to put ListBoxes inside of SimpleListWalkers ? I'm trying to make nested ListBoxes, but I have this error : AttributeError: 'MyListBox' object has no attribute 'rows' import urwid class MyListBox(urwid.ListBox): def focus_next(self): try: self.body.set_focus(self.body.get_next(self.body.get_focus()[1])[1]) except: pass def focus_previous(self): try: self.body.set_focus(self.body.get_prev(self.body.get_focus()[1])[1]) except: pass def handle_input(event): frame.header.set_text(

'AttributeError' while trying to create a console screen using urwid

陌路散爱 提交于 2019-12-18 09:45:37
问题 code below creates a layout and displays some text in the layout. Next the layout is displayed on the console screen using raw display module from urwid library. (More info on my complete project can be gleaned from questions at widget advice for a console project and urwid for a console project. My skype help request being here.) However running the code fails as an AttributeError is raised as described below. On looking at source code for urwid at /usr/lib64/python2.7/site-packages/urwid I

main function call fails in python

ぃ、小莉子 提交于 2019-12-13 01:27:51
问题 I wrote the following code that creates a layout and displays some text in the layout. Next the layout is displayed on the console screen using raw display module from urwid library. However running the code fails as it doesn't find the function main that I wrote separately in a class. Error code on running is : Traceback (most recent call last): File "./yamlUrwidUIPhase5.py", line 89, in <module> main() File "./yamlUrwidUIPhase5.py", line 83, in main FormDisplay().main() AttributeError:

How to indicate that a urwid listbox has more items than displayed at the moment?

一曲冷凌霜 提交于 2019-12-11 00:36:44
问题 Is there a way to show a user that a urwid listbox has additional items above / below the dispalyed section? I'm thinking of something like a scrollbar that gives an idea of the number of entries. Or a separate bar at the top / bottom of the list box. If this behavior can not be implemented, what approaches are there to achieve this notification? During my research, I found this question, which tried to achieve eventually the same. The given answer seems to check if all elements are visible.

Urwid: make cursor invisible

╄→гoц情女王★ 提交于 2019-12-10 04:35:24
问题 I'm using urwid, which is a Python "framework" for designing terminal user interfaces in ncurses. There's one thing though that I'm not able to do in urwid that was easy in curses - make the cursor invisible. As it is now, the cursor is visible when selecting buttons, and it just looks plain ugly. Is there a way to disable it? 回答1: urwid uses the curs_set function, but does not expose it as a class method anywhere. Someone could modify urwid to allow using this method; otherwise there's no

How do you combine multiple TUI forms to write more complex applications?

落爺英雄遲暮 提交于 2019-12-09 12:56:02
问题 I would like to write a program with a T ext-based U ser I nterface (TUI) that consists of several forms. The first form contains a "list". Each list element represents a button. If the respective button is pressed, another form should appear in which one can enter the data for the list entry. Then the first form is displayed again (with updated list entries). Here is my attempt, which uses the library npyscreen but does not return to the first form. The code does also not contain the logic

Urwid: how to see errors?

霸气de小男生 提交于 2019-12-06 15:53:10
I am building application with interactive console interface (line htop, atop utilities) using urwid library, so my trouble is: as interface takes all the space in console window - I could not see python's errors, I tried to do that: import sys f = open("test_err", "w") original_stderr = sys.stderr sys.stderr = f print a #a is undefined sys.stderr = original_stderr f.close() It works when I dont use urwid, but not when I use it... you could try redirecting errors to a file. after each time you run the program, you will need to refresh the file. most editors let you easily do this by pushing f5

How to make a chat like UI using Python Urwid? [closed]

给你一囗甜甜゛ 提交于 2019-12-04 01:52:36
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago . I alreay can implement chat daemons using gevent and zeromq, but I'd like to make a console UI for them. My first attempt with ncurses failed, so I tried Urwid and found out that the project nigiri was going exactly what I wanted: I studied the source code, but being unfamiliar

How to create nested listboxes in urwid?

做~自己de王妃 提交于 2019-12-01 17:44:16
Is it possible to put ListBoxes inside of SimpleListWalkers ? I'm trying to make nested ListBoxes, but I have this error : AttributeError: 'MyListBox' object has no attribute 'rows' import urwid class MyListBox(urwid.ListBox): def focus_next(self): try: self.body.set_focus(self.body.get_next(self.body.get_focus()[1])[1]) except: pass def focus_previous(self): try: self.body.set_focus(self.body.get_prev(self.body.get_focus()[1])[1]) except: pass def handle_input(event): frame.header.set_text("key pressed %s" % event) if event == "q": raise urwid.ExitMainLoop elif event == "up": lb.focus

Python ncurses, CDK, urwid difference

家住魔仙堡 提交于 2019-11-29 23:01:24
What's the difference between these 3? As far as I understand it they both provide binding to curses which is the C library for terminal text-based UI. I currently have no knowledge of any of the 3 and I've never used curses. Which one would you recommend? I've heard of ncurses many times but only once or twice about CDK (through research) and never heard of urwid (I think). What I get after looking at some references is: ncurses : It's a free software version of curses, so you have to deal with all kind low-level details. pyCDK : It's a higher level library that provides some widgets. I haven