хероку на винде?

ТРЕПЕЩИ ПЕРРИ ХУЕСОС Я ИЗОБРЕЛ ХЕРОКУ НА ВИНДЕ
pull/155/head
Who? 2025-06-14 03:50:40 +07:00 committed by GitHub
commit 8090770e42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 11 deletions

View File

@ -620,7 +620,7 @@ class Modules:
spec = importlib.machinery.ModuleSpec(
module_name,
StringLoader(Path(mod).read_text(), user_friendly_origin),
StringLoader(Path(mod).read_text(encoding='utf-8'), user_friendly_origin),
origin=user_friendly_origin,
)

View File

@ -98,11 +98,14 @@ IS_AEZA = "aeza" in socket.gethostname()
IS_USERLAND = "userland" in os.environ.get("USER", "")
IS_JAMHOST = "JAMHOST" in os.environ
IS_WSL = False
IS_WINDOWS = False
with contextlib.suppress(Exception):
from platform import uname
if "microsoft-standard" in uname().release:
IS_WSL = True
elif uname().system == "Windows":
IS_WINDOWS = True
# fmt: off
LATIN_MOCK = [
@ -827,10 +830,10 @@ class Heroku:
logo = (
" _ \n"
" /\ /\ ___ _ __ ___ | | __ _ _ \n"
" / /_/ // _ \| '__|/ _ \ | |/ /| | | |\n"
r" /\ /\ ___ _ __ ___ | | __ _ _ ""\n"
r" / /_/ // _ \| '__|/ _ \ | |/ /| | | |""\n"
"/ __ /| __/| | | (_) || < | |_| |\n"
"\/ /_/ \___||_| \___/ |_|\_\ \__,_|\n\n"
r"\/ /_/ \___||_| \___/ |_|\_\ \__,_|""\n\n"
f"• Build: {build[:7]}\n"
f"• Version: {'.'.join(list(map(str, list(__version__))))}\n"
f"{upd}\n"
@ -990,14 +993,24 @@ class Heroku:
def main(self):
"""Main entrypoint"""
self.loop.add_signal_handler(
signal.SIGINT,
lambda: asyncio.create_task(self._shutdown_handler())
)
if sys.platform != "win32":
try:
self.loop.add_signal_handler(
signal.SIGINT,
lambda: asyncio.create_task(self._shutdown_handler())
)
except NotImplementedError:
logging.warning("Signal handlers not supported on this platform.")
else:
logging.info("Running on Windows — skipping signal handler.")
try:
self.loop.run_until_complete(self._main())
except:
pass
except KeyboardInterrupt:
logging.info("KeyboardInterrupt received.")
self.loop.run_until_complete(self._shutdown_handler())
except Exception as e:
logging.exception("Unexpected exception in main loop: %s", e)
finally:
logging.info("Bye!")
self.loop.run_until_complete(self._shutdown_handler())

View File

@ -137,7 +137,8 @@ class HerokuInfoMod(loader.Module):
("🌼", "<emoji document_id=5224219153077914783>❤️</emoji>"),
("🎡", "<emoji document_id=5226711870492126219>🎡</emoji>"),
("🐧", "<emoji document_id=5361541227604878624>🐧</emoji>"),
("🧃", "<emoji document_id=5422884965593397853>🧃</emoji>")
("🧃", "<emoji document_id=5422884965593397853>🧃</emoji>"),
("💻", "<emoji document_id=5469825590884310445>💻</emoji>"),
]:
platform = platform.replace(emoji, icon)
return (

View File

@ -921,6 +921,9 @@ def get_named_platform() -> str:
if main.IS_WSL:
return "🍀 WSL"
if main.IS_WINDOWS:
return "💻 Windows"
if main.IS_JAMHOST:
return "🧃 JamHost"