Initial push

This commit is contained in:
2025-09-12 12:07:47 -05:00
parent 77a8ac4941
commit edbd080ad6
48 changed files with 1603 additions and 2 deletions

37
src/__builtins__.py Normal file
View File

@@ -0,0 +1,37 @@
# Python imports
import builtins
import threading
# Lib imports
# Application imports
from libs.event_system import EventSystem
# NOTE: Threads WILL NOT die with parent's destruction.
def threaded_wrapper(fn):
def wrapper(*args, **kwargs):
thread = threading.Thread(target = fn, args = args, kwargs = kwargs, daemon = False)
thread.start()
return thread
return wrapper
# NOTE: Threads WILL die with parent's destruction.
def daemon_threaded_wrapper(fn):
def wrapper(*args, **kwargs):
thread = threading.Thread(target = fn, args = args, kwargs = kwargs, daemon = True)
thread.start()
return thread
return wrapper
# NOTE: Just reminding myself we can add to builtins two different ways...
# __builtins__.update({"event_system": Builtins()})
builtins.APP_NAME = "PixelBash"
builtins.threaded = threaded_wrapper
builtins.daemon_threaded = daemon_threaded_wrapper
builtins.get_class = lambda x: globals()[x]
builtins.event_system = EventSystem()