Source code for umbra.exceptions

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
**exceptions.py**

**Platform:**
	Windows, Linux, Mac Os X.

**Description:**
	This module defines **Umbra** package exceptions. 

**Others:**

"""

#**********************************************************************************************************************
#***	Future imports.
#**********************************************************************************************************************
from __future__ import unicode_literals

#**********************************************************************************************************************
#***	Internal imports.
#**********************************************************************************************************************
import foundations.exceptions
from umbra.globals.runtimeGlobals import RuntimeGlobals
from umbra.globals.uiConstants import UiConstants

#**********************************************************************************************************************
#***	Module attributes.
#**********************************************************************************************************************
__author__ = "Thomas Mansencal"
__copyright__ = "Copyright (C) 2008 - 2013 - Thomas Mansencal"
__license__ = "GPL V3.0 - http://www.gnu.org/licenses/"
__maintainer__ = "Thomas Mansencal"
__email__ = "thomas.mansencal@gmail.com"
__status__ = "Production"

__all__ = ["LOGGER",
		"notifyExceptionHandler",
		"AbstractEngineError",
		"EngineConfigurationError",
		"EngineInitializationError",
		"ResourceExistsError",
		"AbstractActionsManagerError",
		"CategoryExistsError",
		"ActionExistsError",
		"AbstractPatchesManagerError",
		"PatchRegistrationError",
		"PatchInterfaceError",
		"PatchApplyError",
		"AbstractLayoutsManagerError",
		"LayoutRegistrationError",
		"LayoutExistError",
		"AbstractFileSystemEventsManagerError",
		"PathRegistrationError",
		"PathExistsError",
		"AbstractLanguageError",
		"LanguageGrammarError"]

#**********************************************************************************************************************
#***	Module classes and definitions.
#**********************************************************************************************************************
[docs]def notifyExceptionHandler(*args): """ This definition provides a notifier exception handler. :param \*args: Arguments. ( \* ) :return: Definition success. ( Boolean ) """ callback = RuntimeGlobals.componentsManager["factory.scriptEditor"].restoreDevelopmentLayout foundations.exceptions.baseExceptionHandler(*args) cls, instance = foundations.exceptions.extractException(*args)[:2] RuntimeGlobals.notificationsManager.exceptify(message="{0}".format(instance), notificationClickedSlot=callback) return True
[docs]class AbstractEngineError(foundations.exceptions.AbstractError): """ This class is the abstract base class for engine related exceptions. """ pass
[docs]class EngineConfigurationError(AbstractEngineError): """ This class is used for engine configuration exceptions. """ pass
[docs]class EngineInitializationError(AbstractEngineError): """ This class is used for engine initialization exceptions. """ pass
[docs]class ResourceExistsError(foundations.exceptions.AbstractOsError): """ This class is used for non existing resource exceptions. """ pass
[docs]class AbstractActionsManagerError(foundations.exceptions.AbstractError): """ This class is the abstract base class for :class:`umbra.managers.actionsManager.ActionsManager` related exceptions. """ pass
[docs]class CategoryExistsError(AbstractActionsManagerError): """ This class is used for non existing category exceptions. """ pass
[docs]class ActionExistsError(AbstractActionsManagerError): """ This class is used for non existing action exceptions. """ pass
[docs]class AbstractPatchesManagerError(foundations.exceptions.AbstractError): """ This class is the abstract base class for :class:`umbra.managers.patchesManager.PatchesManager` related exceptions. """ pass
[docs]class PatchRegistrationError(AbstractPatchesManagerError): """ This class is used for patch registration exceptions. """ pass
[docs]class PatchInterfaceError(AbstractPatchesManagerError): """ This class is used for patch interface exceptions. """ pass
[docs]class PatchApplyError(AbstractPatchesManagerError): """ This class is used for patch apply exceptions. """ pass
[docs]class AbstractLayoutsManagerError(foundations.exceptions.AbstractError): """ This class is the abstract base class for :class:`umbra.managers.layoutsManager.LayoutsManager` related exceptions. """ pass
[docs]class LayoutRegistrationError(AbstractLayoutsManagerError): """ This class is used for layout registration exceptions. """ pass
[docs]class LayoutExistError(AbstractLayoutsManagerError): """ This class is used for non existing layout exceptions. """ pass
[docs]class AbstractFileSystemEventsManagerError(foundations.exceptions.AbstractError): """ This class is the abstract base class for :class:`umbra.managers.fileSystemEventsManager.FileSystemEventsManager` related exceptions. """ pass
[docs]class PathRegistrationError(AbstractFileSystemEventsManagerError): """ This class is used for path registration exceptions. """ pass
[docs]class PathExistsError(AbstractFileSystemEventsManagerError): """ This class is used for non existing path exceptions. """ pass
[docs]class AbstractLanguageError(foundations.exceptions.AbstractError): """ This class is the abstract base class for language related exceptions. """ pass
[docs]class LanguageGrammarError(AbstractLanguageError): """ This class is used for language grammar exceptions. """ pass