Ian Ward | 7 Feb 2009 20:46
Favicon
Gravatar

Re: Suspend Urwid-Interface and Key-Combos with return?

Sorry I'm slow on these replies.

With raw_display (hg latest) you have to ask for bold, eg. "white,bold" 
instead of just "white".  Many terminals can display bright colours 
without making the text bold so I've tried to support that feature.

I also find bold text harder to read, so I really like this feature.

About the suspending, are you saying that it works properly with the 
raw_display module?

Ian

Christian Scharkus wrote:
> Hi there.
> 
> Well, thanks for your answer. I edited one of the examples from the 
> homepage to demonstrate the problem. Currently I'm using the latest hg 
> with the patch you've send earlier applied. It asks for input and 
> suspend the screen as long as links (or any other app) is running.
> 
> For my app I switched to raw_display because suspend is working at all 
> and there is no unicode-terminal required for utf-8-support afaik. But 
> why there is no bold text at all?
> 
> Thanks
> Christian
> 
> 2009/1/31 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>
> 
(Continue reading)

Christian Scharkus | 8 Feb 2009 16:41

Re: Suspend Urwid-Interface and Key-Combos with return?

Hi Ian

As far as I tried suspend worked good for me with raw.
I really would like to have bold text because the app I currently write is somehow a command-line-chat-client like irssi and the chat have got bold text format.

greetings
Christian

2009/2/7 Ian Ward <ian <at> excess.org>
Sorry I'm slow on these replies.

With raw_display (hg latest) you have to ask for bold, eg. "white,bold"
instead of just "white".  Many terminals can display bright colours
without making the text bold so I've tried to support that feature.

I also find bold text harder to read, so I really like this feature.

About the suspending, are you saying that it works properly with the
raw_display module?

Ian

Christian Scharkus wrote:
> Hi there.
>
> Well, thanks for your answer. I edited one of the examples from the
> homepage to demonstrate the problem. Currently I'm using the latest hg
> with the patch you've send earlier applied. It asks for input and
> suspend the screen as long as links (or any other app) is running.
>
> For my app I switched to raw_display because suspend is working at all
> and there is no unicode-terminal required for utf-8-support afaik. But
> why there is no bold text at all?
>
> Thanks
> Christian
>
> 2009/1/31 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>
>
>     Sounds like the terminal settings aren't being restored properly (echo
>     being left on, for instance).   Would you post a simple test script that
>     demonstrates the problem you are having?
>
>     Ian
>
>     Christian Scharkus wrote:
>      > Well ... the suspend is working now but there are still some small
>      > problems. As said before I start urwid with the wrapper-method. If I
>      > suspend the interface and restore it after the subprocess (I use
>     links
>      > for testing) is finished there are problems with the input. Letters
>      > are displayed twice in the input widget but submitted as the right
>      > string to the application. After a second suspend this problem
>      > vanishes. But then I quit the app after this the terminal isn't
>      > returned to correct input behavior and it seems that curses didn't
>      > exit right. If I start again without resetting the terminal
>     there's no
>      > problem with the input and suspending.
>      > For information: I'm using twisted as mainloop with a dummy
>      > filedescriptor so a try to redraw the screen is called everytime
>      > there's some input.
>      >
>      > Thanks for your help
>      > Christian
>      >
>      > 2009/1/20 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>:
>      >> Thanks Christian, it looks like a bug.  Try the attached patch.
>      >>
>      >> Ian
>      >>
>      >> Christian Scharkus wrote:
>      >>> Hi Ian.
>      >>>
>      >>> I tried to call stop() and 20 seconds afterwards start() but stop()
>      >>> seems to have no effect at all and start() drops an AssertionError.
>      >>> I use urwid-0.9.8.3hg149 with twisted as mainloop called with
>      >>> run_wrapper(). I hope you can help me.
>      >>>
>      >>> Christian Scharkus
>      >>>
>      >>> 2009/1/18 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>:
>      >>>> Christian Scharkus wrote:
>      >>>>> Hi folks.
>      >>>>> It's time for some more questions I think :D
>      >>>>>
>      >>>>> I would like to know if there is any possibility to suspend the
>      >>>>> curses_display of urwid to start something like links from my
>     app to
>      >>>>> show websites etc.
>      >>>> Yes, you can use curses_display.Screen.stop() and start()
>      >>>>
>      >>>>> Second it would be nice to have keycombos given from
>     get_input() like
>      >>>>> "shift enter", "ctrl enter" because I would like to be able
>     to make some
>      >>>>> newlines in the chat-client I currently write.
>      >>>> I don't think a regular terminal app can detect shift-enter and
>      >>>> ctrl-enter.  When I run "input_test.py" I see only a single
>     "10" value
>      >>>> from the terminal when I press enter regardless of shift and
>     ctrl state.
>      >>>>
>      >>>> It would be possible to detect the shift and ctrl state with some
>      >>>> trickery like connecting to the X server where the app is
>     running, but
>      >>>> Urwid doesn't try doing that at the moment.
>      >>>>
>      >>>> Ian
>      >>>>
>      >>>>
>      >>>> _______________________________________________
>      >>>> Urwid mailing list
>      >>>> Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
>      >>>> http://lists.excess.org/mailman/listinfo/urwid
>      >>>>
>      >>>>
>      >>>
>      >>> _______________________________________________
>      >>> Urwid mailing list
>      >>> Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
>      >>> http://lists.excess.org/mailman/listinfo/urwid
>      >>>
>      >>
>      >> _______________________________________________
>      >> Urwid mailing list
>      >> Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
>      >> http://lists.excess.org/mailman/listinfo/urwid
>      >>
>      >>
>      >
>      >
>      > _______________________________________________
>      > Urwid mailing list
>      > Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
>      > http://lists.excess.org/mailman/listinfo/urwid
>      >
>
>
>
>     _______________________________________________
>     Urwid mailing list
>     Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
>     http://lists.excess.org/mailman/listinfo/urwid
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Urwid mailing list
> Urwid <at> lists.excess.org
> http://lists.excess.org/mailman/listinfo/urwid



_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid


_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
Ian Ward | 8 Feb 2009 17:04
Favicon
Gravatar

Re: Suspend Urwid-Interface and Key-Combos with return?

If you're using the latest version from hg you can get bold and 
underline by adding ",bold" and/or ",underline" to the foreground colour 
definition.

Christian Scharkus wrote:
> Hi Ian
> 
> As far as I tried suspend worked good for me with raw.
> I really would like to have bold text because the app I currently write 
> is somehow a command-line-chat-client like irssi and the chat have got 
> bold text format.
> 
> greetings
> Christian
> 
> 2009/2/7 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>
> 
>     Sorry I'm slow on these replies.
> 
>     With raw_display (hg latest) you have to ask for bold, eg. "white,bold"
>     instead of just "white".  Many terminals can display bright colours
>     without making the text bold so I've tried to support that feature.
> 
>     I also find bold text harder to read, so I really like this feature.
> 
>     About the suspending, are you saying that it works properly with the
>     raw_display module?
> 
>     Ian
Christian Scharkus | 8 Feb 2009 18:00

Re: Suspend Urwid-Interface and Key-Combos with return?

Well ... neither gnome-terminal nor xterm or my framebuffer seems to bold the text with this options added :/

2009/2/8 Ian Ward <ian <at> excess.org>
If you're using the latest version from hg you can get bold and
underline by adding ",bold" and/or ",underline" to the foreground colour
definition.

Christian Scharkus wrote:
> Hi Ian
>
> As far as I tried suspend worked good for me with raw.
> I really would like to have bold text because the app I currently write
> is somehow a command-line-chat-client like irssi and the chat have got
> bold text format.
>
> greetings
> Christian
>
> 2009/2/7 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>
>
>     Sorry I'm slow on these replies.
>
>     With raw_display (hg latest) you have to ask for bold, eg. "white,bold"
>     instead of just "white".  Many terminals can display bright colours
>     without making the text bold so I've tried to support that feature.
>
>     I also find bold text harder to read, so I really like this feature.
>
>     About the suspending, are you saying that it works properly with the
>     raw_display module?
>
>     Ian



_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid


_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
Ian Ward | 11 Feb 2009 03:30
Favicon
Gravatar

Re: Suspend Urwid-Interface and Key-Combos with return?

if works in my tests with xterm and gnome-terminal, are you including
the ",bold" in the palette definition like this?:
https://excess.org/hg/urwid/file/a5314d585db4/palette_test.py#l137

If so could you post some code?

Ian

Christian Scharkus wrote:
> Well ... neither gnome-terminal nor xterm or my framebuffer seems to
> bold the text with this options added :/
> 
> 2009/2/8 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>
> 
>     If you're using the latest version from hg you can get bold and
>     underline by adding ",bold" and/or ",underline" to the foreground colour
>     definition.
> 
>     Christian Scharkus wrote:
>     > Hi Ian
>     >
>     > As far as I tried suspend worked good for me with raw.
>     > I really would like to have bold text because the app I currently
>     write
>     > is somehow a command-line-chat-client like irssi and the chat have got
>     > bold text format.
>     >
>     > greetings
>     > Christian
>     >
>     > 2009/2/7 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>
>     <mailto:ian <at> excess.org <mailto:ian <at> excess.org>>>
>     >
>     >     Sorry I'm slow on these replies.
>     >
>     >     With raw_display (hg latest) you have to ask for bold, eg.
>     "white,bold"
>     >     instead of just "white".  Many terminals can display bright
>     colours
>     >     without making the text bold so I've tried to support that
>     feature.
>     >
>     >     I also find bold text harder to read, so I really like this
>     feature.
>     >
>     >     About the suspending, are you saying that it works properly
>     with the
>     >     raw_display module?
>     >
>     >     Ian
> 
> 
> 
>     _______________________________________________
>     Urwid mailing list
>     Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
>     http://lists.excess.org/mailman/listinfo/urwid
> 
> 
> 
> ------------------------------------------------------------------------
> 
> This body part will be downloaded on demand.
Alagu Madhu | 11 Feb 2009 07:57
Picon

No module named termios

Hi

I am using python 26 on windows XP .



D:\urwid>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 31, in <module>
    import urwid
  File "D:\urwid\urwid\__init__.py", line 51, in <module>
    from graphics import *
  File "D:\urwid\urwid\graphics.py", line 30, in <module>
    from display_common import AttrSpec
  File "D:\urwid\urwid\display_
common.py", line 22, in <module>
    import termios
ImportError: No module named termios




Thanks


Madhu
_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
Ian Ward | 11 Feb 2009 08:29
Favicon
Gravatar

Re: No module named termios

Alagu Madhu wrote:
> Hi
> 
> I am using python 26 on windows XP .
> 
...
> ImportError: No module named termios

http://docs.python.org/library/termios.html#module-termios
---
Platforms: Unix

Windows doesn't have a POSIX terminal.  You can run Urwid under Windows
using Cygwin using the included terminal (poor) or with xterm (excellent).

It would be nice to have a windows_display module one day, but for now
you need to run Urwid remotely on a Linux/BSD/MacOS system or by using
Cygwin.

Regards,
Ian
Christian Scharkus | 11 Feb 2009 13:20

Re: Suspend Urwid-Interface and Key-Combos with return?

Well. It works now. But it's a little bit strange to include the bold with the color and in the mono-var.

Thanks
Christian

2009/2/11 Ian Ward <ian <at> excess.org>
if works in my tests with xterm and gnome-terminal, are you including
the ",bold" in the palette definition like this?:
https://excess.org/hg/urwid/file/a5314d585db4/palette_test.py#l137

If so could you post some code?

Ian

Christian Scharkus wrote:
> Well ... neither gnome-terminal nor xterm or my framebuffer seems to
> bold the text with this options added :/
>
> 2009/2/8 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>>
>
>     If you're using the latest version from hg you can get bold and
>     underline by adding ",bold" and/or ",underline" to the foreground colour
>     definition.
>
>     Christian Scharkus wrote:
>     > Hi Ian
>     >
>     > As far as I tried suspend worked good for me with raw.
>     > I really would like to have bold text because the app I currently
>     write
>     > is somehow a command-line-chat-client like irssi and the chat have got
>     > bold text format.
>     >
>     > greetings
>     > Christian
>     >
>     > 2009/2/7 Ian Ward <ian <at> excess.org <mailto:ian <at> excess.org>
>     <mailto:ian <at> excess.org <mailto:ian <at> excess.org>>>
>     >
>     >     Sorry I'm slow on these replies.
>     >
>     >     With raw_display (hg latest) you have to ask for bold, eg.
>     "white,bold"
>     >     instead of just "white".  Many terminals can display bright
>     colours
>     >     without making the text bold so I've tried to support that
>     feature.
>     >
>     >     I also find bold text harder to read, so I really like this
>     feature.
>     >
>     >     About the suspending, are you saying that it works properly
>     with the
>     >     raw_display module?
>     >
>     >     Ian
>
>
>
>     _______________________________________________
>     Urwid mailing list
>     Urwid <at> lists.excess.org <mailto:Urwid <at> lists.excess.org>
> ------------------------------------------------------------------------
>
> This body part will be downloaded on demand.



_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid


_______________________________________________
Urwid mailing list
Urwid <at> lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid
Ian Ward | 11 Feb 2009 14:36
Favicon
Gravatar

Re: Suspend Urwid-Interface and Key-Combos with return?

Christian Scharkus wrote:
> Well. It works now. But it's a little bit strange to include the bold 
> with the color and in the mono-var.
> 

The mono settings only apply in monochrome mode, (foreground, 
background) in 16-colour mode, an (high_foreground, high_background) in 
high colour modes.  I'll try to make it clearer in the docs.

Ian
Max E. Kuznecov | 21 Feb 2009 03:11

A proper way to clear the screen?

Hi, I wonder what is the proper way to clear the screen after
urwid is initialzed?
What I need is something like mc does - the panels are displayed on the
screen but before command execution the screen must be cleared.

As for now I switch back to saved termios settings using tcsetattr and
then write "\x1b[H\x1b[2J" to stdout (a cl property from termcap for
xterm). It works but I worry about different terminal types with
(possibly) different cl codes.

Maybe it would be more portable if I first clear the screen using urwid
facilities and then go to shell mode, but I've found none in docs.

Thanks.

--

-- 
~syhpoon

Gmane