| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 16 | class ControllerCommand(Command): |
||
| 17 | """ |
||
| 18 | Starts the controller. |
||
| 19 | """ |
||
| 20 | |||
| 21 | name = 'controller' |
||
| 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 controller command. |
||
| 36 | """ |
||
| 37 | self._io = EnarkshStyle(self.input, self.output) |
||
|
|
|||
| 38 | |||
| 39 | controller = Controller() |
||
| 40 | |||
| 41 | if self.option('daemonize'): |
||
| 42 | controller._daemonize() |
||
| 43 | |||
| 44 | controller.main() |
||
| 45 | |||
| 48 |
It is generally a good practice to initialize all attributes to default values in the
__init__method: