Skip to content

Commit

Permalink
update configuration logging
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmiglio committed Mar 21, 2024
1 parent 8aef8dd commit d39e0cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/pyclashbot/memu/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""

import time
import logging

import numpy
import psutil
from pymemuc import ConfigKeys

Expand Down Expand Up @@ -51,16 +51,17 @@ def set_vm_language(vm_index: int):

def configure_vm(vm_index):
"""Configure the virtual machine with the given index."""
logging.info(f"Configuring VM {vm_index}...")

for key, value in MEMU_CONFIGURATION.items():
pmc.set_configuration_vm(key, str(value), vm_index=vm_index)

set_vm_language(vm_index=vm_index)
set_vm_language(vm_index=vm_index)
set_vm_language(vm_index=vm_index)
logging.info(f"Configured VM {vm_index}")


if __name__ == "__main__":
vm_index = 0
print(f"Configuring VM {vm_index}...")
configure_vm(vm_index)
print(f"Configured VM {vm_index}")
2 changes: 0 additions & 2 deletions src/pyclashbot/memu/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def restart_emulator(logger, start_time=time.time(), open_clash=True):
# check for the pyclashbot vm, if not found then create it
vm_index = check_for_vm(logger)

logger.change_status(status="Configuring the pyclashbot emulator...")
configure_vm(vm_index=vm_index)

# start the vm
Expand Down Expand Up @@ -177,7 +176,6 @@ def check_for_vm(logger: Logger) -> int:
new_vm_index = create_vm()
logger.change_status(f"New VM index is {new_vm_index}")

logger.change_status("Configuring emualtor")
configure_vm(vm_index=new_vm_index)

logger.change_status("Setting language")
Expand Down

0 comments on commit d39e0cc

Please sign in to comment.