Exemple #1
0
  def Delete(self, _parentWin, names, types):
    node=self.lastNode
    updater=node.Updater()
    for i in range(len(names)):
      if isinstance(types, list):
        type=types[i]
      else:
        type=types
      updater.delete(names[i], type)

    msg=node.GetServer().Send(updater)
    if msg.rcode() != rcode.NOERROR:
      self.SetStatus(xlt("DNS delete failed: %s") % rcode.to_text(msg.rcode()))
      return False
    for i in range(len(names)):
      name=names[i]
      if isinstance(types, list):
        rdtype=rdatatype.from_text(types[i])
        rdsl=node.others.get(name)
        if rdsl:
          if rdtype in rdsl:
            del rdsl[rdtype]
      elif types == rdatatype.CNAME:
        if node.cnames.get(name):
          del node.cnames[name]
      elif types == rdatatype.PTR:  
        if node.ptrs.get(name):
          del node.ptrs[name]
    return True
Exemple #2
0
 def GetDataType(self, idx):
   while idx >= 0:
     txt=self.control.GetItemText(idx, 1)
     if txt:
       return rdatatype.from_text(txt)
     idx -= 1
   return None
Exemple #3
0
 def OnExecute(parentWin, page):
   rdtype=None
   rtypes=[]
   for type in prioTypes:
     rtypes.append("%s - %s" % (type, DnsSupportedTypes[type]))
   for type in sorted(DnsSupportedTypes.keys()):
     if type not in prioTypes and type not in individualTypes:
       rtypes.append("%s - %s" % (type, DnsSupportedTypes[type]))
     
   dlg=wx.SingleChoiceDialog(parentWin, xlt("record type"), "Select record type", rtypes)
   if dlg.ShowModal() == wx.ID_OK:
     rdtype=rdatatype.from_text(dlg.GetStringSelection().split(' ')[0])
     dlg=page.EditDialog(rdtype)(parentWin, page.lastNode, "", rdtype)
     dlg.page=page
     if dlg.GoModal():
       page.Display(None, False)
Exemple #4
0
 def OnExecute(parentWin, page):
   rdtype=rdatatype.from_text(page.GetDnsType())
   dlg=page.EditDialog(None)(parentWin, page.lastNode, "", rdtype)
   dlg.page=page
   if dlg.GoModal():
     page.Display(None, False)