This repository has been archived on 2024-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-03/src/bitmessagekivy/uikivysignaler.py

39 lines
1.1 KiB
Python
Raw Normal View History

2022-08-09 12:03:32 +02:00
"""
UI Singnaler for kivy interface
"""
2022-08-26 14:17:43 +02:00
import logging
2022-08-09 12:03:32 +02:00
from threading import Thread
from kivy.app import App
2022-08-26 14:17:43 +02:00
from pybitmessage import queues
from pybitmessage import state
2022-08-25 08:44:33 +02:00
from pybitmessage.bitmessagekivy.baseclass.common import kivy_state_variables
2022-08-09 12:03:32 +02:00
2022-08-26 14:17:43 +02:00
logger = logging.getLogger('default')
2022-08-09 12:03:32 +02:00
class UIkivySignaler(Thread):
"""Kivy ui signaler"""
def __init__(self, *args, **kwargs):
super(UIkivySignaler, self).__init__(*args, **kwargs)
self.kivy_state = kivy_state_variables()
def run(self):
self.kivy_state.kivyui_ready.wait()
while state.shutdown == 0:
try:
command, data = queues.UISignalQueue.get()
if command == 'writeNewAddressToTable':
address = data[1]
App.get_running_app().identity_list.append(address)
2022-08-09 12:03:32 +02:00
elif command == 'updateSentItemStatusByAckdata':
App.get_running_app().status_dispatching(data)
elif command == 'writeNewpaymentAddressToTable':
pass
except Exception as e:
logger.debug(e)