Completed
Push — master ( 5db226...8f2faa )
by P.R.
03:03
created

SDocCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
dl 0
loc 31
ccs 9
cts 9
cp 1
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 1
from sdoc.SDoc import SDoc
10 1
from sdoc.command.BaseCommand import BaseCommand
11 1
from sdoc.style.SdocStyle import SdocStyle
12
13
14 1
class SDocCommand(BaseCommand):
15
    """
16
    Generates the target document(s)
17
    """
18 1
    name = 'sdoc'
19
20 1
    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 1
    def handle(self):
35
        """
36
        Reads the arguments and starts SDoc application.
37
        """
38 1
        self._io = SdocStyle(self.input, self.output)
39
40 1
        sdoc = SDoc()
41 1
        sdoc.io = self._io
42 1
        sdoc.config_path = self.argument('config.cfg')
43
44 1
        return sdoc.run_sdoc(self.argument('main.sdoc'))
45
46
# ----------------------------------------------------------------------------------------------------------------------
47