def __parse(self, e, leave): for item in e: rule = Rule(leave) for child in item: if child.tag == 'from': rule.from_address = child.text if child.tag == 'to': rule.to_address = child.text if child.tag == 'cc': rule.cc_address = child.text if child.tag == 'subject': rule.subject = child.text if child.tag == 'content': rule.content = child.text if leave: self.__leave.append(rule) else: self.__discard.append(rule) Logger.info(str(rule))