# Path: grace/error.py
# class FileNotFoundError(Error):
#     pass
# 
# class CreateFolderError(Error):
#     pass
# 
# class RemoveFolderError(Error):
#     pass
# 
# class FileNotWritableError(Error):
#     pass
# 
# class RemoveFileError(Error):
#     pass


from builtins import object
from .error import FileNotFoundError, CreateFolderError, RemoveFolderError, FileNotWritableError, RemoveFileError
from shutil import rmtree, copy2, copytree
import os
import re
import sys
        return lines

    def _build_html(self, build_path):
        source = os.path.join(self._cwd, 'test', 'index.html')
        dest = os.path.join(build_path, 'index.html')
        if not os.path.exists(source):
            return

        if os.path.exists(dest):
            try:
                os.remove(dest)
            except:
                raise RemoveFileError('Could not remove the existing html test file.')

        try:
            copy2(source, dest)
        except:
            raise FileNotWritableError('Could not write the html file.')

    def _build_libraries(self, build_path):
        source = os.path.join(self._cwd, 'test', 'lib')
        dest = os.path.join(build_path, 'lib')

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

        if os.path.exists(dest):
            try:
                rmtree(dest)
            except:

# Path: grace/error.py
# class FileNotFoundError(Error):
#     pass
# 
# class CreateFolderError(Error):
#     pass
# 
# class RemoveFolderError(Error):
#     pass
# 
# class FileNotWritableError(Error):
#     pass
# 
# class RemoveFileError(Error):
#     pass


# Path: grace/testit.py
from builtins import object
from .error import FileNotFoundError, CreateFolderError, RemoveFolderError, FileNotWritableError, RemoveFileError
from shutil import rmtree, copy2, copytree
import os
import re
import sys

        return lines

    def _build_html(self, build_path):
        source = os.path.join(self._cwd, 'test', 'index.html')
        dest = os.path.join(build_path, 'index.html')
        if not os.path.exists(source):
            return

        if os.path.exists(dest):
            try:
                os.remove(dest)
            except:
                raise RemoveFileError('Could not remove the existing html test file.')

        try:
            copy2(source, dest)
        except:
            raise FileNotWritableError('Could not write the html file.')

    def _build_libraries(self, build_path):
        source = os.path.join(self._cwd, 'test', 'lib')
        dest = os.path.join(build_path, 'lib')

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

        if os.path.exists(dest):
            try:
                rmtree(dest)
            except:

                raise RemoveFolderError('Could not remove the existing libraries folder.')