Skip to content

Commit

Permalink
chore: Better inline documentation on plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Oct 11, 2024
1 parent 8624fab commit 5450306
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/plugin/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Plugin:
def _front_end_loaded(self):
# The front end has successfully mounted in the steam app.
# You can now use Millennium.call_frontend_method()

logger.log("The front end has loaded!")

start_time = time.time()
Expand All @@ -39,14 +38,13 @@ def _front_end_loaded(self):
def _load(self):
# This code is executed when your plugin loads.
# notes: thread safe, running for entire lifespan of millennium
logger.log(f"bootstrapping example plugin, millennium {Millennium.version()}")

logger.log(f"bootstrapping plugin, millennium v{Millennium.version()}")
logger.log(f"Steam Path -> {Millennium.steam_path()}")

# print("pinging frontend")
try:
# This will fail to call the frontend as it is not yet loaded. It is only safe to call the frontend after _front_end_loaded is called.
value = Millennium.call_frontend_method("classname.method", params=[18, "USA", False])
logger.log(f"ponged message -> {value}")

except ConnectionError as error:
logger.error(f"Failed to ping frontend, {error}")

Expand Down

0 comments on commit 5450306

Please sign in to comment.