pull/20/head
quadrismegistus 4 years ago
parent 82c51842de
commit eb448c5a28

@ -76,12 +76,13 @@ class PostCard(MDCard):
self.timestamp = data.get('timestamp',None)
self.bind(minimum_height=self.setter('height'))
minwidth = 400
maxwidth = 800
abouts = int(Window.size[0]/1.5)
if abouts < minwidth: self.width=f'{minwidth}sp'
if abouts > maxwidth: self.width=f'{maxwidth}sp'
self.width=f'{abouts}sp'
# minwidth = 400
# maxwidth = 800
# abouts = int(Window.size[0]/1.5)
# if abouts < minwidth: self.width=f'{minwidth}sp'
# if abouts > maxwidth: self.width=f'{maxwidth}sp'
# self.width=f'{abouts}sp'
# self.log('PostCard.img_id =',self.img_id)

@ -15,6 +15,7 @@ BSEP3=b'##########'
NODE_SLEEP_FOR=1
PATH_WORLD_KEY='.world.key'
try:
from .crypto import *
from .p2p import *
@ -91,7 +92,7 @@ class Api(object):
i = 0
self._node = await self.connect(port=port)
while True:
if not i%30: self.log(f'Node status (tick {i}): {self._node}')
if not i%90: self.log(f'Node status (tick {i}): {self._node}')
if i and not i%save_every: await self.flush()
i += 1
await asyncio.sleep(NODE_SLEEP_FOR)
@ -328,6 +329,7 @@ class Api(object):
### NEW FIRST LINE: Try to decrypt!
val=None
for keyname,privkey in self.keys.items():
self.log(keyname,privkey,'??')
try:
val = aes_rsa_decrypt(encrypted_payload,privkey,*decryption_tools)
#self.log('decrypted =',val)
@ -693,7 +695,7 @@ class Api(object):
self.log('saving back to db file...')
node = await self.node
node.storage.dump()
self.log('DONE saving back to db file...')
# self.log('DONE saving back to db file...')

@ -3,3 +3,4 @@ Kademlia is a Python implementation of the Kademlia protocol which
utilizes the asyncio library.
"""
__version__ = "2.2.1"

Loading…
Cancel
Save