Пример #1
0
def checkTemplatesTableIntegrity(session=None):
	"""
	Checks Templates table integrity.

	:param session: Database session.
	:type session: Session
	:return: Templates table erroneous items.
	:rtype: dict
	"""

	LOGGER.debug("> Checking 'Templates' Database table integrity.")

	session = getSession(session)

	erroneousTemplates = {}
	if getTemplates(session):
		for template in getTemplates(session):
			exceptions = []
			if not foundations.common.pathExists(template.path):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingTemplateFileError)

			if not foundations.common.pathExists(template.helpFile):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingTemplateHelpFileError)

			if exceptions:
				erroneousTemplates[template] = exceptions

	return erroneousTemplates
Пример #2
0
def checkTemplatesTableIntegrity(session=None):
    """
	Checks Templates table integrity.

	:param session: Database session.
	:type session: Session
	:return: Templates table erroneous items.
	:rtype: dict
	"""

    LOGGER.debug("> Checking 'Templates' Database table integrity.")

    session = getSession(session)

    erroneousTemplates = {}
    if getTemplates(session):
        for template in getTemplates(session):
            exceptions = []
            if not foundations.common.pathExists(template.path):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingTemplateFileError)

            if not foundations.common.pathExists(template.helpFile):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingTemplateHelpFileError)

            if exceptions:
                erroneousTemplates[template] = exceptions

    return erroneousTemplates
Пример #3
0
def checkIblSetsTableIntegrity(session=None):
	"""
	Checks sets table integrity.

	:param session: Database session.
	:type session: Session
	:return: Ibl Sets table erroneous items.
	:rtype: dict
	"""

	LOGGER.debug("> Checking 'Sets' Database table integrity.")

	session = getSession(session)

	erroneousIblSets = {}
	if getIblSets(session):
		for iblSet in getIblSets(session):
			exceptions = []
			if not foundations.common.pathExists(iblSet.path):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingIblSetFileError)

			if not foundations.common.pathExists(iblSet.icon):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingIblSetIconError)

			if iblSet.previewImage and not foundations.common.pathExists(os.path.join(os.path.dirname(iblSet.path),
																	iblSet.previewImage)):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingIblSetPreviewImageError)
			if iblSet.backgroundImage and not foundations.common.pathExists(os.path.join(os.path.dirname(iblSet.path),
																		iblSet.backgroundImage)):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingIblSetBackgroundImageError)
			if iblSet.lightingImage and not foundations.common.pathExists(os.path.join(os.path.dirname(iblSet.path),
																		iblSet.lightingImage)):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingIblSetLightingImageError)
			if iblSet.reflectionImage and not foundations.common.pathExists(os.path.join(os.path.dirname(iblSet.path),
																		iblSet.reflectionImage)):
				exceptions.append(sibl_gui.components.core.database.exceptions.MissingIblSetReflectionImageError)

			if exceptions:
				erroneousIblSets[iblSet] = exceptions

	return erroneousIblSets
Пример #4
0
def checkIblSetsTableIntegrity(session=None):
    """
	Checks sets table integrity.

	:param session: Database session.
	:type session: Session
	:return: Ibl Sets table erroneous items.
	:rtype: dict
	"""

    LOGGER.debug("> Checking 'Sets' Database table integrity.")

    session = getSession(session)

    erroneousIblSets = {}
    if getIblSets(session):
        for iblSet in getIblSets(session):
            exceptions = []
            if not foundations.common.pathExists(iblSet.path):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingIblSetFileError)

            if not foundations.common.pathExists(iblSet.icon):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingIblSetIconError)

            if iblSet.previewImage and not foundations.common.pathExists(
                    os.path.join(os.path.dirname(iblSet.path),
                                 iblSet.previewImage)):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingIblSetPreviewImageError)
            if iblSet.backgroundImage and not foundations.common.pathExists(
                    os.path.join(os.path.dirname(iblSet.path),
                                 iblSet.backgroundImage)):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingIblSetBackgroundImageError)
            if iblSet.lightingImage and not foundations.common.pathExists(
                    os.path.join(os.path.dirname(iblSet.path),
                                 iblSet.lightingImage)):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingIblSetLightingImageError)
            if iblSet.reflectionImage and not foundations.common.pathExists(
                    os.path.join(os.path.dirname(iblSet.path),
                                 iblSet.reflectionImage)):
                exceptions.append(sibl_gui.components.core.database.exceptions.
                                  MissingIblSetReflectionImageError)

            if exceptions:
                erroneousIblSets[iblSet] = exceptions

    return erroneousIblSets