Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from cleo.helpers import argument 

2 

3from pystratum_cli.command.BaseCommand import BaseCommand 

4 

5 

6class StratumCommand(BaseCommand): 

7 """ 

8 The stratum command: combination of constants, loader, and wrapper commands. 

9 """ 

10 name = 'stratum' 

11 description = 'Generates constants based on database IDs.' 

12 arguments = [argument(name='config_file', description='The stratum configuration file.')] 

13 

14 # ------------------------------------------------------------------------------------------------------------------ 

15 def handle(self) -> int: 

16 """ 

17 Executes constants command when StratumCommand is activated. 

18 """ 

19 self._read_config_file() 

20 

21 factory = self._create_backend_factory() 

22 

23 worker = factory.create_constant_worker(self._config, self._io) 

24 if worker: 

25 ret = worker.execute() 

26 

27 if ret != 0: 27 ↛ 28line 27 didn't jump to line 28, because the condition on line 27 was never true

28 return ret 

29 

30 worker = factory.create_routine_loader_worker(self._config, self._io) 

31 if worker: 

32 ret = worker.execute() 

33 

34 if ret != 0: 34 ↛ 35line 34 didn't jump to line 35, because the condition on line 34 was never true

35 return ret 

36 

37 worker = factory.create_routine_wrapper_generator_worker(self._config, self._io) 

38 if worker: 

39 ret = worker.execute() 

40 

41 if ret != 0: 41 ↛ 42line 41 didn't jump to line 42, because the condition on line 41 was never true

42 return ret 

43 

44 self._io.write('') 

45 

46 return 0 

47 

48# ----------------------------------------------------------------------------------------------------------------------