From b0f2833662e45253693088235b5c5aa0ba19d02b Mon Sep 17 00:00:00 2001 From: Thomas Kuschel Date: Sun, 23 Jun 2024 15:23:57 +0200 Subject: [PATCH] ADD abspath to the default path for testing --- afu/callbook.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/afu/callbook.py b/afu/callbook.py index 27316c2..3869601 100755 --- a/afu/callbook.py +++ b/afu/callbook.py @@ -33,7 +33,7 @@ def call_parser(): parser.add_argument('-V', '--version', action='version', version='{} {}'.format(os.path.split(__file__)[1],__version__)) parser.add_argument('-v', '--verbose', action='append_const', const = 1) # Rufzeichenliste_AT_Stand_010624.pdf - parser.add_argument('-p', '--path', default='afu/Rufzeichenliste_AT_Stand_010624.pdf', help= 'skip the download if the specified path to a PDF file exists') + parser.add_argument('-p', '--path', default='Rufzeichenliste_AT_Stand_010624.pdf', help= 'skip the download if the specified path to a PDF file exists') # parser.add_argument('-t', '--type', default='' , help='specify the output, supported types are [ CSV | JSON ]') # not implemented yet parser.add_argument('-o', '--output', default='', help='specify the file where the data are written to, default stdout') parser.add_argument('-m', '--mariadb', help='SQL interface to MariaDB (MySql) format ": " or defined in .config') @@ -41,6 +41,12 @@ def call_parser(): opt = parser.parse_args() opt.verbose = 0 if opt.verbose is None else sum(opt.verbose) + ask = opt.path != '' + base = os.path.basename(opt.path) + dir = os.path.dirname(opt.path) + if opt.path != '' and os.path.dirname(opt.path) == '': + opt.path = os.path.join(os.path.dirname(os.path.abspath(__file__)), opt.path) + return opt def call_website(url,verbose,path='',interactive=False,output='',mariadb=''):