# 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 _dns import BindConnection



class Server(adm.ServerNode):
  shortname=xlt("BIND Server")
  typename=xlt("BIND Server")

  def __init__(self, settings):
    adm.ServerNode.__init__(self, settings)
    self.zones=adm.config.Read(self.name, [], self, "Zones")
    self.revzones=adm.config.Read(self.name, [], self, "Revzones")
    self.stats=None
    self.knownZones=[]
    self.lastError=None
    self.bindVersion=None
    self.views={}
    self.serverStats=[]
    self.serverBoot=None
    self.viewzones={}
    
  def GetSubzones(self, node, rev=False):
    zones=[]
    if node == self:
      parentZone=None
    else:
      parentZone=".%s" % node.zonename
    
    for zone in self.knownZones:
      if not parentZone and zone.lower().endswith( ('.in-addr.arpa', '.ip6.arpa')) != rev:
        continue 

# 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: modBind/Server.py
import adm
from wh import xlt, YesNo
from _dns import BindConnection




class Server(adm.ServerNode):
  shortname=xlt("BIND Server")
  typename=xlt("BIND Server")

  def __init__(self, settings):
    adm.ServerNode.__init__(self, settings)
    self.zones=adm.config.Read(self.name, [], self, "Zones")
    self.revzones=adm.config.Read(self.name, [], self, "Revzones")
    self.stats=None
    self.knownZones=[]
    self.lastError=None
    self.bindVersion=None
    self.views={}
    self.serverStats=[]
    self.serverBoot=None
    self.viewzones={}
    
  def GetSubzones(self, node, rev=False):
    zones=[]
    if node == self:
      parentZone=None
    else:
      parentZone=".%s" % node.zonename
    
    for zone in self.knownZones:
      if not parentZone and zone.lower().endswith( ('.in-addr.arpa', '.ip6.arpa')) != rev:
        continue 

      if not parentZone or zone.endswith(parentZone):