move examples to framework

This commit is contained in:
dbth
2025-01-02 09:14:21 +01:00
parent cee488bb70
commit 6ceeec556d
17 changed files with 112 additions and 118 deletions

View File

@@ -1,6 +1,7 @@
import os
import signal
import time
from nostr_dvm.utils.print_utils import bcolors
class DVMFramework:
@@ -22,8 +23,13 @@ class DVMFramework:
time.sleep(0.1)
except KeyboardInterrupt:
for dvm in self.dvms:
if dvm.dvm_config.NIP89 is not None:
print(bcolors.CYAN + "Shuting down " + dvm.dvm_config.NIP89.NAME + bcolors.ENDC)
dvm.join()
print("All DVMs shut down.")
print(bcolors.GREEN +"All DVMs shut down." + bcolors.ENDC)
os.kill(os.getpid(), signal.SIGKILL)
exit(1)
def get_dvms(self):
return self.dvms