Completed
Push — master ( 980041...30b693 )
by
unknown
10s
created

topik.fileio.InputRegistry   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %
Metric Value
dl 0
loc 8
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A InputRegistry.__init__() 0 3 1
1
from functools import partial
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
from six.moves import UserDict
0 ignored issues
show
Configuration introduced by
The import six.moves could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
3
4
from topik.singleton_registry import _base_register_decorator
5
6
7
class InputRegistry(UserDict, object):
8
    """Uses Borg design pattern.  Core idea is that there is a global registry for each step's
9
    possible methods
10
    """
11
    __shared_state = {}
12
    def __init__(self):
13
        self.__dict__ = self.__shared_state
14
        super(InputRegistry, self).__init__()
15
16
17
class OutputRegistry(UserDict, object):
18
    """Uses Borg design pattern.  Core idea is that there is a global registry for each step's
19
    possible methods
20
    """
21
    __shared_state = {}
22
    def __init__(self):
23
        self.__dict__ = self.__shared_state
24
        super(OutputRegistry, self).__init__()
25
26
27
# a nicer, more pythonic handle to our singleton instance
28
registered_inputs = InputRegistry()
0 ignored issues
show
Coding Style Naming introduced by
The name registered_inputs does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
29
registered_outputs = OutputRegistry()
0 ignored issues
show
Coding Style Naming introduced by
The name registered_outputs does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
30
31
32
# fill in the registration function
33
register_input = partial(_base_register_decorator, registered_inputs)
0 ignored issues
show
Coding Style Naming introduced by
The name register_input does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
34
register_output = partial(_base_register_decorator, registered_outputs)
0 ignored issues
show
Coding Style Naming introduced by
The name register_output does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
35