Skip to content

Instantly share code, notes, and snippets.

@jeamland
Created October 24, 2011 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeamland/1308342 to your computer and use it in GitHub Desktop.
Save jeamland/1308342 to your computer and use it in GitHub Desktop.
class LineFilter(object):
def __init__(self, lines):
self.lines = lines
def eval(self, tags, names, ranges):
for r in ranges:
for line in self.lines:
if r[0] <= line <= r[1]:
return True
return False
def filter_table_body_rows(self, rows):
body = [r for r in rows[1:] if r.line in self.lines]
return [rows[0]] + body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment