summaryrefslogtreecommitdiff
path: root/searx/__init__.py
diff options
context:
space:
mode:
authorpw3t <romain@berthor.fr>2014-01-19 19:50:17 +0100
committerpw3t <romain@berthor.fr>2014-01-19 19:50:17 +0100
commit9e72ebe064a10fe5369049ae94ab5248bfd38811 (patch)
tree39f636007aa97ecb6773c83e841c3914bf1d8c93 /searx/__init__.py
parenta62b94e21c4c521430fb3b37f4241adb1faee63c (diff)
parent78f525aa94375dabd0e072a782430d5dd9702ca1 (diff)
Merge branch 'master' of https://github.com/asciimoo/searx
Diffstat (limited to 'searx/__init__.py')
-rw-r--r--searx/__init__.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/searx/__init__.py b/searx/__init__.py
index e69de29bb..e313306e3 100644
--- a/searx/__init__.py
+++ b/searx/__init__.py
@@ -0,0 +1,22 @@
+from os import environ
+from os.path import realpath, dirname, join
+try:
+ from yaml import load
+except:
+ from sys import exit, stderr
+ stderr.write('[E] install pyyaml\n')
+ exit(2)
+
+
+searx_dir = realpath(dirname(realpath(__file__))+'/../')
+engine_dir = dirname(realpath(__file__))
+
+if 'SEARX_SETTINGS_PATH' in environ:
+ settings_path = environ['SEARX_SETTINGS_PATH']
+else:
+ settings_path = join(searx_dir, 'settings.yml')
+
+
+with open(settings_path) as settings_yaml:
+ settings = load(settings_yaml)
+