serverwatcher 6.dev11__py3-none-any.whl → 6.dev13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- serverwatcher/cli.py +16 -14
- {serverwatcher-6.dev11.dist-info → serverwatcher-6.dev13.dist-info}/METADATA +1 -1
- {serverwatcher-6.dev11.dist-info → serverwatcher-6.dev13.dist-info}/RECORD +6 -6
- {serverwatcher-6.dev11.dist-info → serverwatcher-6.dev13.dist-info}/WHEEL +0 -0
- {serverwatcher-6.dev11.dist-info → serverwatcher-6.dev13.dist-info}/licenses/LICENSE +0 -0
- {serverwatcher-6.dev11.dist-info → serverwatcher-6.dev13.dist-info}/top_level.txt +0 -0
serverwatcher/cli.py
CHANGED
|
@@ -65,13 +65,15 @@ class ChildSpec:
|
|
|
65
65
|
|
|
66
66
|
def param(self, name, type=str, default=None):
|
|
67
67
|
def deco(func):
|
|
68
|
-
|
|
68
|
+
pyname = name.replace('-', '_')
|
|
69
|
+
self.params[pyname] = ParamSpec(name, type, default)
|
|
69
70
|
return func
|
|
70
71
|
return deco
|
|
71
72
|
|
|
72
73
|
def flag(self, name):
|
|
73
74
|
def deco(func):
|
|
74
|
-
|
|
75
|
+
pyname = name.replace('-', '_')
|
|
76
|
+
self.flags[pyname] = FlagSpec(name)
|
|
75
77
|
return func
|
|
76
78
|
return deco
|
|
77
79
|
|
|
@@ -120,7 +122,7 @@ def dispatch(cli: CLIBase, line: str):
|
|
|
120
122
|
if cmd is None:
|
|
121
123
|
return cli.safePrint(f'Unknown command {parsed.subcommand}')
|
|
122
124
|
|
|
123
|
-
cmd.func(
|
|
125
|
+
cmd.func()
|
|
124
126
|
|
|
125
127
|
if not parsed.positional:
|
|
126
128
|
return cli.safePrint('Missing subcommand')
|
|
@@ -236,12 +238,12 @@ class WatcherCLI(cmd.Cmd, CLIBase):
|
|
|
236
238
|
|
|
237
239
|
# stats command
|
|
238
240
|
@command('stats')
|
|
239
|
-
def stats(
|
|
241
|
+
def stats():
|
|
240
242
|
pass
|
|
241
243
|
|
|
242
244
|
|
|
243
245
|
@stats.child('get')
|
|
244
|
-
def stats_get(self
|
|
246
|
+
def stats_get(self, stat: str, **kwargs):
|
|
245
247
|
rounding = kwargs['rounding']
|
|
246
248
|
mode = kwargs['mode']
|
|
247
249
|
raw = kwargs['raw']
|
|
@@ -317,12 +319,12 @@ def no_formatted():
|
|
|
317
319
|
|
|
318
320
|
# view command
|
|
319
321
|
@command('view')
|
|
320
|
-
def view(
|
|
322
|
+
def view():
|
|
321
323
|
pass
|
|
322
324
|
|
|
323
325
|
|
|
324
326
|
@view.child('cli')
|
|
325
|
-
def view_cli(self
|
|
327
|
+
def view_cli(self, _arg: str, **kwargs):
|
|
326
328
|
self.watcher.router.disableOriginOutput()
|
|
327
329
|
self.outputMode = 'cli'
|
|
328
330
|
self.buffer.enabled = True
|
|
@@ -333,7 +335,7 @@ def view_cli(self: WatcherCLI, _arg: str, **kwargs):
|
|
|
333
335
|
|
|
334
336
|
|
|
335
337
|
@view.child('watcher')
|
|
336
|
-
def view_watcher(self
|
|
338
|
+
def view_watcher(self, _arg: str, **kwargs):
|
|
337
339
|
self.watcher.router.enableOriginOutput()
|
|
338
340
|
self.outputMode = 'both'
|
|
339
341
|
utils.clearTerminal()
|
|
@@ -344,12 +346,12 @@ def view_watcher(self: WatcherCLI, _arg: str, **kwargs):
|
|
|
344
346
|
|
|
345
347
|
# clear command
|
|
346
348
|
@command('clear')
|
|
347
|
-
def clear(
|
|
349
|
+
def clear():
|
|
348
350
|
pass
|
|
349
351
|
|
|
350
352
|
|
|
351
353
|
@clear.child('buffer')
|
|
352
|
-
def clear_buffer(self
|
|
354
|
+
def clear_buffer(self, _arg: str, **kwargs):
|
|
353
355
|
buffer = kwargs['buffer']
|
|
354
356
|
|
|
355
357
|
if buffer():
|
|
@@ -366,17 +368,17 @@ def buffer(value: str):
|
|
|
366
368
|
|
|
367
369
|
# watcher command
|
|
368
370
|
@command('watcher')
|
|
369
|
-
def watcher(
|
|
371
|
+
def watcher():
|
|
370
372
|
pass
|
|
371
373
|
|
|
372
374
|
|
|
373
375
|
@watcher.child('restart')
|
|
374
|
-
def watcher_restart(self
|
|
376
|
+
def watcher_restart(self, _arg: str, **kwargs):
|
|
375
377
|
self.watcher.restart_and_wait()
|
|
376
378
|
|
|
377
379
|
|
|
378
380
|
@watcher.child('schedule')
|
|
379
|
-
def watcher_schedule(self
|
|
381
|
+
def watcher_schedule(self, _arg: str, **kwargs):
|
|
380
382
|
minutes = kwargs['minutes']
|
|
381
383
|
|
|
382
384
|
val = minutes()
|
|
@@ -386,7 +388,7 @@ def watcher_schedule(self: WatcherCLI, _arg: str, **kwargs):
|
|
|
386
388
|
|
|
387
389
|
|
|
388
390
|
@watcher.child('shutdown')
|
|
389
|
-
def watcher_shutdown(self
|
|
391
|
+
def watcher_shutdown(self, _arg: str, **kwargs):
|
|
390
392
|
self.watcher.shutdown()
|
|
391
393
|
return True
|
|
392
394
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
serverwatcher/__init__.py,sha256=Q_afN0XU29n48d6Gf0-LT2lLo3RiTWlHRT6rC_fYbjw,486
|
|
2
2
|
serverwatcher/__main__.py,sha256=XjGcQ_-8p4ttuVYlYEvYKUEvcAsvZUQaEA0mX0ajRbU,3097
|
|
3
|
-
serverwatcher/cli.py,sha256=
|
|
3
|
+
serverwatcher/cli.py,sha256=b77rWfjQuqHiRGaVQj-O5EygJGdufMasRBUUqKcasAM,9887
|
|
4
4
|
serverwatcher/validator.py,sha256=aD6GHOz1S5VFC93Mj89WO9vZG1bTjhg7QZbdlvQf4wo,1778
|
|
5
5
|
serverwatcher/watcher.py,sha256=ZiocJpeyhKTGOwYYak36MXNEFpLnpdl9v6BnMPGrBmM,13593
|
|
6
6
|
serverwatcher/configclasses/__init__.py,sha256=YS0KhxtAJGdMcaiFstqTRNxIPLnR7s9v3Tkt5h2uKE4,182
|
|
@@ -12,8 +12,8 @@ serverwatcher/defaultconfigs/messages.yaml,sha256=jSVEl-RYqPHhe5U5KLl8zfJtUBymvy
|
|
|
12
12
|
serverwatcher/defaultconfigs/watcher.yaml,sha256=GlAEKCuzFUSF6wWOqQLFL1CeuPltb1ltfYxFe_FUClw,723
|
|
13
13
|
serverwatcher/tests/test.py,sha256=DQtFzxT1ZFBhbq6i0vga_1p1OdfMI8lVSiXmvOWdE-s,1532
|
|
14
14
|
serverwatcher/tests/test2.py,sha256=pDFB3LTZZXdrkofCF9tDGlkUzNXq3AzK225Ww6H2EAw,1702
|
|
15
|
-
serverwatcher-6.
|
|
16
|
-
serverwatcher-6.
|
|
17
|
-
serverwatcher-6.
|
|
18
|
-
serverwatcher-6.
|
|
19
|
-
serverwatcher-6.
|
|
15
|
+
serverwatcher-6.dev13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
16
|
+
serverwatcher-6.dev13.dist-info/METADATA,sha256=4YIy_EysHuKNXEDbjioIlgBVuP3aT1OnVnKG5-niAmI,2647
|
|
17
|
+
serverwatcher-6.dev13.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
18
|
+
serverwatcher-6.dev13.dist-info/top_level.txt,sha256=8DJAf8WmmglgtZHkp8aoTriRJ2YPcS4F3DfOIkytASo,14
|
|
19
|
+
serverwatcher-6.dev13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|