mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2026-08-22 13:13:23 +00:00
update from origin
This commit is contained in:
parent
8beb334d64
commit
bf2f252ee5
91 changed files with 1839 additions and 1281 deletions
4
dist/ba_data/python/efro/cloudshell.py
vendored
4
dist/ba_data/python/efro/cloudshell.py
vendored
|
|
@ -36,7 +36,9 @@ class HostConfig:
|
|||
mosh_shell: str = 'sh'
|
||||
workspaces_root: str = '/home/${USER}/cloudshell_workspaces'
|
||||
sync_perms: bool = True
|
||||
precommand: str | None = None
|
||||
precommand: str | None = None # KILL THIS
|
||||
precommand_noninteractive: str | None = None
|
||||
precommand_interactive: str | None = None
|
||||
managed: bool = False
|
||||
idle_minutes: int = 5
|
||||
can_sudo_reboot: bool = False
|
||||
|
|
|
|||
19
dist/ba_data/python/efro/error.py
vendored
19
dist/ba_data/python/efro/error.py
vendored
|
|
@ -7,7 +7,9 @@ from typing import TYPE_CHECKING
|
|||
import errno
|
||||
|
||||
if TYPE_CHECKING:
|
||||
pass
|
||||
from typing import Any
|
||||
|
||||
from efro.terminal import ClrBase
|
||||
|
||||
|
||||
class CleanError(Exception):
|
||||
|
|
@ -25,18 +27,29 @@ class CleanError(Exception):
|
|||
more descriptive exception types.
|
||||
"""
|
||||
|
||||
def pretty_print(self, flush: bool = True, prefix: str = 'Error') -> None:
|
||||
def pretty_print(
|
||||
self,
|
||||
flush: bool = True,
|
||||
prefix: str = 'Error',
|
||||
file: Any = None,
|
||||
clr: type[ClrBase] | None = None,
|
||||
) -> None:
|
||||
"""Print the error to stdout, using red colored output if available.
|
||||
|
||||
If the error has an empty message, prints nothing (not even a newline).
|
||||
"""
|
||||
from efro.terminal import Clr
|
||||
|
||||
if clr is None:
|
||||
clr = Clr
|
||||
|
||||
if prefix:
|
||||
prefix = f'{prefix}: '
|
||||
errstr = str(self)
|
||||
if errstr:
|
||||
print(f'{Clr.SRED}{prefix}{errstr}{Clr.RST}', flush=flush)
|
||||
print(
|
||||
f'{clr.SRED}{prefix}{errstr}{clr.RST}', flush=flush, file=file
|
||||
)
|
||||
|
||||
|
||||
class CommunicationError(Exception):
|
||||
|
|
|
|||
11
dist/ba_data/python/efro/util.py
vendored
11
dist/ba_data/python/efro/util.py
vendored
|
|
@ -39,6 +39,12 @@ class _EmptyObj:
|
|||
pass
|
||||
|
||||
|
||||
# A dead weak-ref should be immutable, right? So we can create exactly
|
||||
# one and return it for all cases that need an empty weak-ref.
|
||||
_g_empty_weak_ref = weakref.ref(_EmptyObj())
|
||||
assert _g_empty_weak_ref() is None
|
||||
|
||||
|
||||
# TODO: kill this and just use efro.call.tpartial
|
||||
if TYPE_CHECKING:
|
||||
Call = Call
|
||||
|
|
@ -148,8 +154,11 @@ def empty_weakref(objtype: type[T]) -> weakref.ref[T]:
|
|||
# At runtime, all weakrefs are the same; our type arg is just
|
||||
# for the static type checker.
|
||||
del objtype # Unused.
|
||||
|
||||
# Just create an object and let it die. Is there a cleaner way to do this?
|
||||
return weakref.ref(_EmptyObj()) # type: ignore
|
||||
# return weakref.ref(_EmptyObj()) # type: ignore
|
||||
|
||||
return _g_empty_weak_ref # type: ignore
|
||||
|
||||
|
||||
def data_size_str(bytecount: int) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue