define dump_yaml
This commit is contained in:
parent
912ef08783
commit
ef2ca3d70d
|
@ -46,6 +46,11 @@ args = parser.parse_args()
|
||||||
if args.event:
|
if args.event:
|
||||||
event = 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):
|
def md5_hash(f):
|
||||||
""" calculates and returns md5 hash """
|
""" calculates and returns md5 hash """
|
||||||
#print("calculating md5 for ", f)
|
#print("calculating md5 for ", f)
|
||||||
|
@ -273,7 +278,6 @@ def cleanup_sd():
|
||||||
if files[file]['source_cleanable'] is True:
|
if files[file]['source_cleanable'] is True:
|
||||||
os.remove(os.path.join(files[file]['folders']['source_path'],files[file]['name']))
|
os.remove(os.path.join(files[file]['folders']['source_path'],files[file]['name']))
|
||||||
|
|
||||||
#pprint(files)
|
|
||||||
go = validate_config_dir_access()
|
go = validate_config_dir_access()
|
||||||
if go is True:
|
if go is True:
|
||||||
find_files(config['folders']['source']['base'])
|
find_files(config['folders']['source']['base'])
|
||||||
|
@ -284,4 +288,5 @@ if go is True:
|
||||||
else:
|
else:
|
||||||
print("There was a problem accessing one or more directories defined in the configuration.")
|
print("There was a problem accessing one or more directories defined in the configuration.")
|
||||||
|
|
||||||
|
dump_yaml(files, 'files_dict.yaml')
|
||||||
print('done.')
|
print('done.')
|
||||||
|
|
Loading…
Reference in New Issue