define dump_yaml

This commit is contained in:
Kameron Kenny 2023-08-10 16:32:35 -04:00
parent 912ef08783
commit ef2ca3d70d
1 changed files with 6 additions and 1 deletions

View File

@ -46,6 +46,11 @@ args = parser.parse_args()
if args.event:
event = args.event
def dump_yaml(dictionary, file):
""" dump a dictionary to a yaml file """
with open(file, 'w') as f:
yaml.dump(dictionary, f)
def md5_hash(f):
""" calculates and returns md5 hash """
#print("calculating md5 for ", f)
@ -273,7 +278,6 @@ def cleanup_sd():
if files[file]['source_cleanable'] is True:
os.remove(os.path.join(files[file]['folders']['source_path'],files[file]['name']))
#pprint(files)
go = validate_config_dir_access()
if go is True:
find_files(config['folders']['source']['base'])
@ -284,4 +288,5 @@ if go is True:
else:
print("There was a problem accessing one or more directories defined in the configuration.")
dump_yaml(files, 'files_dict.yaml')
print('done.')