Commit 1583d6cf authored by Thomas Bernhart's avatar Thomas Bernhart
Browse files

Add command line options to pass parameters

parent 798d83ea
#!/usr/bin/env python3
# coding: utf-8
import argparse
from ch.memobase.export import foxml_export
objectstore_path = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/Datenexport/objectStore'
# output_directory = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/sftp_20210228'
output_directory = './sftp_20210228'
arg_handler = argparse.ArgumentParser
arg_handler.add_argument("--object-store-directory", required=True)
arg_handler.add_argument("--output-directory", required=True)
foxml_export(objectstore_path, output_directory, "./record_sets_ids.csv")
args = arg_handler.parse_args()
foxml_export(args["object_store_directory"], args["output_directory"], "./record_sets_ids.csv")
#!/usr/bin/env python3
# coding: utf-8
import argparse
from ch.memobase.export import foxml_export, media_export
from os import listdir
from os import path
objectstore_path = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/Datenexport/objectStore'
http_files_path = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/Datenexport/public-files'
rtmp_files_path = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/Datenexport/library'
# output_directory = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/sftp_20210228'
output_directory = './sftp_20210228'
arg_handler = argparse.ArgumentParser
arg_handler.add_argument("--object-store-directory", required=True)
arg_handler.add_argument("--datastream-store-directory", required=True)
arg_handler.add_argument("--http-resources-directory", required=True)
arg_handler.add_argument("--rtmp-resources-directory", required=True)
arg_handler.add_argument("--output-directory", required=True)
foxml_export(objectstore_path, output_directory, "./record_sets_ids.csv")
for record_set_directory in listdir(output_directory):
record_set_path = path.join(output_directory, record_set_directory)
args = arg_handler.parse_args()
foxml_export(args["object_store_directory"], args["output_directory"], "./record_sets_ids.csv")
for record_set_directory in listdir(args["output_directory"]):
record_set_path = path.join(args["output_directory"], record_set_directory)
if path.isdir(record_set_path):
media_export(record_set_path, http_files_path, rtmp_files_path)
media_export(record_set_path, args["datastream_store_directory"], args["http_resources_directory"], args["rtmp_resources_directory"])
#!/usr/bin/env python3
# coding: utf-8
import argparse
from ch.memobase.export import media_export
exported_record_set_path = './sftp_20210228/adg-001'
http_files_path = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/Datenexport/public-files'
rtmp_files_path = '/mnt/docuteam-intern/scratch/570-8_Memobase-Datenexport_loeschen-2021_be/Datenexport/library'
arg_handler = argparse.ArgumentParser
arg_handler.add_argument("--record-set-directory", required=True)
arg_handler.add_argument("--datastream-store-directory", required=True)
arg_handler.add_argument("--http-resources-directory", required=True)
arg_handler.add_argument("--rtmp-resources-directory", required=True)
media_export(exported_record_set_path, http_files_path, rtmp_files_path)
args = arg_handler.parse_args()
media_export(args["record_set_directory"], args["datastream_store_directory"], args["http_resources_directory"], args["rtmp_resources_directory"])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment