Support getting a file list from a module that isn't mistral

Change-Id: I3157f9de4f2905dbc4f77257abbbc9f65093a63b
This commit is contained in:
Eyal 2020-02-26 09:44:56 +02:00
parent 3055caf8d8
commit 237a10d22e

View File

@ -175,8 +175,8 @@ def update_dict(left, right):
return left
def get_file_list(directory):
base_path = pkg.resource_filename("mistral", directory)
def get_file_list(directory, package='mistral'):
base_path = pkg.resource_filename(package, directory)
return [path.join(base_path, f) for f in os.listdir(base_path)
if path.isfile(path.join(base_path, f))]