[Bf-blender-cvs] [c2ed1453226] soc-2017-package_manager: pep8-ify bpkg/messages.py
gandalf3
noreply at git.blender.org
Tue Aug 29 11:46:24 CEST 2017
Commit: c2ed14532265a85cf46c45b03e4b90a2a1ee6046
Author: gandalf3
Date: Tue Aug 29 00:24:00 2017 -0700
Branches: soc-2017-package_manager
https://developer.blender.org/rBc2ed14532265a85cf46c45b03e4b90a2a1ee6046
pep8-ify bpkg/messages.py
===================================================================
M release/scripts/modules/bpkg/messages.py
===================================================================
diff --git a/release/scripts/modules/bpkg/messages.py b/release/scripts/modules/bpkg/messages.py
index cb9d9ebe8d8..6c988be7864 100644
--- a/release/scripts/modules/bpkg/messages.py
+++ b/release/scripts/modules/bpkg/messages.py
@@ -1,5 +1,6 @@
from .types import Repository
+
class Message:
"""Superclass for all message sent over pipes."""
@@ -9,6 +10,7 @@ class Message:
class BlenderMessage(Message):
"""Superclass for all messages sent from Blender to the subprocess."""
+
class Abort(BlenderMessage):
"""Sent when the user requests abortion of a task."""
@@ -18,6 +20,7 @@ class Abort(BlenderMessage):
class SubprocMessage(Message):
"""Superclass for all messages sent from the subprocess to Blender."""
+
class Progress(SubprocMessage):
"""Send from subprocess to Blender to report progress.
@@ -27,39 +30,46 @@ class Progress(SubprocMessage):
def __init__(self, progress: float):
self.progress = progress
+
class Success(SubprocMessage):
"""Sent when an operation finished sucessfully."""
+
class RepositoryResult(SubprocMessage):
"""Sent when an operation returns a repository to be used on the parent process."""
def __init__(self, repository_name: str):
self.repository = repository
+
class Aborted(SubprocMessage):
"""Sent as response to Abort message."""
# subproc errors
+
class SubprocError(SubprocMessage):
"""Superclass for all fatal error messages sent from the subprocess."""
def __init__(self, message: str):
self.message = message
+
class InstallError(SubprocError):
"""Sent when there was an error installing something."""
+
class UninstallError(SubprocError):
"""Sent when there was an error uninstalling something."""
+
class BadRepositoryError(SubprocError):
"""Sent when a repository can't be used for some reason"""
+
class DownloadError(SubprocError):
"""Sent when there was an error downloading something."""
def __init__(self, message: str, status_code: int = None):
self.status_code = status_code
self.message = message
-
More information about the Bf-blender-cvs
mailing list