1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

config: move config files to ./configs/

PYWB_CONFIG_FILE setting overrides passed in config
This commit is contained in:
Ilya Kreymer 2014-03-27 14:31:27 -07:00
parent b5e70f5dc6
commit 093d8310e5
5 changed files with 8 additions and 5 deletions

View File

@ -7,7 +7,7 @@ from pywb.core.cdx_api_handler import create_cdx_server_app
#=================================================================
# cdx-server only config
DEFAULT_CONFIG = 'pywb/cdx/config.yaml'
DEFAULT_CONFIG = 'configs/cdx-server-config.yaml'
application = init_app(create_cdx_server_app,
load_yaml=True,

View File

@ -106,7 +106,7 @@ def handle_exception(env, wb_router, exc, print_trace):
status=status)
#=================================================================
DEFAULT_CONFIG_FILE = 'config.yaml'
DEFAULT_CONFIG_FILE = 'configs/config.yaml'
#=================================================================
@ -116,8 +116,11 @@ def init_app(init_func, load_yaml=True, config_file=None):
logging.debug('')
if load_yaml:
if not config_file:
config_file = os.environ.get('PYWB_CONFIG_FILE')
# env setting overrides all others
env_config = os.environ.get('PYWB_CONFIG_FILE')
if env_config:
config_file = env_config
if not config_file:
config_file = DEFAULT_CONFIG_FILE

View File

@ -31,7 +31,7 @@ class ResolvingLoader:
# two index lookups
# Case 1: if mimetype is still warc/revisit
if cdx['mimetype'] == 'warc/revisit' and headers_record:
if cdx.get('mimetype') == 'warc/revisit' and headers_record:
payload_record = self._load_different_url_payload(cdx,
headers_record,
failed_files,