comparison query_tabular.py @ 8:ae27dab228b8 draft

Uploaded
author jjohnson
date Tue, 21 Feb 2017 12:59:26 -0500
parents 72c32037fa1e
children 0ed75ed20c7e
comparison
equal deleted inserted replaced
7:72c32037fa1e 8:ae27dab228b8
61 61
62 class LineFilter( object ): 62 class LineFilter( object ):
63 def __init__(self,source,filter_dict): 63 def __init__(self,source,filter_dict):
64 self.source = source 64 self.source = source
65 self.filter_dict = filter_dict 65 self.filter_dict = filter_dict
66 print >> sys.stderr, 'LineFilter %s' % filter_dict if filter_dict else 'NONE' 66 # print >> sys.stderr, 'LineFilter %s' % filter_dict if filter_dict else 'NONE'
67 self.func = lambda l: l.rstrip('\r\n') if l else None 67 self.func = lambda l: l.rstrip('\r\n') if l else None
68 if not filter_dict: 68 if not filter_dict:
69 return 69 return
70 if filter_dict['filter'] == 'regex': 70 if filter_dict['filter'] == 'regex':
71 rgx = re.compile(filter_dict['pattern']) 71 rgx = re.compile(filter_dict['pattern'])