StateStatus.means()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
dl 0
loc 4
rs 10
c 2
b 1
f 0
1
from __future__ import (
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
    absolute_import,
3
    division,
4
    print_function
5
)
6
7
import enum
8
9
10
class StateStatus(enum.Enum):
11
    """Enumeration of the possible :class:`State` statuses."""
12
    #: Pristin empty status.
13
    init = 0
14
    #: Input has been set and Steps are running or ready.
15
    running = 1
16
    #: All Steps are in the completed status or one was aborted.
17
    completed = 2
18
    #: All steps completed as successful.
19
    succeeded = completed | 4
20
    #: Step completed in failure.
21
    failed = completed | 8
22
23
    def means(self, status):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
24
        # E1101: Instance of 'StateStatus' has no 'value' member
25
        # pylint: disable=E1101
26
        return (self.value & status.value) == status.value
27
28
29
class StepStateStatus(enum.Enum):
30
    """Enumeration of the possible :class:`StepState` statuses."""
31
32
    #: Step is not started yet (may be waiting on dependencies).
33
    pending = 0
34
    #: Step is ready to be started
35
    ready = 1
36
    #: Step is running
37
    running = 2
38
    #: Step was either completed (sucess OR failure) or skipped.
39
    completed = 4
40
    #: Step resulted in a permanent error.
41
    aborted = 8
42
    #: Step completed as successful.
43
    succeeded = completed | 16
44
    #: Step completed in failure.
45
    failed = completed | 32
46
    #: Step was skipped (will not be run).
47
    skipped = completed | 64
48
49
    def means(self, status):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
50
        # E1101: Instance of 'StepStateStatus' has no 'value' member
51
        # pylint: disable=E1101
52
        return (self.value & status.value) == status.value
53