# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t
# 
# def YesNo(b):
#   if b:
#     return xlt("Yes")
#   else:
#     return xlt("No")


import adm
from wh import xlt, YesNo
from _imap import ImapServer
      self.connection.Login(self.user, self.password)
      self.flavor=self.connection.id.get('name', '').split()[0].lower()
    return self.connection

  
  def GetLastError(self):
    if self.connection and not self.connection.ok():
      return self.connection.lastError
    return None
  

  def GetProperties(self):
    if not self.properties:
      sec=self.settings['security']
      if sec.startswith('SSL'):
        pass
      elif sec.startswith('TLS'):
        if self.connection.tls:  sec="TLS"
        else:                    sec=xlt("unsecured connection")
        
      self.annotations=self.connection.GetAnnotations('')
        
      self.properties= [
         ( xlt("Name"),self.name),
         ( xlt("Protocol"), self.connection.PROTOCOL_VERSION),
         ( xlt("Address"), self.address),
         ( xlt("Security"), sec),
         ( xlt("Port"), self.settings["port"]),
         ( xlt("User"), self.user),
         ( xlt("Connected"), YesNo(self.IsConnected())),

# Path: wh.py
# def xlt(s): # translate
#   return s
#   t=wx.GetTranslation(s)
#   # if dict set and t == s: log untranslated
#   return t
# 
# def YesNo(b):
#   if b:
#     return xlt("Yes")
#   else:
#     return xlt("No")


# Path: modImap/Server.py
import adm
from wh import xlt, YesNo
from _imap import ImapServer

      self.connection.Login(self.user, self.password)
      self.flavor=self.connection.id.get('name', '').split()[0].lower()
    return self.connection

  
  def GetLastError(self):
    if self.connection and not self.connection.ok():
      return self.connection.lastError
    return None
  

  def GetProperties(self):
    if not self.properties:
      sec=self.settings['security']
      if sec.startswith('SSL'):
        pass
      elif sec.startswith('TLS'):
        if self.connection.tls:  sec="TLS"
        else:                    sec=xlt("unsecured connection")
        
      self.annotations=self.connection.GetAnnotations('')
        
      self.properties= [
         ( xlt("Name"),self.name),
         ( xlt("Protocol"), self.connection.PROTOCOL_VERSION),
         ( xlt("Address"), self.address),
         ( xlt("Security"), sec),
         ( xlt("Port"), self.settings["port"]),
         ( xlt("User"), self.user),
         ( xlt("Connected"), YesNo(self.IsConnected())),

         ( xlt("Autoconnect"), YesNo(self.settings.get('autoconnect'))),