losen package dependencies for older versions

This commit is contained in:
Believethehype 2024-01-10 14:42:38 +01:00
parent 4552fa2bc8
commit 4ea185c5ec
3 changed files with 24 additions and 32 deletions

2
.gitignore vendored
View File

@ -176,4 +176,4 @@ backends/nserver/modules/image_upscale/weights
cache/ cache/
cookies_snapshot/satoshi2077@protonmail.com.json cookies_snapshot/satoshi2077@protonmail.com.json
Todo.md Todo.md
tests/gui/node_modules tests/gui/svelte/node_modules

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
VERSION = '0.1.7' VERSION = '0.1.8'
DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines' DESCRIPTION = 'A framework to build and run Nostr NIP90 Data Vending Machines'
LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. ' LONG_DESCRIPTION = ('A framework to build and run Nostr NIP90 Data Vending Machines. '
'This is an early stage release. Interfaces might change/brick') 'This is an early stage release. Interfaces might change/brick')
@ -15,13 +15,13 @@ setup(
long_description=LONG_DESCRIPTION, long_description=LONG_DESCRIPTION,
packages=find_packages(include=['nostr_dvm/**']), packages=find_packages(include=['nostr_dvm/**']),
install_requires=["nostr-sdk==0.7.1", install_requires=["nostr-sdk==0.7.1",
"bech32==1.2.0", "bech32",
"pycryptodome==3.19.0", "pycryptodome==3.19.0",
"python-dotenv==1.0.0", "python-dotenv==1.0.0",
"emoji==2.8.0", "emoji==2.8.0",
"eva-decord==0.6.1", "eva-decord==0.6.1",
"ffmpegio==0.8.5", "ffmpegio==0.8.5",
"lnurl==0.4.1", "lnurl",
"pandas==2.1.3", "pandas==2.1.3",
"Pillow==10.1.0", "Pillow==10.1.0",
"PyUpload==0.1.4", "PyUpload==0.1.4",

View File

@ -1,17 +1,13 @@
import asyncio
import json import json
import time import time
from datetime import timedelta from datetime import timedelta
from pathlib import Path
from nicegui import run, ui from nicegui import run, ui
import dotenv from nostr_sdk import Keys, Client, Tag, EventBuilder, Filter, \
from nostr_sdk import Keys, Client, Tag, EventBuilder, Filter, HandleNotification, nip04_decrypt, \ Options, Timestamp, ClientSigner, EventId, Nip19Event, PublicKey
nip04_encrypt, Options, Timestamp, ZapRequestData, ClientSigner, EventId, Nip19Event, PublicKey
from nostr_dvm.utils import dvmconfig from nostr_dvm.utils import dvmconfig
from nostr_dvm.utils.database_utils import fetch_user_metadata
from nostr_dvm.utils.dvmconfig import DVMConfig from nostr_dvm.utils.dvmconfig import DVMConfig
from nostr_dvm.utils.nostr_utils import send_event, check_and_set_private_key, get_event_by_id, get_events_by_id from nostr_dvm.utils.nostr_utils import send_event, check_and_set_private_key, get_events_by_id
from nostr_dvm.utils.definitions import EventDefinitions from nostr_dvm.utils.definitions import EventDefinitions
@ -74,19 +70,18 @@ def init():
if lastfeedback != fevents[0].content(): if lastfeedback != fevents[0].content():
for tag in fevents[0].tags(): for tag in fevents[0].tags():
if tag.as_vec()[0] == "status": if tag.as_vec()[0] == "status":
if tag.as_vec()[1] == "error": if tag.as_vec()[1] == "error":
with mainrow: with mainrow:
with maincolumn: with maincolumn:
ui.notify(fevents[0].content(), type="negative") ui.notify(fevents[0].content(), type="negative")
lastfeedback = fevents[0].content() lastfeedback = fevents[0].content()
break break
else: else:
with mainrow: with mainrow:
with maincolumn: with maincolumn:
ui.notify(fevents[0].content(), type="info") ui.notify(fevents[0].content(), type="info")
lastfeedback = fevents[0].content() lastfeedback = fevents[0].content()
break break
if len(events) == 0: if len(events) == 0:
response = False response = False
@ -135,8 +130,8 @@ def init():
for word in taggedusersfrom: for word in taggedusersfrom:
search = str(search).replace(word, "") search = str(search).replace(word, "")
user_pubkey = PublicKey.from_bech32(word.replace("@", "")).to_hex() user_pubkey = PublicKey.from_bech32(word.replace("@", "")).to_hex()
pTag = ["p", user_pubkey] pTag = Tag.parse(["p", user_pubkey])
tags.append(pTag) tags.append(pTag.as_vec())
search = str(search).replace("from:", "").replace("to:", "").replace("@", "").lstrip().rstrip() search = str(search).replace("from:", "").replace("to:", "").replace("@", "").lstrip().rstrip()
print(search) print(search)
ev = nostr_client_test_search(search, tags) ev = nostr_client_test_search(search, tags)
@ -161,21 +156,18 @@ def init():
with mainrow: with mainrow:
with maincolumn: with maincolumn:
ui.label('NostrAI Search Page').classes('text-2xl') ui.label('Noogle Search').classes('text-2xl')
prompt = ui.input('Search').style('width: 20em') prompt = ui.input('Search').style('width: 20em')
ui.button('Search', on_click=search).style('width: 15em') ui.button('Search', on_click=search).style('width: 15em')
# image = ui.image().style('width: 60em')
columns = [ columns = [
{'name': 'result', 'label': 'result', 'field': 'result', 'sortable': True, 'align': 'left', }, {'name': 'result', 'label': 'result', 'field': 'result', 'sortable': True, 'align': 'left', },
{'name': 'time', 'label': 'time', 'field': 'time', 'sortable': True, 'align': 'left'}, {'name': 'time', 'label': 'time', 'field': 'time', 'sortable': True, 'align': 'left'},
# {'name': 'eventid', 'label': 'eventid', 'field': 'eventid', 'sortable': True, 'align': 'left'},
] ]
# table = ui.table(columns, rows=data).classes('w-full bordered')
table = ui.table(columns=columns, rows=data, row_key='result', table = ui.table(columns=columns, rows=data, row_key='result',
pagination={'rowsPerPage': 10, 'sortBy': 'time', 'descending': True, 'page': 1}).style( pagination={'rowsPerPage': 10, 'sortBy': 'time', 'descending': True, 'page': 1}).style(
'width: 80em') 'width: 50em')
table.add_slot('header', r''' table.add_slot('header', r'''
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width /> <q-th auto-width />
@ -191,7 +183,7 @@ def init():
@click="props.expand = !props.expand" @click="props.expand = !props.expand"
:icon="props.expand ? 'remove' : 'add'" /> :icon="props.expand ? 'remove' : 'add'" />
</q-td> </q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props" width="200px"> <q-td v-for="col in props.cols" :key="col.name" :props="props" colspan="50%">
{{ col.value }} {{ col.value }}
</q-td> </q-td>
</q-tr> </q-tr>