def __str__(self):
        result = "IMAPSearch('%s'" % self.op
        if self.op in (self.OP_AND, self.OP_OR):
            elt = []
            for search in self.args['search_key']:
                elt.append(str(search))
            result += ', [%s]' % ', '.join(elt)
        elif self.op in (self.OP_NOT):
            result += ', search_key = %s' % self.args['search_key']
        elif self.op in (self.OP_BEFORE, self.OP_ON, self.OP_SENTON,
                         self.OP_SENTBEFORE, self.OP_SENTSINCE, self.OP_SINCE):
            result += ', date = "%s"' % self.args['date']
        elif self.op in (self.OP_LARGER, self.OP_SMALLER):
            result += ', n = %d' % self.args['n']
        elif self.op in (self.OP_TEXT, self.OP_BODY):
            result += ', string = "%s"' % self.args['string']
        elif self.op in (self.OP_HEADER):
            result += ', header = "%s", string = "%s"' % (self.args['header'],
                                                          self.args['string'])
        elif self.op in (self.OP_KEYWORD):
            result += ', keyword = "%s"' % self.args['keyword']
        return result + ")"


    ##################################################################
    #
dataset/ETHPy150Open scanner/asimap/asimap/search.py/IMAPSearch.__str__/original