Completed
Push — master ( 354480...4c8e7d )
by P.R.
01:56
created

SDoc1Command.handle()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
1
"""
2
SDoc
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
# ----------------------------------------------------------------------------------------------------------------------
9
from cleo import Command
0 ignored issues
show
Configuration introduced by
The import cleo 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...
10
11
from sdoc.SDoc import SDoc
12
13
14
class SDoc1Command(Command):
0 ignored issues
show
Coding Style introduced by
This class has no __init__ method.
Loading history...
15
    """
16
    Parses a SDoc1 document and generates a SDoc2 document
17
    """
18
19
    name = 'sdoc1'
20
21
    arguments = [
22
        {
23
            'name':        'main.sdoc',
24
            'description': 'The SDoc1 document to parse',
25
            'required':    True
26
        },
27
        {
28
            'name':        'output.sdoc2',
29
            'description': 'The generated SDoc document',
30
            'required':    True
31
        }
32
    ]
33
34
    # ------------------------------------------------------------------------------------------------------------------
35
    def handle(self):
36
        """
37
        Reads the arguments and starts SDoc1 application.
38
        """
39
        main_sdoc_file = self.argument('main.sdoc')
0 ignored issues
show
Bug introduced by
The Instance of SDoc1Command 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...
40
        output_file = self.argument('output.sdoc2')
0 ignored issues
show
Bug introduced by
The Instance of SDoc1Command 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...
41
42
        sdoc = SDoc()
43
        sdoc.test_sdoc1(main_sdoc_file, output_file)
44
45
# ----------------------------------------------------------------------------------------------------------------------
46