ranger/orm/orm_client/db_clear/yaml_handler.py
hosingh000 87d644675e Merge Python3 branch
This change is going to upgrade ranger to use Python 3.x

Change-Id: I563661e071c56c2df7e0e1a6e365aecd4158b6cd
2019-10-29 10:36:00 -05:00

26 lines
632 B
Python

from . import config as conf
import fnmatch
import os
def _get_resource_file_path():
file_path = conf.local_repository_path
return file_path
def _find_file(resource_id):
file_name = conf.file_name_format.format(resource_id)
folder_to_search = _get_resource_file_path()
matches = []
for root, dirnames, filenames in os.walk(folder_to_search):
for filename in fnmatch.filter(filenames, file_name):
matches.append(os.path.join(root, filename))
return matches
def check_yaml_exist(resource_id):
files = _find_file(resource_id)
if files:
return files
return None