# Path: dgitcore/plugins/common.py
# def plugins_get_mgr():
#     """
#     Get the global plugin manager
#     """
#     global pluginmgr
#     return pluginmgr
# 
# Path: dgitcore/helper.py
# def log_repo_action(func): 
#     """
#     Log all repo actions to .dgit/log.json 
#     """
#         
#     def _inner(*args, **kwargs):
#         result = func(*args, **kwargs)         
#         log_action(func, result, *args, **kwargs)
#         return result 
#         
#     _inner.__name__ = func.__name__
#     _inner.__doc__ = func.__doc__
#     return _inner


import os, sys, json
from ..plugins.common import plugins_get_mgr
from ..helper import log_repo_action
        for v in validators:
            if 'files' not in validators[v]:
                validators[v]['files'] = []
            elif len(validators[v]['files']) > 0:
                matching_files = repo.find_matching_files(validators[v]['files'])
                validators[v]['files'] = matching_files

    #=========================================
    # Insert the rules files..
    #=========================================
    if rulesfiles is not None:
        # Command lines...
        matching_files = repo.find_matching_files([rulesfiles])
        if len(matching_files) == 0:
            print("Could not find matching rules files ({}) for {}".format(rulesfiles,v))
            raise Exception("Invalid rules")
        for v in validators:
            validators[v]['rules-files'] = matching_files
    else:
        # Instantiate the files from the patterns specified
        for v in validators:
            if 'rules-files' not in validators[v]:
                validators[v]['rules-files'] = []
            else:
                rulesfiles = validators[v]['rules-files']
                matching_files = repo.find_matching_files(rulesfiles)
                validators[v]['rules-files'] = matching_files

    return validators


# Path: dgitcore/plugins/common.py
# def plugins_get_mgr():
#     """
#     Get the global plugin manager
#     """
#     global pluginmgr
#     return pluginmgr
# 
# Path: dgitcore/helper.py
# def log_repo_action(func): 
#     """
#     Log all repo actions to .dgit/log.json 
#     """
#         
#     def _inner(*args, **kwargs):
#         result = func(*args, **kwargs)         
#         log_action(func, result, *args, **kwargs)
#         return result 
#         
#     _inner.__name__ = func.__name__
#     _inner.__doc__ = func.__doc__
#     return _inner


# Path: dgitcore/datasets/validation.py
import os, sys, json
from ..plugins.common import plugins_get_mgr
from ..helper import log_repo_action

        for v in validators:
            if 'files' not in validators[v]:
                validators[v]['files'] = []
            elif len(validators[v]['files']) > 0:
                matching_files = repo.find_matching_files(validators[v]['files'])
                validators[v]['files'] = matching_files

    #=========================================
    # Insert the rules files..
    #=========================================
    if rulesfiles is not None:
        # Command lines...
        matching_files = repo.find_matching_files([rulesfiles])
        if len(matching_files) == 0:
            print("Could not find matching rules files ({}) for {}".format(rulesfiles,v))
            raise Exception("Invalid rules")
        for v in validators:
            validators[v]['rules-files'] = matching_files
    else:
        # Instantiate the files from the patterns specified
        for v in validators:
            if 'rules-files' not in validators[v]:
                validators[v]['rules-files'] = []
            else:
                rulesfiles = validators[v]['rules-files']
                matching_files = repo.find_matching_files(rulesfiles)
                validators[v]['rules-files'] = matching_files

    return validators


@log_repo_action 