File: //lib/python2.7/site-packages/offlineimap/ui/TTY.pyo
�
��Vc @ s� d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d e j f d � � YZ d e f d � � YZ
d S( i����N( t getpass( t banner( t UIBaset TTYFormatterc B s e Z d Z d � Z d � Z RS( sB Specific Formatter that adds thread information to the log output.c O s# t j j | | | � d | _ d S( N( t loggingt Formattert __init__t Nonet _last_log_thread( t selft argst kwargs( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyR s c C sg t j j | | � } | j } | d k r. | S| | j k rY | | _ d | | f } n
d | } | S( s* Override format to add thread information.t
MainThreads %s:
%ss %s( R R t formatt
threadNameR ( R t recordt log_strt t_name( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyR
! s
( t __name__t
__module__t __doc__R R
( ( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyR s t TTYUIc B s8 e Z d � Z d � Z d d � Z d � Z d � Z RS( c C sY t j � } t d � | _ | j | j � | j j | � | j j t � | j � | S( s� Backend specific console handler
Sets up things and adds them to self.logger.
:returns: The logging.Handler() for console outputs %(message)s(
R t
StreamHandlerR t formattert setFormattert loggert
addHandlert infoR t
createLock( R t ch( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyt setup_consolehandler5 s
c C s t j j � o t j j � S( s7 TTYUI is reported as usable when invoked on a terminal.( t syst stdoutt isattyt stdin( R ( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyt isusableH s c C sT | r | j d | | f � n | j j � z t d | � SWd | j j � Xd S( s2 TTYUI backend is capable of querying the password.s %s: %ss! Enter password for account '%s': N( t warnt _log_con_handlert acquireR t release( R t accountnamet configt errmsg( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyR M s
c C sG t t j � d t � r6 | j j d � | j � n
t j | � d S( Ni s8 Timer interrupted at user request; program terminating.
( t
isinstanceR t exc_infot KeyboardInterruptR R$ t terminateR t
mainException( R ( ( s6 /usr/lib/python2.7/site-packages/offlineimap/ui/TTY.pyR/ X s
c C sS | d k rO | d | | d k r? | j j d | d � n t j | � n d S( sY Sleep for sleepsecs, display remainingsecs to go.
Does nothing if sleepsecs <= 0.
Display a message on the screen if we pass a full minute.
This implementation in UIBase does not support this, but some
implementations return 0 for successful sleep and 1 for an
'abort', ie a request to sync immediately.i i<