'Generator to yield non-blank and non-comment lines'

def process_lines(self, lines):

    if self.comment:
        re_comment = re.compile(self.comment)
    for line in lines:
        if (line.strip() and ((not self.comment) or (not re_comment.match(line)))):
            (yield line)
