mirror of
https://github.com/aljazceru/nostrdvm.git
synced 2025-12-23 00:44:26 +01:00
move examples to framework
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user