# 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
            try:
                os.makedirs(self._skeleton_parent_folder)
            except:
                z.close()
                rmtree(tmp_path)
                raise FolderNotWritableError('Could not create the skeleton parent folder.')

        if os.path.exists(self._skeleton_path):
            try:
                rmtree(self._skeleton_path)
            except:
                z.close()
                rmtree(tmp_path)
                raise FolderNotWritableError('Could not remove the saved skeleton.')

        try:
            copytree(os.path.join(tmp_path, z.namelist()[0]), self._skeleton_path)
        except:
            z.close()
            rmtree(tmp_path)
            raise FolderNotFoundError('Could not find the folder to save the skeleton.')

        z.close()
        rmtree(tmp_path)

    def _copy_structure(self):
        if os.path.exists(os.path.join(self._cwd, self._projectName)):
            raise FolderAlreadyExistsError('There is already a folder with the projectname present!')

        if not os.path.exists(self._skeleton_path):

# 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

            try:
                os.makedirs(self._skeleton_parent_folder)
            except:
                z.close()
                rmtree(tmp_path)
                raise FolderNotWritableError('Could not create the skeleton parent folder.')

        if os.path.exists(self._skeleton_path):
            try:
                rmtree(self._skeleton_path)
            except:
                z.close()
                rmtree(tmp_path)
                raise FolderNotWritableError('Could not remove the saved skeleton.')

        try:
            copytree(os.path.join(tmp_path, z.namelist()[0]), self._skeleton_path)
        except:
            z.close()
            rmtree(tmp_path)
            raise FolderNotFoundError('Could not find the folder to save the skeleton.')

        z.close()
        rmtree(tmp_path)

    def _copy_structure(self):
        if os.path.exists(os.path.join(self._cwd, self._projectName)):
            raise FolderAlreadyExistsError('There is already a folder with the projectname present!')

        if not os.path.exists(self._skeleton_path):

            raise FolderNotFoundError('Could not find the skeleton: ', self._skeleton_path)