fix event if arg is missing.
This commit is contained in:
parent
300b1c9ef0
commit
25fcfdbb27
|
@ -10,7 +10,7 @@ TODO:
|
||||||
8. Optinally allow specification of a backup location on another disk
|
8. Optinally allow specification of a backup location on another disk
|
||||||
or NAS to ship a 3rd copy to
|
or NAS to ship a 3rd copy to
|
||||||
10. Every config option has an arg override
|
10. Every config option has an arg override
|
||||||
11. Optionally rename file if event name was passed in
|
11. Optionally rename file if EVENT name was passed in
|
||||||
-- STRETCH --
|
-- STRETCH --
|
||||||
12. Make a graphical interface
|
12. Make a graphical interface
|
||||||
'''
|
'''
|
||||||
|
@ -55,7 +55,9 @@ parser.add_argument("-g", "--generate-config", help = "Generate config file
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.event:
|
if args.event:
|
||||||
event = args.event
|
EVENT = args.event
|
||||||
|
else:
|
||||||
|
EVENT = False
|
||||||
if args.source:
|
if args.source:
|
||||||
config['folders']['source']['base'] = args.source
|
config['folders']['source']['base'] = args.source
|
||||||
if args.destination:
|
if args.destination:
|
||||||
|
@ -191,8 +193,7 @@ def process_file(path, f_type, f_name, ext):
|
||||||
files[i]['date']['m'] = files[i]['date']['capture_date'][1]
|
files[i]['date']['m'] = files[i]['date']['capture_date'][1]
|
||||||
files[i]['date']['d'] = files[i]['date']['capture_date'][2]
|
files[i]['date']['d'] = files[i]['date']['capture_date'][2]
|
||||||
|
|
||||||
|
if EVENT is not False:
|
||||||
if event:
|
|
||||||
files[i]['folders']['destination'] = config['folders']['destination']['base'] + \
|
files[i]['folders']['destination'] = config['folders']['destination']['base'] + \
|
||||||
'/' + files[i]['date']['y'] + '/' + \
|
'/' + files[i]['date']['y'] + '/' + \
|
||||||
files[i]['date']['y'] + '-' + \
|
files[i]['date']['y'] + '-' + \
|
||||||
|
@ -200,7 +201,7 @@ def process_file(path, f_type, f_name, ext):
|
||||||
files[i]['date']['y'] + '-' + \
|
files[i]['date']['y'] + '-' + \
|
||||||
files[i]['date']['m'] + '-' + \
|
files[i]['date']['m'] + '-' + \
|
||||||
files[i]['date']['d'] + '-' + \
|
files[i]['date']['d'] + '-' + \
|
||||||
event
|
EVENT
|
||||||
else:
|
else:
|
||||||
files[i]['folders']['destination'] = config['folders']['destination']['base'] + \
|
files[i]['folders']['destination'] = config['folders']['destination']['base'] + \
|
||||||
'/' + files[i]['date']['y'] + '/' + \
|
'/' + files[i]['date']['y'] + '/' + \
|
||||||
|
|
Loading…
Reference in New Issue