-í
 „æ>c       sœ   d  k  Z d  k Z d  k Z d  k Z d  k Z d  k Z d  k Z d k l Z h  d d <d d <d d <a	 e
 a d „  Z d	 „  Z d
 f  d „  ƒ  YZ d  S(   N(   s   StringIOs   IMAP protocol debuggings   imaps   Maildir repository debuggings   maildirs   Threading debuggings   threadc    s
   |  a d  S(   N(   s   newuis   globalui(   s   newui(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   setglobalui s     c      s   t  Sd  S(   N(   s   globalui(    (    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getglobalui s     s   UIBasec      sµ  t  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z d	 „  Z	 e
 d
 „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e
 d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d  „  Z! d! „  Z" d" „  Z# d# „  Z$ d$ „  Z% d% „  Z& d& „  Z' d' „  Z( d( „  Z) d) „  Z* d* „  Z+ d+ „  Z, d d, „ Z- d- „  Z. d. „  Z/ d/ „  Z0 RS(0   Ni    c    sC   | |  _  | |  _ g  |  _ h  |  _ d |  _ h  |  _ t |  _ d  S(   Ni2   (	   s   verboses   ss   configs	   debuglists   debugmessagess   debugmsglens   threadaccountss   Nones   logfile(   s   ss   configs   verbose(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   __init__$ s    						c    s   |  i | ƒ |  i | ƒ d S(   s(   Generic tool called when no other works.N(   s   ss   _logs   msgs   _display(   s   ss   msg(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   _msg. s     c    s@   |  i o. |  i i d t i ƒ  i ƒ  | f ƒ d Sn d Sd S(   sM   Log it to disk.  Returns true if it wrote something; false
        otherwise.s   %s: %s
i   i    N(   s   ss   logfiles   writes	   threadings   currentThreads   getNames   msg(   s   ss   msg(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   _log3 s
     
&c    su   | |  _ | i d t i i t i i t i i f ƒ | i d t	 i ƒ | i d t	 i
 ƒ | i d t	 i ƒ d  S(   Ns   This is %s %s %s
s   Python: %s
s   Platform: %s
s	   Args: %s
(   s   logfds   ss   logfiles   writes   offlineimaps   versions   productnames
   versionstrs   revstrs   syss   platforms   argv(   s   ss   logfd(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   setlogfd< s
    	,c    s
   t  ‚ d S(   s   Display a message.N(   s   NotImplementedError(   s   ss   msg(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   _displayF s     c    s1   | o |  i d | ƒ n |  i d | ƒ d  S(   Ns	   warning: s	   WARNING: (   s   minors   ss   _msgs   msg(   s   ss   msgs   minor(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   warnJ s    c    s_   |  i i t i ƒ  ƒ o/ t d t i ƒ  i ƒ  |  i |  ƒ | f ‚ n | |  i t i ƒ  <d S(   sX   Provides a hint to UIs about which account this particular
        thread is processing.s-   Thread %s already registered (old %s, new %s)N(	   s   ss   threadaccountss   has_keys	   threadings   currentThreads
   ValueErrors   getNames   getthreadaccounts   account(   s   ss   account(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   registerthreadP s     /c    s%   |  i i | ƒ o |  i | =n d S(   s   Recognizes a thread has exited.N(   s   ss   threadaccountss   has_keys   thr(   s   ss   thr(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   unregisterthreadY s     c    sB   | o t i ƒ  } n |  i i | ƒ o |  i | Sn d Sd  S(   Ns   *Control(   s   thrs	   threadings   currentThreads   ss   threadaccountss   has_key(   s   ss   thr(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getthreadaccount^ s
    c    sæ   t  i ƒ  } |  i i | ƒ o" |  i | i d | | f ƒ n d | | f g |  i | <x: t	 |  i | ƒ |  i
 j o |  i | d |  i | <q^ W| |  i j o: |  i d | | f ƒ o |  i d | | f ƒ n n d  S(   Ns   %s: %si   s   DEBUG[%s]: %s(   s	   threadings   currentThreads
   thisthreads   ss   debugmessagess   has_keys   appends	   debugtypes   msgs   lens   debugmsglens	   debuglists   _logs   _display(   s   ss	   debugtypes   msgs
   thisthread(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   debuge s    " c    sT   | t j o6 | |  i j o! |  i i | ƒ |  i | ƒ n n |  i | ƒ d  S(   N(   s	   debugtypes
   debugtypess   ss	   debuglists   appends	   debuggings   invaliddebug(   s   ss	   debugtype(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys	   add_debugs s     c    s   |  i d | t | f ƒ d  S(   Ns   Now debugging for %s: %s(   s   ss   _msgs	   debugtypes
   debugtypes(   s   ss	   debugtype(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys	   debugging| s     c    s   |  i d | ƒ d  S(   Ns   Invalid debug type: %s(   s   ss   warns	   debugtype(   s   ss	   debugtype(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   invaliddebug€ s    c    s   t  d ‚ d  S(   NsB   Another OfflineIMAP is running with the same metadatadir; exiting.(   s	   Exception(   s   s(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   lockedƒ s    c    s3   t  | i ƒ i d ƒ d } t i d d | ƒ Sd  S(   Ns   .iÿÿÿÿs   (Folder|Repository)s    (   s   strs   objects	   __class__s   splits
   prelimnames   res   sub(   s   ss   objects
   prelimname(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getnicename† s    c    s   d Sd S(   sÈ   Returns true if this UI object is usable in the current
        environment.  For instance, an X GUI would return true if it's
        being run in X with a valid DISPLAY setting, and false otherwise.i   N(    (   s   s(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   isusable‹ s     c    s
   t  ‚ d  S(   N(   s   NotImplementedError(   s   ss   accountnames   configs   errmsg(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getpass“ s    c    sK   d i  g  i } | D]) } | d |  i | ƒ | i ƒ  f ƒ q ~ ƒ Sd  S(   Ns   , s   %s[%s](   s   joins   appends   _[1]s   lists   xs   ss   getnicenames   getname(   s   ss   lists   _[1]s   x(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys
   folderlist– s     c    sX   t  i d d ƒ o t  i d d ƒ o- |  i d | |  i | ƒ | i ƒ  f ƒ n d  S(   Ns   generals   ignore-readonlysƒ   Attempted to synchronize message %d to folder %s[%s], but that folder is read-only.  The message will not be copied to that folder.(	   s   configs
   has_options
   getbooleans   ss   warns   uids   getnicenames
   destfolders   getname(   s   ss
   destfolders   uids   contents   flags(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   msgtoreadonlyš s    'c    s^   t  i d d ƒ o t  i d d ƒ o3 |  i d t | ƒ |  i | ƒ | i	 ƒ  f ƒ n d  S(   Ns   generals   ignore-readonlysˆ   Attempted to modify flags for messages %s in folder %s[%s], but that folder is read-only.  No flags have been modified for that message.(
   s   configs
   has_options
   getbooleans   ss   warns   strs   uidlists   getnicenames
   destfolders   getname(   s   ss
   destfolders   uidlists   flags(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   flagstoreadonlyŸ s    'c    s^   t  i d d ƒ o t  i d d ƒ o3 |  i d t | ƒ |  i | ƒ | i	 ƒ  f ƒ n d  S(   Ns   generals   ignore-readonlys~   Attempted to delete messages %s in folder %s[%s], but that folder is read-only.  No messages have been deleted in that folder.(
   s   configs
   has_options
   getbooleans   ss   warns   strs   uidlists   getnicenames
   destfolders   getname(   s   ss
   destfolders   uidlist(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   deletereadonly¤ s    'c    s+   |  i d j o |  i t i i ƒ n d S(   s÷   Called when the UI starts.  Must be called before any other UI
        call except isusable().  Displays the copyright banner.  This is
        where the UI should do its setup -- TK, for instance, would
        create the application window here.i    N(   s   ss   verboses   _msgs   offlineimaps   versions   banner(   s   s(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   init_banner« s     c    s™   |  i d j  o d  Sn | t j o
 d } n | t j o d t | ƒ } n d | | f } | d j o
 | t j o
 d } n |  i d | ƒ d  S(   Ni    s    s   :%ss	    to %s%s.s   .s   Establishing connection(   s   ss   verboses   hostnames   Nones   ports   strs
   displaystrs   _msg(   s   ss   hostnames   ports
   displaystr(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys
   connecting³ s    

c    s)   |  i d j o |  i d | ƒ n d  S(   Ni    s   ***** Processing account %s(   s   ss   verboses   _msgs   accountname(   s   ss   accountname(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   acct¿ s    c    s)   |  i d j o |  i d | ƒ n d  S(   Ni    s"   ***** Finished processing account (   s   ss   verboses   _msgs   accountname(   s   ss   accountname(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   acctdoneÃ s    c    sA   |  i d j o- |  i d |  i | ƒ |  i | ƒ f ƒ n d  S(   Ni    s&   Copying folder structure from %s to %s(   s   ss   verboses   _msgs   getnicenames   srcreposs	   destrepos(   s   ss   srcreposs	   destrepos(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   syncfoldersÇ s    c    sJ   |  i d j o6 |  i d | i ƒ  |  i | ƒ |  i | ƒ f ƒ n d S(   s/   Called when a folder sync operation is started.i    s   Syncing %s: %s -> %sN(   s   ss   verboses   _msgs	   srcfolders   getnames   getnicenames   srcreposs	   destrepos(   s   ss   srcreposs	   srcfolders	   destreposs
   destfolder(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   syncingfolderÍ s     c    s$   |  i d | i ƒ  | | f ƒ d  S(   NsB   UID validity problem for folder %s (saved %d; got %d); skipping it(   s   ss   warns   folders   getnames   saveds   new(   s   ss   folders   saveds   new(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   validityproblemÔ s    c    s>   |  i d j o* |  i d |  i | ƒ | i ƒ  f ƒ n d  S(   Ni    s   Loading message list for %s[%s](   s   ss   verboses   _msgs   getnicenames   reposs   folders   getname(   s   ss   reposs   folder(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   loadmessagelistØ s    c    sA   |  i d j o- |  i d |  i | ƒ | i ƒ  | f ƒ n d  S(   Ni    s+   Message list for %s[%s] loaded: %d messages(   s   ss   verboses   _msgs   getnicenames   reposs   folders   getnames   count(   s   ss   reposs   folders   count(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   messagelistloadedÝ s    c    sS   |  i d j o? |  i d |  i | ƒ | i ƒ  |  i | ƒ | i ƒ  f ƒ n d  S(   Ni    s!   Syncing messages %s[%s] -> %s[%s](	   s   ss   verboses   _msgs   getnicenames   srs   sfs   getnames   drs   df(   s   ss   srs   sfs   drs   df(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   syncingmessagesä s    c    sS   |  i d j o? |  i | ƒ } |  i d | |  i | ƒ | i	 ƒ  | f ƒ n d  S(   Ni    s   Copy message %d %s[%s] -> %s(
   s   ss   verboses
   folderlists   destlists   dss   _msgs   uids   getnicenames   srcs   getname(   s   ss   uids   srcs   destlists   ds(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   copyingmessageë s    c    s>   |  i d j o* |  i | ƒ } |  i d | | f ƒ n d  S(   Ni    s   Deleting message %d in %s(   s   ss   verboses
   folderlists   destlists   dss   _msgs   uid(   s   ss   uids   destlists   ds(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   deletingmessageñ s    c  	  sw   |  i d j oc |  i | ƒ } |  i d t | ƒ d i g  i	 } | D] } | t | ƒ ƒ qE ~ ƒ | f ƒ n d  S(   Ni    s   Deleting %d messages (%s) in %ss   , (   s   ss   verboses
   folderlists   destlists   dss   _msgs   lens   uidlists   joins   appends   _[1]s   us   str(   s   ss   uidlists   destlists   _[1]s   us   ds(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   deletingmessagesö s    &c    sP   |  i d j o< |  i | ƒ } |  i d d i | ƒ t | ƒ | f ƒ n d  S(   Ni    s%   Adding flags %s to %d messages  on %ss   , (
   s   ss   verboses
   folderlists   destlists   dss   _msgs   joins   flagss   lens   uidlist(   s   ss   uidlists   flagss   destlists   ds(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   addingflagsþ s    c    sP   |  i d j o< |  i | ƒ } |  i d d i | ƒ t | ƒ | f ƒ n d  S(   Ni    s&   Deleting flags %s to %d messages on %ss   , (
   s   ss   verboses
   folderlists   destlists   dss   _msgs   joins   flagss   lens   uidlist(   s   ss   uidlists   flagss   destlists   ds(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   deletingflagss    c    sl   |  i i | ƒ oA d t |  i | ƒ | i ƒ  f } | d i |  i | ƒ 7} n d | i ƒ  } | Sd  S(   Ns:   
Last %d debug messages logged for %s prior to exception:
s   
s&   
No debug messages were logged for %s.(   s   ss   debugmessagess   has_keys   threads   lens   getNames   messages   join(   s   ss   threads   message(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getThreadDebugLogs
    #c    s%   |  i i | ƒ o |  i | =n d  S(   N(   s   ss   debugmessagess   has_keys   thread(   s   ss   thread(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   delThreadDebugLogs    c    s;   d | i ƒ  | i ƒ  f } | d |  i | ƒ 7} | Sd  S(   Ns)   Thread '%s' terminated with exception:
%ss   
(   s   threads   getNames   getExitStackTraces   messages   ss   getThreadDebugLog(   s   ss   threads   message(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getThreadExceptionStrings    c    s4   |  i |  i | ƒ ƒ |  i | ƒ |  i d ƒ d S(   s{   Called when a thread has terminated with an exception.
        The argument is the ExitNotifyThread that has so terminated.id   N(   s   ss   _msgs   getThreadExceptionStrings   threads   delThreadDebugLogs	   terminate(   s   ss   thread(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   threadException s     c    sB   t  ƒ  } t i d | ƒ d | i ƒ  d |  i t i ƒ  ƒ Sd  S(   Ns   files(   Main program terminated with exception:
s   
(	   s   StringIOs   sbufs	   tracebacks	   print_excs   getvalues   ss   getThreadDebugLogs	   threadings   currentThread(   s   ss   sbuf(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   getMainExceptionString's    	c    s   |  i |  i ƒ  ƒ d  S(   N(   s   ss   _msgs   getMainExceptionString(   s   s(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   mainException.s    c    s   t  i | ƒ d S(   s$   Called to terminate the application.N(   s   syss   exits
   exitstatus(   s   ss
   exitstatus(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys	   terminate1s     c    s   |  i | ƒ |  i | ƒ d S(   sR   Called when a thread has exited normally.  Many UIs will
        just ignore this.N(   s   ss   delThreadDebugLogs   threads   unregisterthread(   s   ss   thread(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   threadExited5s     c    sW   d } x6 | d j o | o  |  i d | ƒ } | d 8} q	 W|  i d d ƒ | Sd S(   sP  This function does not actually output anything, but handles
        the overall sleep, dealing with updates as necessary.  It will,
        however, call sleeping() which DOES output something.

        Returns 0 if timeout expired, 1 if there is a request to cancel
        the timer, and 2 if there is a request to abort the program.i    i   N(   s
   abortsleeps	   sleepsecss   ss   sleeping(   s   ss	   sleepsecss
   abortsleep(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   sleep=s      c    s7   |  i d | ƒ | d j o t i | ƒ n d Sd S(   s¿   Sleep for sleepsecs, remainingsecs to go.
        If sleepsecs is 0, indicates we're done sleeping.

        Return 0 for normal sleep, or 1 to indicate a request
        to sync immediately.s   Next refresh in %d secondsi    N(   s   ss   _msgs   remainingsecss	   sleepsecss   times   sleep(   s   ss	   sleepsecss   remainingsecs(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   sleepingLs
     (1   s   __name__s
   __module__s   __init__s   _msgs   _logs   setlogfds   _displays   warns   registerthreads   unregisterthreads   Nones   getthreadaccounts   debugs	   add_debugs	   debuggings   invaliddebugs   lockeds   getnicenames   isusables   getpasss
   folderlists   msgtoreadonlys   flagstoreadonlys   deletereadonlys   init_banners
   connectings   accts   acctdones   syncfolderss   syncingfolders   validityproblems   loadmessagelists   messagelistloadeds   syncingmessagess   copyingmessages   deletingmessages   deletingmessagess   addingflagss   deletingflagss   getThreadDebugLogs   delThreadDebugLogs   getThreadExceptionStrings   threadExceptions   getMainExceptionStrings   mainExceptions	   terminates   threadExiteds   sleeps   sleeping(    (    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   UIBase# s\   
				
																																
							(   s   offlineimap.versions   offlineimaps   res   times   syss	   tracebacks	   threadings   threads   StringIOs
   debugtypess   Nones   globaluis   setglobaluis   getglobaluis   UIBase(   s   getglobaluis	   tracebacks   threads   StringIOs   offlineimaps	   threadings   syss   res   UIBases   setglobaluis   time(    (    s=   /usr/pkg/lib/python2p2/site-packages/offlineimap/ui/UIBase.pys   ? s   	6!		