# Path: dgitcore/helper.py
# def slugify(value):
#     """
#     Normalizes string, converts to lowercase, removes non-alpha characters,
#     and converts spaces to hyphens.
#     """
#     value = unicodedata.normalize('NFKD', value)
#     value = value.encode('ascii', 'ignore')
#     value = value.decode('utf-8')
#     value = re.sub(r'[^\w\s-]', '-', value).strip().lower()
#     return re.sub(r'[-\s]+', '-', value)


import os, sys
import json
import fnmatch, re
from collections import namedtuple
from ..helper import slugify
from ..exceptions import *
        self.rootdir = None
        self.options = {}
        self.key = None
        self.remoteurl = None

    def find_matching_files(self, includes):
        """
        For various actions we need files that match patterns
        """

        if len(includes) == 0: 
            return [] 

        files = [f['relativepath'] for f in self.package['resources']]
        includes = r'|'.join([fnmatch.translate(x) for x in includes])

        # Match both the file name as well the path..
        files = [f for f in files if re.match(includes, os.path.basename(f))] + \
                [f for f in files if re.match(includes, f)]
        files = list(set(files))

        return files

    # Cache for partially computed information
    def cache_path(self, prefix, objname, ext=""):

        path = os.path.join('.dgit',
                            prefix,
                            slugify(objname))
        if ext != "":

# Path: dgitcore/helper.py
# def slugify(value):
#     """
#     Normalizes string, converts to lowercase, removes non-alpha characters,
#     and converts spaces to hyphens.
#     """
#     value = unicodedata.normalize('NFKD', value)
#     value = value.encode('ascii', 'ignore')
#     value = value.decode('utf-8')
#     value = re.sub(r'[^\w\s-]', '-', value).strip().lower()
#     return re.sub(r'[-\s]+', '-', value)


# Path: dgitcore/plugins/repomanager.py
import os, sys
import json
import fnmatch, re
from collections import namedtuple
from ..helper import slugify
from ..exceptions import *

        self.rootdir = None
        self.options = {}
        self.key = None
        self.remoteurl = None

    def find_matching_files(self, includes):
        """
        For various actions we need files that match patterns
        """

        if len(includes) == 0: 
            return [] 

        files = [f['relativepath'] for f in self.package['resources']]
        includes = r'|'.join([fnmatch.translate(x) for x in includes])

        # Match both the file name as well the path..
        files = [f for f in files if re.match(includes, os.path.basename(f))] + \
                [f for f in files if re.match(includes, f)]
        files = list(set(files))

        return files

    # Cache for partially computed information
    def cache_path(self, prefix, objname, ext=""):

        path = os.path.join('.dgit',
                            prefix,
                            slugify(objname))
        if ext != "":

            ext = slugify(ext) # clean this up as well