mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
780ccfe137
commit
2f88be85e6
1 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue