diff --git a/pywb/__init__.py b/pywb/__init__.py index ef7c1d7f..e96a5b1d 100644 --- a/pywb/__init__.py +++ b/pywb/__init__.py @@ -1,4 +1,8 @@ import os +DEFAULT_CONFIG = 'pywb/default_config.yaml' + def get_test_dir(): - return os.path.dirname(os.path.realpath(__file__)) + '/../sample_archive/' + return os.path.join(os.path.dirname(os.path.realpath(__file__)), + '..', + 'sample_archive') + os.path.sep diff --git a/pywb/framework/proxy.py b/pywb/framework/proxy.py index f8bab933..6d557dee 100644 --- a/pywb/framework/proxy.py +++ b/pywb/framework/proxy.py @@ -12,8 +12,6 @@ from pywb.utils.wbexception import BadRequestException from pywb.utils.bufferedreaders import BufferedReader -from certauth import CertificateAuthority, openssl_avail - from proxy_resolvers import ProxyAuthResolver, CookieResolver @@ -92,6 +90,8 @@ class ProxyRouter(object): self.ca = None return + from certauth import CertificateAuthority, openssl_avail + if not openssl_avail: # pragma: no cover print('HTTPS proxy not available as pyopenssl is not installed') print('Please install via "pip install pyopenssl" ' + diff --git a/pywb/webapp/pywb_init.py b/pywb/webapp/pywb_init.py index 4f39c1d9..7cbea633 100644 --- a/pywb/webapp/pywb_init.py +++ b/pywb/webapp/pywb_init.py @@ -17,14 +17,12 @@ from handlers import StaticHandler from handlers import DebugEchoHandler, DebugEchoEnvHandler from cdx_api_handler import CDXAPIHandler +from pywb import DEFAULT_CONFIG import os import logging -#================================================================= -DEFAULT_CONFIG = 'pywb/default_config.yaml' - #================================================================= class DictChain: def __init__(self, *dicts):