retain raw filter str on filt objects
This commit is contained in:
parent
ec23594191
commit
f7c5385679
|
@ -343,7 +343,9 @@ bnf = _make()
|
||||||
|
|
||||||
def parse(s):
|
def parse(s):
|
||||||
try:
|
try:
|
||||||
return bnf.parseString(s, parseAll=True)[0]
|
filt = bnf.parseString(s, parseAll=True)[0]
|
||||||
|
filt.pattern = s
|
||||||
|
return filt
|
||||||
except pp.ParseException:
|
except pp.ParseException:
|
||||||
return None
|
return None
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
|
@ -346,11 +346,13 @@ class State(object):
|
||||||
# These are compiled filt expressions:
|
# These are compiled filt expressions:
|
||||||
self._limit = None
|
self._limit = None
|
||||||
self.intercept = None
|
self.intercept = None
|
||||||
self._limit_txt = None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def limit_txt(self):
|
def limit_txt(self):
|
||||||
return self._limit_txt
|
if self.filt:
|
||||||
|
return self.filt.pattern
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def flow_count(self):
|
def flow_count(self):
|
||||||
return len(self._flow_list)
|
return len(self._flow_list)
|
||||||
|
@ -407,10 +409,8 @@ class State(object):
|
||||||
if not f:
|
if not f:
|
||||||
return "Invalid filter expression."
|
return "Invalid filter expression."
|
||||||
self._limit = f
|
self._limit = f
|
||||||
self._limit_txt = txt
|
|
||||||
else:
|
else:
|
||||||
self._limit = None
|
self._limit = None
|
||||||
self._limit_txt = None
|
|
||||||
self.recalculate_view()
|
self.recalculate_view()
|
||||||
|
|
||||||
def set_intercept(self, txt):
|
def set_intercept(self, txt):
|
||||||
|
|
Loading…
Reference in New Issue