@@ -0,0 +1,953 @@
+from portality.core import app%0Afrom portality.tasks.ingestarticles import IngestArticlesBackgroundTask%0Afrom portality.background import BackgroundApi%0Afrom portality.models.background import StdOutBackgroundJob%0Afrom werkzeug import FileStorage%0A%0Aif __name__ == %22__main__%22:%0A    if app.config.get(%22SCRIPTS_READ_ONLY_MODE%22, False):%0A        print(%22System is in READ-ONLY mode, script cannot run%22)%0A        exit()%0A%0A    user = app.config.get(%22SYSTEM_USERNAME%22)%0A%0A    import argparse%0A    parser = argparse.ArgumentParser()%0A    parser.add_argument(%22file%22, help=%22XML file to import%22)%0A    parser.add_argument(%22schema%22, help=%22doaj or crossref%22)%0A    args = parser.parse_args()%0A%0A    with open(args.file) as f:%0A        fs = FileStorage(f, %22testing.xml%22)%0A        job = IngestArticlesBackgroundTask.prepare(user, upload_file=fs, schema=args.schema)%0A        job = StdOutBackgroundJob(job)%0A        task = IngestArticlesBackgroundTask(job)%0A        BackgroundApi.execute(task)%0A

add script to allow us to trigger article ingest background job from command line