summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/utils.py')
-rw-r--r--searx/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/utils.py b/searx/utils.py
index 0b4de9410..89128d506 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -206,3 +206,11 @@ def format_date_by_locale(date_string, locale_string):
except:
logger.warning('cannot set original locale: {0}'.format(orig_locale))
return formatted_date
+
+
+def dict_subset(d, properties):
+ result = {}
+ for k in properties:
+ if k in d:
+ result[k] = d[k]
+ return result