Skip to content

Commit

Permalink
Moved __init__ methods with operation parameters to the "simple" ta…
Browse files Browse the repository at this point in the history
…sk classes
  • Loading branch information
fuzeman committed May 11, 2017
1 parent 6aa1961 commit e982b8e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
26 changes: 2 additions & 24 deletions byte/core/models/task/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
class ReadTask(Task):
"""Base read task class."""

def __init__(self, executor, operation):
"""Create read task.
:param executor: Executor
:type executor: byte.executors.core.base.Executor
:param operation: Operation
:type operation: byte.compilers.core.models.Operation
"""
super(ReadTask, self).__init__(executor)

self.operation = operation
pass


class SelectTask(ReadTask):
Expand All @@ -102,15 +91,4 @@ def __iter__(self):
class WriteTask(Task):
"""Base write task class."""

def __init__(self, executor, operations):
"""Create read task.
:param executor: Executor
:type executor: byte.executors.core.base.Executor
:param operations: Operations
:type operations: list of byte.compilers.core.models.Operation
"""
super(WriteTask, self).__init__(executor)

self.operations = operations
pass
26 changes: 25 additions & 1 deletion byte/core/models/task/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ class SimpleTask(Task):
class SimpleReadTask(ReadTask, SimpleTask):
"""Base simple read task class."""

pass
def __init__(self, executor, operation):
"""Create simple read task.
:param executor: Executor
:type executor: byte.executors.core.base.Executor
:param operation: Operation
:type operation: byte.compilers.core.models.Operation
"""
super(ReadTask, self).__init__(executor)

self.operation = operation


class SimpleSelectTask(SelectTask, SimpleTask):
Expand Down Expand Up @@ -70,6 +81,19 @@ def is_match(item, expressions):
class SimpleWriteTask(WriteTask, SimpleTask):
"""Base simple write task class."""

def __init__(self, executor, operations):
"""Create simple write task.
:param executor: Executor
:type executor: byte.executors.core.base.Executor
:param operations: Operations
:type operations: list of byte.compilers.core.models.Operation
"""
super(WriteTask, self).__init__(executor)

self.operations = operations

def decode(self):
"""Decode items."""
raise NotImplementedError
Expand Down

0 comments on commit e982b8e

Please sign in to comment.