Port get.py improvements from upstream.
Generally standardizes the get_* helpers: - Adds type hinting. - Deduplicates block property addition. - Respects `graceful` in more contexts. - More resilient to invalid user input / less boilerplate necessary at call-sites.
This commit is contained in:
parent
6b832aba99
commit
9953c5763c
3 changed files with 193 additions and 160 deletions
|
@ -1,8 +1,9 @@
|
|||
|
||||
import typing
|
||||
|
||||
# clean strings for searching
|
||||
def sql_ilike_clean(my_str):
|
||||
if my_str is None:
|
||||
return None
|
||||
return my_str.replace(r'\\', '').replace('_', r'\_').replace('%', '').strip()
|
||||
|
||||
# this will also just return a bool verbatim
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue