aboutsummaryrefslogtreecommitdiffstats
path: root/lvc/errors.py
diff options
context:
space:
mode:
authorJesús Eduardo <heckyel@hyperbola.info>2018-01-12 19:05:52 -0500
committerJesús Eduardo <heckyel@hyperbola.info>2018-01-12 19:05:52 -0500
commit87422eb2302f9e6f389b030f09cbcbcb3f9e9824 (patch)
tree7ee53619549e6329a93c69afe1172948b7392227 /lvc/errors.py
parent63bc1d96b6fd95beba9f35b6c56caa29c3e182d0 (diff)
downloadlibrevideoconverter-87422eb2302f9e6f389b030f09cbcbcb3f9e9824.tar.lz
librevideoconverter-87422eb2302f9e6f389b030f09cbcbcb3f9e9824.tar.xz
librevideoconverter-87422eb2302f9e6f389b030f09cbcbcb3f9e9824.zip
ajuste a pep8 lvc/errors.py
Diffstat (limited to 'lvc/errors.py')
-rw-r--r--lvc/errors.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lvc/errors.py b/lvc/errors.py
index 504948b..da774f1 100644
--- a/lvc/errors.py
+++ b/lvc/errors.py
@@ -27,20 +27,23 @@
# this exception statement from your version. If you delete this exception
# statement from all source files in the program, then also delete it here.
-"""``miro.errors`` -- Miro exceptions.
+"""``lvc.errors`` -- lvc exceptions.
"""
+
class ActionUnavailableError(ValueError):
"""The action attempted can not be done in the current state."""
def __init__(self, reason):
self.reason = reason
+
class WidgetActionError(ActionUnavailableError):
"""The widget is not in the right state to perform the requested action.
This usually is not serious, but if not handled the UI will likely be in an
incorrect state.
"""
+
class WidgetDomainError(WidgetActionError):
"""The widget element requested is not available at this time. This may be a
temporary condition or a result of permanent changes.
@@ -59,6 +62,7 @@ class WidgetDomainError(WidgetActionError):
reason += ": " + self.details
return reason
+
class WidgetRangeError(WidgetDomainError):
"""Class to handle neat display of ranges in WidgetDomainErrors. Handlers
should generally catch a parent of this.
@@ -67,6 +71,7 @@ class WidgetRangeError(WidgetDomainError):
haystack = "{0} to {1}".format(repr(start_range), repr(end_range))
WidgetDomainError.__init__(self, domain, needle, haystack, details)
+
class WidgetNotReadyError(WidgetActionError):
"""The widget is not ready to perfom the action given; this must be a
temporary condition that will be resolved when the widget finishes setting
@@ -79,11 +84,13 @@ class WidgetNotReadyError(WidgetActionError):
def reason(self):
return "waiting for {0}".format(self.waiting_for)
+
class UnexpectedWidgetError(ActionUnavailableError):
"""The Spanish Inquisition of widget errors. A widget was asked to do
something, had every reason to do so, yet refused. This should always cause
at least a soft_failure; the UI is now in an incorrect state.
"""
+
class WidgetUsageError(UnexpectedWidgetError):
"""A widget error that is likely the result of incorrect widget usage."""