From 661ff7c575189d7bca661ff7f396f2bcaf9bafdb Mon Sep 17 00:00:00 2001 From: Artur Barseghyan Date: Mon, 19 Sep 2016 16:29:07 +0200 Subject: [PATCH] exceptions.py pep8 --- src/fobi/dynamic.py | 2 +- src/fobi/exceptions.py | 60 ++++++++++++++++-------------------------- 2 files changed, 24 insertions(+), 38 deletions(-) diff --git a/src/fobi/dynamic.py b/src/fobi/dynamic.py index a4fb61bd..d9077d8f 100644 --- a/src/fobi/dynamic.py +++ b/src/fobi/dynamic.py @@ -7,7 +7,7 @@ from nine.versions import DJANGO_GTE_1_7 __title__ = 'fobi.dynamic' __author__ = 'Artur Barseghyan ' -__copyright__ = '2014-2015 Artur Barseghyan' +__copyright__ = '2014-2016 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ('assemble_form_class',) diff --git a/src/fobi/exceptions.py b/src/fobi/exceptions.py index 069826a2..fba5d729 100644 --- a/src/fobi/exceptions.py +++ b/src/fobi/exceptions.py @@ -1,84 +1,70 @@ __title__ = 'fobi.exceptions' __author__ = 'Artur Barseghyan ' -__copyright__ = '2014-2015 Artur Barseghyan' +__copyright__ = '2014-2016 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ( - 'BaseException', 'ImproperlyConfigured', 'InvalidRegistryItemType', + 'BaseException', 'ImproperlyConfigured', 'InvalidRegistryItemType', 'DoesNotExist', 'ThemeDoesNotExist', 'PluginDoesNotExist', 'FormElementPluginDoesNotExist', 'FormHandlerPluginDoesNotExist', 'NoDefaultThemeSet', 'FormPluginError', 'FormElementPluginError', 'FormHandlerPluginError', 'FormCallbackError', ) + class BaseException(Exception): - """ - Base exception. - """ + """Base exception.""" class ImproperlyConfigured(BaseException): - """ + """Improperly configured. + Exception raised when developer didn't configure/write the code properly. """ class InvalidRegistryItemType(ValueError, BaseException): - """ + """Invalid registry item type. + Raised when an attempt is made to register an item in the registry which does not have a proper type. """ class DoesNotExist(BaseException): - """ - Raised when something does not exist. - """ + """Raised when something does not exist.""" class ThemeDoesNotExist(DoesNotExist): - """ - Raised when no theme with given uid can be found. - """ + """Raised when no theme with given uid can be found.""" class PluginDoesNotExist(DoesNotExist): - """ - Raised when no plugin with given uid can be found. - """ + """Raised when no plugin with given uid can be found.""" class FormElementPluginDoesNotExist(PluginDoesNotExist): - """ - Raised when no form element plugin with given uid can be found. - """ + """Raised when no form element plugin with given uid can be found.""" class FormHandlerPluginDoesNotExist(PluginDoesNotExist): - """ - Raised when no form handler plugin with given uid can be found. - """ + """Raised when no form handler plugin with given uid can be found.""" + class NoDefaultThemeSet(ImproperlyConfigured): - """ - Raised when no active theme is chosen. - """ + """Raised when no active theme is chosen.""" + class FormPluginError(BaseException): - """ - Base error for form elements and handers. - """ + """Base error for form elements and handlers.""" + class FormElementPluginError(FormPluginError): - """ - Raised when form element plugin error occurs. - """ + """Raised when form element plugin error occurs.""" + class FormHandlerPluginError(FormPluginError): - """ - Raised when form handler plugin error occurs. - """ + """Raised when form handler plugin error occurs.""" + class FormCallbackError(FormPluginError): - """ - Raised when form callback error occurs. - """ + """Raised when form callback error occurs."""