mcserver-cli 4.5.0__py3-none-any.whl → 4.5.2__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.
mcserver/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "4.5.0"
1
+ __version__ = "4.5.2"
mcserver/app.py CHANGED
@@ -1,3 +1,16 @@
1
+ import logging
2
+
3
+ from .shared import ansi
4
+
5
+
6
+ # Log handler
7
+ class ClearLineHandler(logging.StreamHandler):
8
+ def emit(self, record):
9
+ self.stream.write(ansi("clear_line") + ansi("start_line"))
10
+ self.stream.flush()
11
+ super().emit(record)
12
+
13
+
1
14
  def main():
2
15
  import sys
3
16
 
@@ -12,17 +25,16 @@ def main():
12
25
 
13
26
  nothing_to_see_here_move_along()
14
27
 
15
- import logging as log
16
28
  import os
17
29
 
18
30
  from . import cli
19
31
 
20
32
  debug_mode = os.getenv("MCSERVER_DEBUG") == "1"
21
33
  if debug_mode:
22
- log.basicConfig(
23
- level=log.DEBUG, format="[%(levelname)s] [%(module)s]: %(message)s"
34
+ logging.basicConfig(
35
+ level=logging.DEBUG, format="[%(levelname)s] [%(module)s]: %(message)s"
24
36
  )
25
37
  else:
26
- log.basicConfig(level=log.INFO, format="[%(levelname)s]: %(message)s")
38
+ logging.basicConfig(level=logging.INFO, format="[%(levelname)s]: %(message)s")
27
39
 
28
40
  sys.exit(cli.main())
mcserver/cli.py CHANGED
@@ -139,6 +139,16 @@ def main() -> int:
139
139
 
140
140
  commands = parser.add_subparsers(title="Commands")
141
141
 
142
+ # 'add' command
143
+ # add_command = commands.add_parser(
144
+ # "add",
145
+ # help="Add mods or plugins",
146
+ # description="Add Modrinth mods or plugins (projects).",
147
+ # )
148
+
149
+ # add_command.set_defaults(command_name="add")
150
+ # add_command.add_argument("projects", nargs="+", type=str, help="Project names")
151
+
142
152
  # 'init' command
143
153
  init_command = commands.add_parser(
144
154
  "init",
@@ -219,8 +229,8 @@ def main() -> int:
219
229
  # 'op grant'
220
230
  op_grant_command = op_subcommands.add_parser(
221
231
  "grant",
222
- help="Grant player operator permission",
223
- description="Add players to the whitelist.",
232
+ help="Grant players operator permission.",
233
+ description="Grant players operator permission.",
224
234
  )
225
235
 
226
236
  op_grant_command.set_defaults(command_name="op_grant")
@@ -237,7 +247,7 @@ def main() -> int:
237
247
  op_grant_command.add_argument(
238
248
  "--online-mode",
239
249
  type=str,
240
- choices=["true","false"],
250
+ choices=["true", "false"],
241
251
  metavar="Boolean",
242
252
  help="The server's online mode (true/false)",
243
253
  )
@@ -247,7 +257,7 @@ def main() -> int:
247
257
  type=int,
248
258
  choices=[1, 2, 3, 4],
249
259
  metavar="Level",
250
- help="The perator permission level",
260
+ help="The operator permission level",
251
261
  )
252
262
 
253
263
  # 'op list'
@@ -382,7 +392,7 @@ def main() -> int:
382
392
  whitelist_add_command.add_argument(
383
393
  "--online-mode",
384
394
  type=str,
385
- choices=["true","false"],
395
+ choices=["true", "false"],
386
396
  metavar="Boolean",
387
397
  help="The server's online mode (true/false)",
388
398
  )