This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Barney Stratford
Recipients Barney Stratford
Date 2015-07-26.10:57:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437908271.28.0.296512613048.issue24727@psf.upfronthosting.co.za>
In-reply-to
Content
I have a use case where a daemon thread needs to write periodic updates to sys.stdout. I'd prefer it not to print in the middle of a command being typed. In order to achieve this, I have added to the readline module. There is now a function to determine whether we are reading a line, and one to call rl_forced_update_display. These functions enable me to say (in the daemon thread):

def describe (indicator):
    if readline.reading_line ():
        print ()
        print (indicator.description)
        readline.forced_update_display ()
    else:
        print (indicator.description)


I have read PEP7, and have made patchtest on my patch.
History
Date User Action Args
2015-07-26 10:57:51Barney Stratfordsetrecipients: + Barney Stratford
2015-07-26 10:57:51Barney Stratfordsetmessageid: <1437908271.28.0.296512613048.issue24727@psf.upfronthosting.co.za>
2015-07-26 10:57:51Barney Stratfordlinkissue24727 messages
2015-07-26 10:57:51Barney Stratfordcreate