summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-01-18 10:39:13 +0100
committerAdam Tauber <asciimoo@gmail.com>2015-01-18 10:39:13 +0100
commit285f991cd078db7df5622e3109984f1f3c651988 (patch)
tree0300ad8dee31d7c9cfcf9246d749290e50f2f218 /searx/utils.py
parenta865e6672fa2a289937ff378e8893c19f71c5e0c (diff)
parent1d5151215266d74085406604f99d8dec1c7cbe72 (diff)
Merge pull request #182 from dalf/enh-proxy
[enh] image-proxy : handle ETag and date related headers, add hash to URL
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