Jim Britain wrote: > > Final integration: > > def identifyHost(self): > for line in self.fileContents: > if re.search("throttling", line.lower()): > p=r'\[((\d{1,3}\.){3}\d{1,3})\]' > ip=re.search(p,line)
A prudent pessimist might test for the complete absence of an IP address: if not ip: print "Huh?" # or whatever > if ip.group(1) in self.ignoreList: > continue > if not ip.group(1) in self.banList: > self.banList.append(ip.group(1)) > > -- http://mail.python.org/mailman/listinfo/python-list