mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
init/import path: move DEFAULT_CONFIG to __init__ for faster shared import
proxy: move certauth/openssl init to only happen in enable_https_proxy is set to make slow openssl import run only when used
This commit is contained in:
parent
aa427bd6d0
commit
cc068f8ee8
@ -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
|
||||
|
@ -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" ' +
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user