Skip to content

Commit

Permalink
chore: helper functions for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
2mal3 committed Jul 17, 2024
1 parent 6afa0c3 commit f4f9b42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/somnus/logic/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,12 @@ async def _start_mc_server(config: Config):
ssh.sendcontrol("d")
ssh.prompt()
ssh.logout()


async def main():
async for _ in start_server():
pass


if __name__ == "__main__":
asyncio.run(main())
11 changes: 11 additions & 0 deletions src/somnus/logic/stop.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio

from pexpect import pxssh

from somnus.environment import Config, CONFIG
Expand Down Expand Up @@ -40,3 +42,12 @@ async def _stop_mc_server(ssh: pxssh.pxssh):
log.debug("Exiting screen session ...")
ssh.sendline("exit")
ssh.prompt()


async def main():
async for _ in stop_server():
pass


if __name__ == "__main__":
asyncio.run(main())

0 comments on commit f4f9b42

Please sign in to comment.