1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[util] extend global namespace for filter expressions

This commit is contained in:
Mike Fährmann 2017-10-09 22:12:58 +02:00
parent 393755ee94
commit 832b8b76ac
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -8,6 +8,7 @@
"""Utility functions and classes"""
import re
import os
import sys
import hmac
@ -196,7 +197,12 @@ class UniquePredicate():
class FilterPredicate():
"""Predicate; True if evaluating the given expression returns True"""
globalsdict = {"safe_int": safe_int, "datetime": datetime.datetime}
globalsdict = {
"safe_int": safe_int,
"urlsplit": urllib.parse.urlsplit,
"datetime": datetime.datetime,
"re": re,
}
def __init__(self, codeobj):
self.codeobj = codeobj