# Path: grace/error.py
# class FileNotWritableError(Error):
#     pass
# 
# class FolderAlreadyExistsError(Error):
#     pass
# 
# class FolderNotFoundError(Error):
#     pass
# 
# class CreateFolderError(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class GeneralError(Error):
#     pass
# 
# Path: grace/utils.py
# def get_path():
#     encoding = sys.getfilesystemencoding()
#     if we_are_frozen():
#         return os.path.dirname(sys.executable)
#     return os.path.dirname(__file__)


from builtins import object
from .error import FileNotWritableError, FolderAlreadyExistsError, FolderNotFoundError, CreateFolderError, FileNotFoundError, GeneralError
from shutil import copytree, copy, rmtree
from pkg_resources import resource_filename
from .utils import get_path
import os
import sys
import re
import requests
import tempfile
import zipfile
import hashlib
        if not os.path.exists(self._skeleton_path):
            raise FolderNotFoundError('Could not find the skeleton: ', self._skeleton_path)

        try:
            copytree(self._skeleton_path, os.path.join(self._cwd, self._projectName))
        except:
            raise CreateFolderError('Could not create the folders for the new project.')

    def _replace_strings(self):
        file_list = []
        for path, dirs, files in os.walk(self._projectPath):
            for f in files:
                file_list.append({
                    'file': f,
                    'path': path
                })

        for entry in file_list:
            if re.search('_X.', entry['file']):
                try:
                    self._replace(entry)
                except:
                    raise

    def _replace(self, fileObject):
        f = fileObject['file']
        p = fileObject['path']

        outfilename = f.replace('_X', '')
        with open(os.path.join(p, outfilename), 'w+') as out:

# Path: grace/error.py
# class FileNotWritableError(Error):
#     pass
# 
# class FolderAlreadyExistsError(Error):
#     pass
# 
# class FolderNotFoundError(Error):
#     pass
# 
# class CreateFolderError(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class GeneralError(Error):
#     pass
# 
# Path: grace/utils.py
# def get_path():
#     encoding = sys.getfilesystemencoding()
#     if we_are_frozen():
#         return os.path.dirname(sys.executable)
#     return os.path.dirname(__file__)


# Path: grace/create.py
from builtins import object
from .error import FileNotWritableError, FolderAlreadyExistsError, FolderNotFoundError, CreateFolderError, FileNotFoundError, GeneralError
from shutil import copytree, copy, rmtree
from pkg_resources import resource_filename
from .utils import get_path
import os
import sys
import re
import requests
import tempfile
import zipfile
import hashlib

        if not os.path.exists(self._skeleton_path):
            raise FolderNotFoundError('Could not find the skeleton: ', self._skeleton_path)

        try:
            copytree(self._skeleton_path, os.path.join(self._cwd, self._projectName))
        except:
            raise CreateFolderError('Could not create the folders for the new project.')

    def _replace_strings(self):
        file_list = []
        for path, dirs, files in os.walk(self._projectPath):
            for f in files:
                file_list.append({
                    'file': f,
                    'path': path
                })

        for entry in file_list:
            if re.search('_X.', entry['file']):
                try:
                    self._replace(entry)
                except:
                    raise

    def _replace(self, fileObject):
        f = fileObject['file']
        p = fileObject['path']

        outfilename = f.replace('_X', '')
        with open(os.path.join(p, outfilename), 'w+') as out:

            infile = open(os.path.join(p, f))