mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-09-27 20:46:15 +02:00
Update dvmtaskinterface.py
This commit is contained in:
@@ -2,23 +2,22 @@ import asyncio
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
|
||||||
from subprocess import run
|
|
||||||
import sys
|
import sys
|
||||||
|
from subprocess import run
|
||||||
from sys import platform
|
from sys import platform
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
from venv import create
|
from venv import create
|
||||||
|
|
||||||
from nostr_sdk import Keys, Kind, LogLevel
|
from nostr_sdk import Keys, Kind, LogLevel
|
||||||
|
|
||||||
from nostr_dvm.dvm import DVM
|
from nostr_dvm.dvm import DVM
|
||||||
from nostr_dvm.utils.admin_utils import AdminConfig
|
from nostr_dvm.utils.admin_utils import AdminConfig
|
||||||
from nostr_dvm.utils.backend_utils import keep_alive
|
|
||||||
from nostr_dvm.utils.dvmconfig import DVMConfig, build_default_config
|
from nostr_dvm.utils.dvmconfig import DVMConfig, build_default_config
|
||||||
from nostr_dvm.utils.nip88_utils import NIP88Config
|
from nostr_dvm.utils.nip88_utils import NIP88Config
|
||||||
from nostr_dvm.utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
from nostr_dvm.utils.nip89_utils import NIP89Config
|
||||||
from nostr_dvm.utils.output_utils import post_process_result
|
from nostr_dvm.utils.output_utils import post_process_result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DVMTaskInterface:
|
class DVMTaskInterface:
|
||||||
NAME: str
|
NAME: str
|
||||||
KIND: Kind
|
KIND: Kind
|
||||||
@@ -109,8 +108,6 @@ class DVMTaskInterface:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self, join=False):
|
def run(self, join=False):
|
||||||
#dvm = DVM(self.dvm_config, self.admin_config)
|
|
||||||
#asyncio.run(dvm.run_dvm(self.dvm_config, self.admin_config))
|
|
||||||
nostr_dvm_thread = Thread(target=self.DVM, args=[self.dvm_config, self.admin_config], daemon=False)
|
nostr_dvm_thread = Thread(target=self.DVM, args=[self.dvm_config, self.admin_config], daemon=False)
|
||||||
nostr_dvm_thread.start()
|
nostr_dvm_thread.start()
|
||||||
if join:
|
if join:
|
||||||
@@ -181,4 +178,3 @@ def process_venv(identifier):
|
|||||||
DVMTaskInterface.write_output(result, args.output)
|
DVMTaskInterface.write_output(result, args.output)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
DVMTaskInterface.write_output("Error: " + str(e), args.output)
|
DVMTaskInterface.write_output("Error: " + str(e), args.output)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user