logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git
commit: 187617498a0dea17e51950f1ad5e96bb4826367d
parent 2be52b74ad9e30474d553750d802199ee8cc4844
Author: Alexandre Flament <alex@al-f.net>
Date:   Sun, 26 Apr 2015 18:58:31 +0200

Log an error if the ndg-httpsclient, pyopenssl and pyasn1 packages are not installed.
See #298

Diffstat:

Msearx/webapp.py10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/searx/webapp.py b/searx/webapp.py @@ -61,6 +61,16 @@ except: from sys import exit exit(1) +# check if the pyopenssl, ndg-httpsclient, pyasn1 packages are installed. +# They are needed for SSL connection without trouble, see #298 +try: + import OpenSSL.SSL # NOQA + import ndg.httpsclient # NOQA + import pyasn1 # NOQA +except ImportError: + logger.critical("The pyopenssl, ndg-httpsclient, pyasn1 packages have to be installed.\n" + "Some HTTPS connections will failed") + logger = logger.getChild('webapp')