Coverage for gws-app/gws/server/cli.py: 0%

25 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-04-17 01:37 +0200

1"""Command-line server commands.""" 

2 

3from typing import Optional 

4 

5import gws 

6 

7from . import control 

8 

9 

10class Params(gws.CliParams): 

11 config: Optional[str] 

12 """configuration file""" 

13 manifest: Optional[str] 

14 """manifest file""" 

15 

16 

17gws.ext.new.cli('server') 

18 

19 

20class Object(gws.Node): 

21 

22 @gws.ext.command.cli('serverStart') 

23 def do_start(self, p: Params): 

24 """Configure and start the server.""" 

25 

26 control.start(p.manifest, p.config) 

27 

28 @gws.ext.command.cli('serverReload') 

29 def do_reload(self, p: Params): 

30 """Restart the server.""" 

31 

32 control.reload_all() 

33 

34 @gws.ext.command.cli('serverReconfigure') 

35 def do_reconfigure(self, p: Params): 

36 """Reconfigure and restart the server.""" 

37 

38 control.reconfigure(p.manifest, p.config) 

39 

40 @gws.ext.command.cli('serverConfigure') 

41 def do_configure(self, p: Params): 

42 """Configure the server, but do not restart.""" 

43 

44 control.configure_and_store(p.manifest, p.config) 

45 

46 @gws.ext.command.cli('serverConfigtest') 

47 def do_configtest(self, p: Params): 

48 """Test the configuration.""" 

49 

50 control.configure(p.manifest, p.config)