# Path: anchorhub/compatibility.py
# def get_path_separator():
#     """
#     Returns the appropriate file path separator depending on operating
#     system. That is, when run on UNIX-like systems it returns a forward slash
#     ('/'), and for Windows it returns a backslash ('\')
#     :return: String. The file path separator for the current operating system.
#     """
#     if os.name == 'nt':
#         return '\\'
#     else:
#         return '/'
# 
# Path: anchorhub/util/addsuffix.py
# def add_suffix(string, suffix):
#     """
#     Adds a suffix to a string, if the string does not already have that suffix.
# 
#     :param string: the string that should have a suffix added to it
#     :param suffix: the suffix to be added to the string
#     :return: the string with the suffix added, if it does not already end in
#         the suffix. Otherwise, it returns the original string.
#     """
#     if string[-len(suffix):] != suffix:
#         return string + suffix
#     else:
#         return string


import os
import glob
from anchorhub.compatibility import get_path_separator
from anchorhub.util.addsuffix import add_suffix
"""

"""



def get_files(dir, exts, exclude=None, recursive=False):
    """
    Get a list of files within a directory with given extensions.
    Exclude/black list directories from the list if specified. By default,
    the search is recursive, looking in all subdirectories of 'dir'

    :param dir: String root directory to search under. All subdirectories are
        also searched by default
    :param exts: List of string file extensions. Files inside of dir with
        names ending with this string will be included in the list. Note: the
        string does not strictly need to be a file extension (beginging with
        a '.' dot), it could be the entire name of the file, or a common
        suffix to files.
    :param exclude: List of strings specifying directories that should not be
        included in the output list
    :param recursive: When True, search in all subdirectories, otherwise just
        look in the current directory
    :return: List of string directories
    """
    file_paths =[]
    if recursive:
        for root, _, _ in os.walk(dir):
            # os.walk() does not add path separator by default to end of path

# Path: anchorhub/compatibility.py
# def get_path_separator():
#     """
#     Returns the appropriate file path separator depending on operating
#     system. That is, when run on UNIX-like systems it returns a forward slash
#     ('/'), and for Windows it returns a backslash ('\')
#     :return: String. The file path separator for the current operating system.
#     """
#     if os.name == 'nt':
#         return '\\'
#     else:
#         return '/'
# 
# Path: anchorhub/util/addsuffix.py
# def add_suffix(string, suffix):
#     """
#     Adds a suffix to a string, if the string does not already have that suffix.
# 
#     :param string: the string that should have a suffix added to it
#     :param suffix: the suffix to be added to the string
#     :return: the string with the suffix added, if it does not already end in
#         the suffix. Otherwise, it returns the original string.
#     """
#     if string[-len(suffix):] != suffix:
#         return string + suffix
#     else:
#         return string


# Path: anchorhub/util/getfiles.py
import os
import glob
from anchorhub.compatibility import get_path_separator
from anchorhub.util.addsuffix import add_suffix

"""

"""



def get_files(dir, exts, exclude=None, recursive=False):
    """
    Get a list of files within a directory with given extensions.
    Exclude/black list directories from the list if specified. By default,
    the search is recursive, looking in all subdirectories of 'dir'

    :param dir: String root directory to search under. All subdirectories are
        also searched by default
    :param exts: List of string file extensions. Files inside of dir with
        names ending with this string will be included in the list. Note: the
        string does not strictly need to be a file extension (beginging with
        a '.' dot), it could be the entire name of the file, or a common
        suffix to files.
    :param exclude: List of strings specifying directories that should not be
        included in the output list
    :param recursive: When True, search in all subdirectories, otherwise just
        look in the current directory
    :return: List of string directories
    """
    file_paths =[]
    if recursive:
        for root, _, _ in os.walk(dir):
            # os.walk() does not add path separator by default to end of path

            root = add_suffix(root, get_path_separator())