34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
![]() |
'''Cardslot manipulation'''
|
||
|
import sys
|
||
|
import logging
|
||
|
|
||
|
import portal as bre
|
||
|
|
||
|
DEFAULT_OUTPUT = 'output.csv'
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
import argparse
|
||
|
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
|
||
|
|
||
|
parser = argparse.ArgumentParser(description='BRE automation parameters')
|
||
|
parser.add_argument('filename')
|
||
|
parser.add_argument('config', help='Configuration INI file')
|
||
|
parser.add_argument('input', help='Input xlsx file')
|
||
|
parser.add_argument('password', help='Password to access encrypted user data')
|
||
|
parser.add_argument('-check', '-c', action='store_true', help='Optional flag to only check existense')
|
||
|
|
||
|
args = parser.parse_args(sys.argv)
|
||
|
config = bre.read_config(args.config)
|
||
|
config['AppData']['Password'] = args.password
|
||
|
|
||
|
portal = bre.PortalAPI(config)
|
||
|
if not portal.set_input(args.input):
|
||
|
sys.exit()
|
||
|
if not portal.set_output_tasks(DEFAULT_OUTPUT):
|
||
|
sys.exit()
|
||
|
|
||
|
if args.check:
|
||
|
sys.exit(portal.check_existence())
|
||
|
else:
|
||
|
sys.exit(portal.import_cardslots())
|