pylint-aria-events

Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/43ec8ada
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/43ec8ada
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/43ec8ada

Branch: refs/heads/pylint-aria-events
Commit: 43ec8adac24a7641237aec41f197927b72cac199
Parents: 62cf248
Author: mxmrlv <[email protected]>
Authored: Wed Oct 19 16:03:31 2016 +0300
Committer: mxmrlv <[email protected]>
Committed: Thu Oct 20 16:17:36 2016 +0300

----------------------------------------------------------------------
 aria/events/__init__.py                      | 28 +++++++++++++++++++++++
 aria/events/builtin_event_handler.py         | 14 +++++++++---
 aria/events/workflow_engine_event_handler.py | 20 +++++++++++-----
 tests/.pylintrc                              |  1 -
 4 files changed, 53 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/43ec8ada/aria/events/__init__.py
----------------------------------------------------------------------
diff --git a/aria/events/__init__.py b/aria/events/__init__.py
index c9d7b20..031777d 100644
--- a/aria/events/__init__.py
+++ b/aria/events/__init__.py
@@ -13,6 +13,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+"""
+Aria's events Sub-Package
+Path: aria.events
+
+Events package provides events mechanism for different executions in aria.
+
+
+1. storage_event_handler: implementation of storage handlers for workflow and 
operation events.
+2. logger_event_handler: implementation of logger handlers for workflow and 
operation events.
+
+API:
+    * start_task_signal
+    * on_success_task_signal
+    * on_failure_task_signal
+    * start_workflow_signal
+    * on_success_workflow_signal
+    * on_failure_workflow_signal
+"""
+
 import os
 
 from blinker import signal
@@ -20,6 +39,15 @@ from blinker import signal
 from ..tools.plugin import plugin_installer
 
 
+__all__ = (
+    'start_task_signal',
+    'on_success_task_signal',
+    'on_failure_task_signal',
+    'start_workflow_signal',
+    'on_success_workflow_signal',
+    'on_failure_workflow_signal'
+)
+
 # workflow engine task signals:
 start_task_signal = signal('start_task_signal')
 on_success_task_signal = signal('success_task_signal')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/43ec8ada/aria/events/builtin_event_handler.py
----------------------------------------------------------------------
diff --git a/aria/events/builtin_event_handler.py 
b/aria/events/builtin_event_handler.py
index 404cc01..ec3238f 100644
--- a/aria/events/builtin_event_handler.py
+++ b/aria/events/builtin_event_handler.py
@@ -13,6 +13,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+"""
+Aria's events Sub-Package
+Path: aria.events.storage_event_handler
+
+Implementation of storage handlers for workflow and operation events.
+"""
+
+
 from datetime import datetime
 
 from . import (
@@ -54,13 +62,13 @@ def _task_succeeded(task, *args, **kwargs):
 
 @start_workflow_signal.connect
 def _workflow_started(workflow_context, *args, **kwargs):
-    Execution = workflow_context.storage.execution.model_cls
-    execution = Execution(
+    execution_cls = workflow_context.storage.execution.model_cls
+    execution = execution_cls(
         id=workflow_context.execution_id,
         deployment_id=workflow_context.deployment_id,
         workflow_id=workflow_context.workflow_id,
         blueprint_id=workflow_context.blueprint_id,
-        status=Execution.PENDING,
+        status=execution_cls.PENDING,
         started_at=datetime.utcnow(),
         parameters=workflow_context.parameters,
     )

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/43ec8ada/aria/events/workflow_engine_event_handler.py
----------------------------------------------------------------------
diff --git a/aria/events/workflow_engine_event_handler.py 
b/aria/events/workflow_engine_event_handler.py
index 6916206..60138e1 100644
--- a/aria/events/workflow_engine_event_handler.py
+++ b/aria/events/workflow_engine_event_handler.py
@@ -13,6 +13,14 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
+"""
+Aria's events Sub-Package
+Path: aria.events.storage_event_handler
+
+Implementation of logger handlers for workflow and operation events.
+"""
+
 from . import (
     start_task_signal,
     on_success_task_signal,
@@ -24,37 +32,37 @@ from . import (
 
 
 @start_task_signal.connect
-def start_task_handler(task, **kwargs):
+def _start_task_handler(task, **kwargs):
     task.logger.debug(
         'Event: Starting task: {task.name}'.format(task=task))
 
 
 @on_success_task_signal.connect
-def success_task_handler(task, **kwargs):
+def _success_task_handler(task, **kwargs):
     task.logger.debug(
         'Event: Task success: {task.name}'.format(task=task))
 
 
 @on_failure_task_signal.connect
-def failure_operation_handler(task, **kwargs):
+def _failure_operation_handler(task, **kwargs):
     task.logger.error(
         'Event: Task failure: {task.name}'.format(task=task),
         exc_info=kwargs.get('exception', True))
 
 
 @start_workflow_signal.connect
-def start_workflow_handler(context, **kwargs):
+def _start_workflow_handler(context, **kwargs):
     context.logger.debug(
         'Event: Starting workflow: {context.name}'.format(context=context))
 
 
 @on_failure_workflow_signal.connect
-def failure_workflow_handler(context, **kwargs):
+def _failure_workflow_handler(context, **kwargs):
     context.logger.debug(
         'Event: Workflow failure: {context.name}'.format(context=context))
 
 
 @on_success_workflow_signal.connect
-def success_workflow_handler(context, **kwargs):
+def _success_workflow_handler(context, **kwargs):
     context.logger.debug(
         'Event: Workflow success: {context.name}'.format(context=context))

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/43ec8ada/tests/.pylintrc
----------------------------------------------------------------------
diff --git a/tests/.pylintrc b/tests/.pylintrc
index 753d619..f6cfd7a 100644
--- a/tests/.pylintrc
+++ b/tests/.pylintrc
@@ -404,5 +404,4 @@ overgeneral-exceptions=Exception
 
 
 [pre-commit-hook]
-params=--reports=no
 limit=9.5

Reply via email to