def cbMailboxList(result, proto):
 result = [e[2] for e in result]
 s = '\n'.join([('%d. %s' % ((n + 1), m)) for (n, m) in zip(range(len(result)), result)])
 if (not s):
  return defer.fail(Exception('No mailboxes exist on server!'))
 return proto.prompt((s + '\nWhich mailbox? [1] ')).addCallback(cbPickMailbox, proto, result)

def cbMailboxList ( result , proto ) : result = [ e [ 2 ] for e in result ] s = '\n' . join ( [ ( '%d. %s' % ( ( n + 1 ) , m ) ) for ( n , m ) in zip ( range ( len ( result ) ) , result ) ] ) if ( not s ) : return defer . fail ( Exception ( 'No mailboxes exist on server!' ) ) return proto . prompt ( ( s + '\nWhich mailbox? [1] ' ) ) . addCallback ( cbPickMailbox , proto , result )
callback invoked when a list of mailboxes has been retrieved .