blob: a502a37d39a9662f6f429880f7cf02ce7e376868 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
"""PyInstaller entry point for the bundled Windows node daemon.
`meshbay_node.daemon:main` is a module function; PyInstaller freezes a script.
This is that script. The frozen binary is `meshbay-node.exe`,
relocatable, and is what the desktop client spawns and what the W3 autostart
launcher points at (`meshbay_node.platform._node_exe`). `meshbay-nodew.exe` is
the same script built without a console (meshbay-node.spec).
"""
import os
import sys
# meshbay-nodew.exe, the build without a console, starts with no stdio at all
# (sys.stdout and sys.stderr are None), and a library that writes to either or
# asks whether it is a terminal would raise. The daemon logs to node.log.
for _name in ("stdout", "stderr"):
if getattr(sys, _name) is None:
setattr(sys, _name, open(os.devnull, "w", encoding="utf-8"))
from meshbay_node.daemon import main # noqa: E402
if __name__ == "__main__":
main()
|