# Path: grace/error.py
# class WrongFormatError(Error):
#     pass
# 
# class MissingKeyError(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class KeyNotAllowedError(Error):
#     pass
# 
# Path: grace/utils.py
# def update(d, u):
#     for k, v in u.items():
#         if isinstance(v, collections.Mapping):
#             r = update(d.get(k, {}), v)
#             d[k] = r
#         else:
#             d[k] = u[k]
#     return d
# 
# def load_json(string):
#     obj = {}
# 
#     try:
#         obj = json.loads(string)
#     except ValueError as e:
#         raise e
# 
#     if sys.version_info.major < 3:
#         return _json_decode(obj)
# 
#     # if sys.version_info.major < 3:
#     #     d = _json_decode(obj)
#     #     if 'dizmo_settings' in d:
#     #         print(isinstance(d['dizmo_settings']['display_name'], str))
#     #         print(isinstance(d['dizmo_settings']['display_name'], unicode))
#     #         print(type(d['dizmo_settings']['display_name']))
#     #     return d
# 
#     return obj
# 
# def isstring(string):
#     if isinstance(string, str):
#         return True
# 
#     if sys.version_info.major < 3:
#         if isinstance(string, newstr):
#             return True
#         if isinstance(string, basestring):
#             return True
# 
#     return False


from builtins import object
from .error import WrongFormatError, MissingKeyError, FileNotFoundError, KeyNotAllowedError
from .utils import update, load_json, isstring
import os
import re
                    if url.endswith('tar'):
                        urltype = 'tar'
                    if url.endswith('zip'):
                        urltype = 'zip'
                    if url.endswith('git'):
                        urltype = 'git'
                    if os.path.exists(url):
                        urltype = 'file'
                    branch = 'master'

                    self._config['embedded_projects'][index]['source'] = {
                        'url': url,
                        'type': urltype,
                        'branch': branch
                    }

                if 'destination' not in project:
                    raise MissingKeyError('The config file defines a source, but no destination was given.')
                else:
                    if not isstring(project['destination']):
                        raise WrongFormatError('Destination has to be a string.')

                if 'options' not in project:
                    self._config['embedded_projects'][index]['options'] = {}

                if self._config['embedded_projects'][index]['source']['type'] == 'file':
                    self._config['embedded_projects'][index]['source']['url'] = os.path.abspath(self._config['embedded_projects'][index]['source']['url'])

    def _load_configurations(self):
        config_file = None

# Path: grace/error.py
# class WrongFormatError(Error):
#     pass
# 
# class MissingKeyError(Error):
#     pass
# 
# class FileNotFoundError(Error):
#     pass
# 
# class KeyNotAllowedError(Error):
#     pass
# 
# Path: grace/utils.py
# def update(d, u):
#     for k, v in u.items():
#         if isinstance(v, collections.Mapping):
#             r = update(d.get(k, {}), v)
#             d[k] = r
#         else:
#             d[k] = u[k]
#     return d
# 
# def load_json(string):
#     obj = {}
# 
#     try:
#         obj = json.loads(string)
#     except ValueError as e:
#         raise e
# 
#     if sys.version_info.major < 3:
#         return _json_decode(obj)
# 
#     # if sys.version_info.major < 3:
#     #     d = _json_decode(obj)
#     #     if 'dizmo_settings' in d:
#     #         print(isinstance(d['dizmo_settings']['display_name'], str))
#     #         print(isinstance(d['dizmo_settings']['display_name'], unicode))
#     #         print(type(d['dizmo_settings']['display_name']))
#     #     return d
# 
#     return obj
# 
# def isstring(string):
#     if isinstance(string, str):
#         return True
# 
#     if sys.version_info.major < 3:
#         if isinstance(string, newstr):
#             return True
#         if isinstance(string, basestring):
#             return True
# 
#     return False


# Path: grace/config.py
from builtins import object
from .error import WrongFormatError, MissingKeyError, FileNotFoundError, KeyNotAllowedError
from .utils import update, load_json, isstring
import os
import re

                    if url.endswith('tar'):
                        urltype = 'tar'
                    if url.endswith('zip'):
                        urltype = 'zip'
                    if url.endswith('git'):
                        urltype = 'git'
                    if os.path.exists(url):
                        urltype = 'file'
                    branch = 'master'

                    self._config['embedded_projects'][index]['source'] = {
                        'url': url,
                        'type': urltype,
                        'branch': branch
                    }

                if 'destination' not in project:
                    raise MissingKeyError('The config file defines a source, but no destination was given.')
                else:
                    if not isstring(project['destination']):
                        raise WrongFormatError('Destination has to be a string.')

                if 'options' not in project:
                    self._config['embedded_projects'][index]['options'] = {}

                if self._config['embedded_projects'][index]['source']['type'] == 'file':
                    self._config['embedded_projects'][index]['source']['url'] = os.path.abspath(self._config['embedded_projects'][index]['source']['url'])

    def _load_configurations(self):
        config_file = None

        cwd = os.getcwd()