Support both asyncio and synchronous callers

2020-07-26 Thread Damian Johnson
Hi. I'm the author of Stem, Tor's python library [1]. Recently we migrated to asyncio, but desire to still be usable by synchronous callers. We wrote a mixin [2][3] that transparently makes any class usable by both asyncio and synchronous callers... ===

Re: Detecting Remaining Thread

2011-01-19 Thread Damian Johnson
Disregard, I figured it out. It turns out that the threads spawned by "thread.start_new_thread" are unreported by threading.enumerate. Cheers! -Damian On Wed, Jan 19, 2011 at 9:40 AM, Damian Johnson wrote: > Hi, I've been trying to track down a familiar concurrency problem >

Detecting Remaining Thread

2011-01-19 Thread Damian Johnson
Hi, I've been trying to track down a familiar concurrency problem without any success: Unhandled exception in thread started by Error in sys.excepthook: Original exception was: I realize that this is due to a background thread still being alive and kicking when the application terminates (ie, a m

Curses Subwin Resizing

2009-05-22 Thread Damian Johnson
Hi, I've been trying to make a curses application that's resilient to having the terminal resized (like 'top'). I've managed to make it capable of adjusting when the screen's width is changed (using getmaxyx) but changing the height is proving a little trickier. I'm using subwindows so I can select

Re: Python 3.0 Curses Unicode

2008-12-30 Thread Damian Johnson
Just resolved the issue (turned out to be an issue with linked ncurses libraries). If others run into this discussion of the solution can be found at: http://bugs.python.org/issue4787 Cheers! -Damian On Mon, Dec 29, 2008 at 10:30 PM, Damian Johnson wrote: > It seems as if the curses module

Re: Python 3.0 Curses Unicode

2008-12-29 Thread Damian Johnson
le-curses'. The getlocale function is reporting the proper values ('en_US', 'UTF8') but addstr is clearly not treating it as Unicode - is this a bug? -Damian 2008/12/28 Damian Johnson > Hi, I've switched to Python 3.0 for a new Japanese vocab quizzing > application d

Python 3.0 Curses Unicode

2008-12-28 Thread Damian Johnson
Hi, I've switched to Python 3.0 for a new Japanese vocab quizzing application due to its much improved Unicode support. However, I'm running into an issue with displaying Unicode characters via curses. In Python 2.x a simple hello-world looks like: #!/usr/bin/python # coding=UTF-8 import curses i

Curses Blank Background

2008-12-10 Thread Damian Johnson
Does anyone know how to instruct the Python curses bindings to leave the background alone (use the default terminal background)? I'm interested in keeping my semi-transparent background which curses can't replicate. This question was raised on this list before ( http://mail.python.org/pipermail/pyt

Unicode equality from raw_input

2008-10-11 Thread Damian Johnson
Hi, when getting text via the raw_input method it's always a string (even if it contains non-ASCII characters). The problem lies in that whenever I try to check equality against a Unicode string it fails. I've tried using the unicode method to 'cast' the string to the Unicode type but this throws a