Completed
Push — master ( 5a409f...256abe )
by P.R.
02:05
created

SDocCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 31
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from sdoc.SDoc import SDoc
10
from sdoc.command.BaseCommand import BaseCommand
11
from sdoc.style.SdocStyle import SdocStyle
0 ignored issues
show
Bug introduced by
The name style does not seem to exist in module sdoc.
Loading history...
Configuration introduced by
The import sdoc.style.SdocStyle 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...
12
13
14
class SDocCommand(BaseCommand):
15
    """
16
    Generates the target document(s)
17
    """
18
    name = 'sdoc'
19
20
    arguments = [
21
        {
22
            'name':        'config.cfg',
23
            'description': 'The name of the config file',
24
            'required':    True
25
        },
26
        {
27
            'name':        'main.sdoc',
28
            'description': "The SDoc file",
29
            'required':    True
30
        }
31
    ]
32
33
    # ------------------------------------------------------------------------------------------------------------------
34
    def handle(self):
35
        """
36
        Reads the arguments and starts SDoc application.
37
        """
38
        self._io = SdocStyle(self.input, self.output)
0 ignored issues
show
Bug introduced by
The Instance of SDocCommand does not seem to have a member named input.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Bug introduced by
The Instance of SDocCommand does not seem to have a member named output.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
39
40
        sdoc = SDoc()
41
        sdoc.io = self._io
42
        sdoc.config_path = self.argument('config.cfg')
0 ignored issues
show
Bug introduced by
The Instance of SDocCommand does not seem to have a member named argument.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
43
44
        return sdoc.run_sdoc(self.argument('main.sdoc'))
0 ignored issues
show
Bug introduced by
The Instance of SDocCommand does not seem to have a member named argument.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
45
46
# ----------------------------------------------------------------------------------------------------------------------
47