separated argparse to be passed from main to prepare function to allow post submission from another python source using import to pelican and passing argument via args

This commit is contained in:
san 2015-06-20 20:47:30 +05:30
commit 2f88be85e6

View file

@ -382,6 +382,15 @@ def get_instance(args):
def main():
args = parse_arguments()
prepare(args)
def prepare(args):
""" preapres settings received from an argparse or mocked argparse from different application that imports pelican.
:param args: argparse.ArgumentParser or mocked argparse Class object
:type args: argparse.ArgumentParser or mocked argparse
"""
init(args.verbosity)
pelican, settings = get_instance(args)
readers = Readers(settings)