code cleanup

This commit is contained in:
Believethehype
2024-10-15 16:57:10 +02:00
parent 3742fe6a15
commit 3c4a900ff0
3 changed files with 18 additions and 16 deletions

View File

@@ -1,7 +1,8 @@
import json
import os
from datetime import timedelta
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, Kind, RelayOptions
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, Kind
from nostr_dvm.interfaces.dvmtaskinterface import DVMTaskInterface, process_venv
from nostr_dvm.utils.admin_utils import AdminConfig

View File

@@ -1,9 +1,8 @@
import json
import os
from datetime import timedelta
import requests
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, Event, Kind
from nostr_sdk import Timestamp, PublicKey, Tag, Kind
from nostr_dvm.interfaces.dvmtaskinterface import DVMTaskInterface, process_venv
from nostr_dvm.utils.admin_utils import AdminConfig
@@ -85,7 +84,6 @@ class AdvancedSearchWine(DVMTaskInterface):
return request_form
async def process(self, request_form):
from nostr_sdk import Filter
options = self.set_options(request_form)
userkeys = []
for user in options["users"]:

View File

@@ -1,9 +1,10 @@
import json
import os
from datetime import timedelta
from nostr_sdk import Client, Timestamp, PublicKey, Tag, Keys, Options, SecretKey, NostrSigner, NostrDatabase, \
ClientBuilder, Filter, NegentropyOptions, NegentropyDirection, init_logger, LogLevel, Event, EventId, Kind, \
RelayOptions, RelayLimits
from nostr_sdk import Timestamp, Tag, Keys, Options, SecretKey, NostrSigner, NostrDatabase, \
ClientBuilder, Filter, NegentropyOptions, NegentropyDirection, init_logger, LogLevel, Kind, \
RelayLimits
from nostr_dvm.interfaces.dvmtaskinterface import DVMTaskInterface, process_venv
from nostr_dvm.utils import definitions
@@ -14,7 +15,6 @@ from nostr_dvm.utils.nip88_utils import NIP88Config, check_and_set_d_tag_nip88,
from nostr_dvm.utils.nip89_utils import NIP89Config, check_and_set_d_tag, create_amount_tag
from nostr_dvm.utils.output_utils import post_process_list_to_events
"""
This File contains a Module to discover popular notes
Accepted Inputs: none
@@ -189,7 +189,8 @@ class DicoverContentLatestLongForm(DVMTaskInterface):
timestamp_since = Timestamp.now().as_secs() - self.db_since
since = Timestamp.from_secs(timestamp_since)
filter1 = Filter().kinds([definitions.EventDefinitions.KIND_LONGFORM]).since(since) # Notes, reactions, zaps
filter1 = Filter().kinds([definitions.EventDefinitions.KIND_LONGFORM]).since(
since) # Notes, reactions, zaps
# filter = Filter().author(keys.public_key())
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
@@ -202,10 +203,12 @@ class DicoverContentLatestLongForm(DVMTaskInterface):
await cli.shutdown()
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
print(
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(self.db_since) + " seconds..")
"[" + self.dvm_config.NIP89.NAME + "] Done Syncing Notes of the last " + str(
self.db_since) + " seconds..")
except Exception as e:
print(e)
# We build an example here that we can call by either calling this file directly from the main directory,
# or by adding it to our playground. You can call the example and adjust it to your needs or redefine it in the
# playground or elsewhere