# Path: lbuild/exception.py
# class BlobException(Exception):
#     """
#     Base class for exception thrown by lbuild.
#     """
#     pass


import os
import pkgutil
import logging
import collections
import lxml.etree
import lbuild.module
from .exception import BlobException
        # Path to the configuration file. Use to resolve relative paths.
        self.configpath = ""

        self.options = []
        self.selected_modules = []
        self.repositories = []
        self.cachefolder = None
        self.vcs = []

    @staticmethod
    def load_and_verify(configfile):
        """
        Verify the XML structure.
        """
        try:
            LOGGER.debug("Parse configuration '%s'", configfile)
            xmlroot = lxml.etree.parse(configfile)

            xmlschema = lxml.etree.fromstring(pkgutil.get_data('lbuild', 'resources/configuration.xsd'))

            schema = lxml.etree.XMLSchema(xmlschema)
            schema.assertValid(xmlroot)

            xmltree = xmlroot.getroot()
        except OSError as error:
            raise BlobException(error)
        except (lxml.etree.DocumentInvalid,
                lxml.etree.XMLSyntaxError,
                lxml.etree.XMLSchemaParseError,
                lxml.etree.XIncludeError) as error:

# Path: lbuild/exception.py
# class BlobException(Exception):
#     """
#     Base class for exception thrown by lbuild.
#     """
#     pass


# Path: lbuild/config.py
import os
import pkgutil
import logging
import collections
import lxml.etree
import lbuild.module
from .exception import BlobException

        # Path to the configuration file. Use to resolve relative paths.
        self.configpath = ""

        self.options = []
        self.selected_modules = []
        self.repositories = []
        self.cachefolder = None
        self.vcs = []

    @staticmethod
    def load_and_verify(configfile):
        """
        Verify the XML structure.
        """
        try:
            LOGGER.debug("Parse configuration '%s'", configfile)
            xmlroot = lxml.etree.parse(configfile)

            xmlschema = lxml.etree.fromstring(pkgutil.get_data('lbuild', 'resources/configuration.xsd'))

            schema = lxml.etree.XMLSchema(xmlschema)
            schema.assertValid(xmlroot)

            xmltree = xmlroot.getroot()
        except OSError as error:
            raise BlobException(error)
        except (lxml.etree.DocumentInvalid,
                lxml.etree.XMLSyntaxError,
                lxml.etree.XMLSchemaParseError,
                lxml.etree.XIncludeError) as error:

            raise BlobException("While parsing '{}':"