Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Rasmus Bondesson
    @raek
    You can combine a bunch of text widgets (flow) into a pile (also flow) and then wrap the pile in a filler widget to "fill upp" the remaining screen rows (instead of wrapping each text widget)
    The main screen is a box widget.
    Also, regarding Pile vs ListBox: A ListBox is scrollable. Its children can add up to a height that far exceeds the height of the screen. A ListBox is a scrollable viewport of a list of widgets. The children might add up to fewer or more rows than the screen.
    A Pile has fixed height and does not do any scrolling what so ever.
    Etzeitet
    @Etzeitet

    Hi @raek thanks for the clarification. I did find that diagram, but it wasn't totally clear what the relationship of the colours were.

    • Does the relationship between contained widget type and container type you mention for Piles match the other container types that can be (and hold) multiple types?

    Put another way, could you substitute Columns in your statement above: "A Column is either 1) has flow children and is itself a flow widget, or 2) has box children and is itself a box widget"

    • Does the above hold for Decoration widgets?
    • Does a container's type follow from its contained widgets, or should/can we define the type? i.e., could I force a Pile to be a Box type (knowing it can then only hold Box type widgets)?
    Rasmus Bondesson
    @raek
    Not all decoration widgets work that way. For example, a ListBox is a Box widget that contains Flow widgets. The ones that have half the area in one color (blue) and the other half in another color (red) behave that way.
    I'm not 100% sure, but I think the "type" follows from top to bottom. The MainLoop expects a Pile widget to be a Box widget. Then the Pile widget expects its children to also be Box widgets. I don't think there is a way (yet) to force them to certain types.
    Jonatan Magnusson
    @jomag
    Hey! I just posted an issue, but I'll ask here as well: I need to display nested popups: I have a dialog, implemented as a popup, that contains a dropdown selection widget, which is also implemented as a popup. The selection widget works if not placed inside another popup, but does not show when placed in the dialog. So are nested popups not allowed?
    Sarthak Garg
    @Ezio-Sarthak

    Just over a week ago I asked if anyone knew the additional-urwid-widgets dev - specifically, that's since that includes a date picker, but we'd potentially like time too, and there's been no response for a couple of weeks to one PR - and longer to another. Does anyone know any other similar widgets or suggest a course of action?

    Commenting for better reach.

    Maxim Ivanov
    @ulidtko
    @Ezio-Sarthak there's indeed a bunch of packages with extended widgets on top of Urwid. @tonycpsu maintains some. But I'm not aware of specific date/time pickers...
    Sarthak Garg
    @Ezio-Sarthak
    @ulidtko thanks for the reply! We'll look into that :)
    Neil Pilgrim
    @neiljp
    @ulidtko The one I mentioned is on PyPI but it's unclear how maintained it is, though it's quite full-featured according to the docs.
    Sarthak Garg
    @Ezio-Sarthak
    How could I obtain the width and height of a column widget?
    Niteesh Babu G S
    @gs-niteesh

    Hii
    I am trying to build a chat application using urwid and asyncio, I have the server and basic UI ready. But sometimes the UI fails to start. It exits with an stack trace and exception

    TypeError: 'NoneType' object is not callable

    The stack trace is similar to haskellcamargo/sclack#4
    One of the comments there mentioned overloading the Asyncio event loop to use the default exception handler, I tried the same this time I get no exceptions but the app misbehaves sometimes it either doesn't send data or receive.
    Is there anything that I can do to find out what causes the exception?

    tonycpsu
    @tonycpsu

    How could I obtain the width and height of a column widget?

    Usually this requires overriding the render method and getting the values in the size tuple

    Is there anything that I can do to find out what causes the exception?

    Would need a stack trace showing urwid is involved to justify looking into this. Generic answer with something like this is to catch the exception and launch pdb or some other Python debugger when it's thrown.

    Niteesh Babu G S
    @gs-niteesh
    @tonycpsu Thanks, I was able to find the reason for the exception by implementing a custom exception handler for the AsyncioEventLoop
    heeplr
    @heeplr
    ahoy
    is there a way to increase the sensitive area of a button without making the label larger?
    i can click the button only right on the label text. When I add some \n to the label, I can click a larger area. I'd prefer the complete box area to be sensitive to mouse clicks.
    Niteesh Babu G S
    @gs-niteesh
    Hii, in multiline mode of urwid.Edit how can I escape the input?
    Niteesh Babu G S
    @gs-niteesh
    Let me elaborate on my problem.
    I want to use the Edit widget to input JSON. By default, in normal mode, when I paste formatted JSON in the input field, the newline character is treated as enter key by the widget and it updates the field. Whereas in multiline mode, I can paste the JSON correctly but now I am not able to update the field. What I want is the ability to paste JSON and on enter key update the field
    Currently in multiline mode I have to click on some other widget and press enter to update the input field
    Bahtiar Gadimov
    @kalkin
    Hi
    I want to display the colored output of git log -p in a Text widget, but it expects unformatted string and breaks the color formatting provided by git(1). Is there a simple way to display some already colored data in a widget providing scrolling?
    Neil Pilgrim
    @neiljp
    @gs-niteesh I suspect that pasted text is just treated as text input, so you'd need to switch into a paste-text mode or similar. We have a similar issue in our project I think.
    @kalkin Can you detect the special formatting provided in the colored git output and translate it into urwid style tokens?
    (palette entries)
    Bahtiar Gadimov
    @kalkin
    @neiljp I probably could, but this is what I'm trying to avoid. I just want to pass raw data
    Neil Pilgrim
    @neiljp
    I'm not aware of an existing approach for this. It strikes me as being outside of the remit of core urwid, though no doubt useful.
    To relate it to the pasting issue above, I'm not sure how pasting of color text would work either.
    Bahtiar Gadimov
    @kalkin
    @neiljp Thank you
    Milad Alizadeh
    @mi-lad_gitlab
    Noob question. I noticed that urwid.MainLoophas an event_loop argument. What is the usecase for this? When would I want a separate event loop?
    Also, the documentation for the argument says: if screen supports external an event loop it may be given here, I'm assuming external an should be an external?
    Sarthak Garg
    @Ezio-Sarthak
    I want to frequently update an item of a nested Columns widget. I tried first converting it into a list and then wrapping it into columns, however the display attributes (pack, weight, etc) are lost in the process. Is there a way to retain those attributes and still update the list??
    1 reply
    Neil Pilgrim
    @neiljp
    @tonycpsu Is there any ongoing work to fix the CI issues, presumably due to Travis having issues? Is there an internal-dev equivalent of this room?
    Neil Pilgrim
    @neiljp
    Our project has mostly moved to GH Actions now, due to that.
    tonycpsu
    @tonycpsu
    @neiljp : urwid/urwid#462 gets us part of the way there, but there are still some unresolved issues that make it not ready to merge
    I had some seemingly random failures when I tried to run via GH actions
    was waiting for a response from the author of that PR before proceeding, but at this point it might make sense just to see what happens
    as for a dev-only room... not sure there's much need for that given how light traffic is here
    Neil Pilgrim
    @neiljp
    I was mainly wondering if there was one; traffic may be light, but it groups it together. Also to clarify, I meant core urwid devs, not devs using urwid.
    tonycpsu
    @tonycpsu
    yeah, i don't really see the need for a dedicated room
    Neil Pilgrim
    @neiljp
    That's quite a lot of CI config; is that replicating Travis or doing more?
    Maxim Ivanov
    @ulidtko

    I'd wanted to raise the CI question too. Do we try to fix Travis, or do we migrate away from it?

    It's a bit scary to even attempt doing anything except the most basic merges without CI insurance. In particular, I was going to clean up the py2/3 mess the other day — but stopped pretty soon, due to CI down. Not that it's a big deal by itself, sure thing it's fixable; the bigger problem is the ambiguity & uncertainty around Travis, which has developed in recent months.

    And, switching CI system is not something I would singularly decide in a project. Thus eager to hear from you guys @wardi @tonycpsu

    Let's go for GH Actions I guess?.. CircleCI anyone?

    Ian Ward
    @wardi
    I like both GH Actions and CircleCI. Circle has "run with ssh" option that is kind of amazing. GH Actions pretty clean and run quickly
    Neil Pilgrim
    @neiljp
    Zulip went Travis -> Circle -> GH. The ssh aspect was definitely a sell, but not enough, and there were apparently ways around it.
    tonycpsu
    @tonycpsu
    I'd feel better about GH Actions if my first foray into it didn't result in builds that randomly fail for no explainable reason
    maybe that was just on my end, though
    if one of you guys could try to test urwid/urwid#462 and see if things look good, I'd support switching and dealing with any bugs in the CI config as we go
    Neil Pilgrim
    @neiljp
    I'm not familiar with the extra commits, or the intricacies of tox, but as an external observer/reviewer I'd really like to see the commit that adds the actions split up. It seems like it is combining porting the tests with extra features (eg. wheel building?).