Commits

customdesigned  committed 2d5d171

Get rid of obsolete string module

  • Participants
  • Parent commits 242ffea
  • Branches pydns-2_3

Comments (0)

Files changed (3)

 # ------------------------------------------------------------------------
 
 
-import string, types
+import types
 
 import Type
 import Class
         # The case of the first occurrence of a name is preserved.
         # Redundant dots are ignored.
         list = []
-        for label in string.splitfields(name, '.'):
+        for label in name.split('.'):
             if not label:
                 raise PackError, 'empty label'
             list.append(label)
         keys = []
         for i in range(len(list)):
-            key = string.upper(string.joinfields(list[i:], '.'))
+            key = '.'.join(list[i:]).upper()
             keys.append(key)
             if self.index.has_key(key):
                 pointer = self.index[key]
             h['opcode'],h['status'],h['id'])
         flags=filter(lambda x,h=h:h[x],('qr','aa','rd','ra','tc'))
         print ';; flags: %s; Ques: %d, Ans: %d, Auth: %d, Addit: %d'%(
-            string.join(flags),h['qdcount'],h['ancount'],h['nscount'],
+            ''.join(flags),h['qdcount'],h['ancount'],h['nscount'],
             h['arcount'])
         print ';; QUESTIONS:'
         for q in self.questions:
     testpacker()
 #
 # $Log$
+# Revision 1.11.2.9  2011/03/21 21:03:22  customdesigned
+# Get rid of obsolete string module
+#
 # Revision 1.11.2.8  2011/03/16 20:06:39  customdesigned
 # Refer to explicit LICENSE file.
 #
 
 # routines for lazy people.
 import Base
-import string
 
 from Base import DNSError
 
 def revlookupall(name):
     "convenience routine for doing a reverse lookup of an address"
     # FIXME: check for IPv6
-    a = string.split(name, '.')
+    a = name.split('.')
     a.reverse()
-    b = string.join(a, '.')+'.in-addr.arpa'
+    b = '.'.join(a)+'.in-addr.arpa'
     names = dnslookup(b, qtype = 'ptr')
     # this will return all records.
     names.sort(key=str.__len__)
 
 #
 # $Log$
+# Revision 1.5.2.5  2011/03/21 21:03:22  customdesigned
+# Get rid of obsolete string module
+#
 # Revision 1.5.2.4  2011/03/19 22:15:01  customdesigned
 # Added rotation of name servers - SF Patch ID: 2795929
 #

File DNS/win32dns.py

           License analog to the current Python license
 """
 
-import string, re
+import re
 import _winreg
 
 def binipdisplay(s):
         ip=[]
         for j in s1:
             ip.append(str(ord(j)))
-        ol.append(string.join(ip,'.'))
+        ol.append('.'.join(ip))
     return ol
 
 def stringdisplay(s):
 
 #
 # $Log$
+# Revision 1.3.2.2  2011/03/21 21:03:22  customdesigned
+# Get rid of obsolete string module
+#
 # Revision 1.3.2.1  2007/05/22 20:26:49  customdesigned
 # Fix win32 nameserver discovery.
 #