mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Use YAML instead of JSON
Add PyYAML<=3.13 dependency.
This commit is contained in:
parent
6e6b43eb79
commit
878ab0977f
1
setup.py
1
setup.py
@ -33,6 +33,7 @@ deps = [
|
|||||||
'PySocks>=1.6.8',
|
'PySocks>=1.6.8',
|
||||||
'cryptography>=2.3',
|
'cryptography>=2.3',
|
||||||
'idna>=2.5',
|
'idna>=2.5',
|
||||||
|
'PyYAML<=3.13',
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
|
@ -29,7 +29,6 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
import Queue as queue
|
import Queue as queue
|
||||||
|
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import logging.config
|
import logging.config
|
||||||
import sys
|
import sys
|
||||||
@ -41,6 +40,7 @@ import traceback
|
|||||||
import signal
|
import signal
|
||||||
import threading
|
import threading
|
||||||
import certauth.certauth
|
import certauth.certauth
|
||||||
|
import yaml
|
||||||
import warcprox
|
import warcprox
|
||||||
import doublethink
|
import doublethink
|
||||||
import cryptography.hazmat.backends.openssl
|
import cryptography.hazmat.backends.openssl
|
||||||
@ -243,7 +243,7 @@ def _build_arg_parser(prog='warcprox', show_hidden=False):
|
|||||||
help='very verbose logging')
|
help='very verbose logging')
|
||||||
arg_parser.add_argument(
|
arg_parser.add_argument(
|
||||||
'--logging-conf-file', dest='logging_conf_file', default=None,
|
'--logging-conf-file', dest='logging_conf_file', default=None,
|
||||||
help=('reads logging configuration from a JSON file'))
|
help=('reads logging configuration from a YAML file'))
|
||||||
arg_parser.add_argument(
|
arg_parser.add_argument(
|
||||||
'--version', action='version',
|
'--version', action='version',
|
||||||
version="warcprox {}".format(warcprox.__version__))
|
version="warcprox {}".format(warcprox.__version__))
|
||||||
@ -309,7 +309,7 @@ def main(argv=None):
|
|||||||
|
|
||||||
if args.logging_conf_file:
|
if args.logging_conf_file:
|
||||||
with open(args.logging_conf_file, 'r') as fd:
|
with open(args.logging_conf_file, 'r') as fd:
|
||||||
conf = json.load(fd)
|
conf = yaml.load(fd)
|
||||||
logging.config.dictConfig(conf)
|
logging.config.dictConfig(conf)
|
||||||
|
|
||||||
# see https://github.com/pyca/cryptography/issues/2911
|
# see https://github.com/pyca/cryptography/issues/2911
|
||||||
|
Loading…
x
Reference in New Issue
Block a user