# 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/error.py
# class FolderNotFoundError(Error):
#     pass
# 
# class FolderNotWritableError(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class FileNotWritableError(Error):
#     pass


from builtins import input
from builtins import object
from .utils import get_path
from shutil import copytree, rmtree
from .error import FolderNotFoundError, FolderNotWritableError, FileNotFoundError, FileNotWritableError
from pkg_resources import resource_filename
import os
import sys
            except:
                raise RemoveFileError('Could not remove the old project.cfg file at: ' + current_config_path)

        self._replace_lines_and_copy(new_config_path, current_config_path)

    def _update_libs(self):
        if self._test:
            new_libs_dir = os.path.join(self._skeleton_path, 'test', 'lib')
            current_libs_dir = os.path.join(self._cwd, 'test', 'lib')
        else:
            new_libs_dir = os.path.join(self._skeleton_path, 'src', 'lib')
            current_libs_dir = os.path.join(self._cwd, 'src', 'lib')

        if not os.path.exists(new_libs_dir):
            return

        try:
            self._update_files(new_libs_dir, current_libs_dir)
        except:
            raise

    def _update_html(self):
        if self._test:
            new_html_path = os.path.join(self._skeleton_path, 'test', 'index_X.html')
            current_html_path = os.path.join(self._cwd, 'test', 'index.html')
        else:
            new_html_path = os.path.join(self._skeleton_path, 'src', 'index_X.html')
            current_html_path = os.path.join(self._cwd, 'src', 'index.html')

        if not os.path.exists(new_html_path):

# 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/error.py
# class FolderNotFoundError(Error):
#     pass
# 
# class FolderNotWritableError(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class FileNotWritableError(Error):
#     pass


# Path: grace/update.py
from builtins import input
from builtins import object
from .utils import get_path
from shutil import copytree, rmtree
from .error import FolderNotFoundError, FolderNotWritableError, FileNotFoundError, FileNotWritableError
from pkg_resources import resource_filename
import os
import sys

            except:
                raise RemoveFileError('Could not remove the old project.cfg file at: ' + current_config_path)

        self._replace_lines_and_copy(new_config_path, current_config_path)

    def _update_libs(self):
        if self._test:
            new_libs_dir = os.path.join(self._skeleton_path, 'test', 'lib')
            current_libs_dir = os.path.join(self._cwd, 'test', 'lib')
        else:
            new_libs_dir = os.path.join(self._skeleton_path, 'src', 'lib')
            current_libs_dir = os.path.join(self._cwd, 'src', 'lib')

        if not os.path.exists(new_libs_dir):
            return

        try:
            self._update_files(new_libs_dir, current_libs_dir)
        except:
            raise

    def _update_html(self):
        if self._test:
            new_html_path = os.path.join(self._skeleton_path, 'test', 'index_X.html')
            current_html_path = os.path.join(self._cwd, 'test', 'index.html')
        else:
            new_html_path = os.path.join(self._skeleton_path, 'src', 'index_X.html')
            current_html_path = os.path.join(self._cwd, 'src', 'index.html')

        if not os.path.exists(new_html_path):

            raise FileNotFoundError('Could not find the new html file at: ' + new_html_path)