def validSuperPeerList(self, superpeer_info):
     try:
         if len(superpeer_info) < 3:
             raise RuntimeError, "one line in superpeers.txt contains at least 3 elements"
         #validIP(superpeer_info[0])
         validPort(int(superpeer_info[1]))
         validPermid(superpeer_info[2])
     except Exception:
         if DEBUG:
             print >> sys.stderr, "superpeer: Parse error reading", superpeer_info
             print_exc(file=sys.stderr)
         return False
     else:
         return True
 def validSuperPeerList(self, superpeer_info):
     try:
         if len(superpeer_info) < 3:
             raise RuntimeError, "one line in superpeers.txt contains at least 3 elements"
         # validIP(superpeer_info[0])
         validPort(int(superpeer_info[1]))
         validPermid(superpeer_info[2])
     except Exception:
         if DEBUG:
             print >> sys.stderr, time.asctime(), "-", "superpeer: Parse error reading", superpeer_info
             print_exc(file=sys.stderr)
         return False
     else:
         return True
Beispiel #3
0
 def validFriendList(self, friend_info):
     try:
         if len(friend_info) < 4:
             raise RuntimeError, "one line in friends.txt can only contain at least 4 elements"
         validName(friend_info[0])
         validPermid(friend_info[1])
         validIP(friend_info[2])
         validPort(int(friend_info[3]))
     except Exception, msg:
         if DEBUG:
             print "======== reading friend list error ========"
             print friend_info
             print msg
             print "==========================================="
         return False