This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/cli.py

23 lines
501 B
Python
Raw Normal View History

2017-03-27 09:02:05 +01:00
import logging
2017-03-29 18:26:54 +01:00
from md_pdf.args import parse_args
from md_pdf.exceptions import PrematureExit
from md_pdf.build import build
from md_pdf.config.read import load_config
2017-03-27 09:02:05 +01:00
FORMAT = "[%(levelname)s]: %(message)s"
logging.basicConfig(format=FORMAT, level=logging.DEBUG)
def cli():
2017-03-29 18:26:54 +01:00
args = parse_args()
try:
config = load_config()
build(args, config)
except PrematureExit:
return 0
except Exception as e:
logging.error(str(e))
return 1
return 0