Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | """ |
||
16 | class SpawnerCommand(Command): |
||
17 | """ |
||
18 | Starts the spawner. |
||
19 | """ |
||
20 | |||
21 | name = 'spawner' |
||
22 | |||
23 | options = [ |
||
24 | { |
||
25 | 'name': 'daemonize', |
||
26 | 'shortcut': 'd', |
||
27 | 'flag': True, |
||
28 | 'description': 'If set, use demonize' |
||
29 | } |
||
30 | ] |
||
31 | |||
32 | # ------------------------------------------------------------------------------------------------------------------ |
||
33 | def handle(self): |
||
34 | """ |
||
35 | Executes the logger command. |
||
36 | """ |
||
37 | self._io = EnarkshStyle(self.input, self.output) |
||
|
|||
38 | |||
39 | spawner = Spawner() |
||
40 | |||
41 | if self.option('daemonize'): |
||
42 | spawner._daemonize() |
||
43 | |||
44 | spawner.main() |
||
45 | |||
48 |
It is generally a good practice to initialize all attributes to default values in the
__init__
method: