2022-10-11 09:21:05 +02:00
|
|
|
# pylint: disable=unused-import, wrong-import-position, ungrouped-imports
|
|
|
|
# flake8: noqa:E401, E402
|
|
|
|
|
2021-06-11 19:14:57 +02:00
|
|
|
"""Mock kivy app with mock threads."""
|
|
|
|
|
2022-10-11 09:21:05 +02:00
|
|
|
import os
|
|
|
|
from kivy.config import Config
|
2024-03-20 02:57:38 +01:00
|
|
|
from pybitmessage.mockpb import multiqueue
|
2021-06-11 19:14:57 +02:00
|
|
|
from pybitmessage import state
|
2022-08-01 11:07:20 +02:00
|
|
|
|
2022-09-19 18:04:34 +02:00
|
|
|
if os.environ.get("INSTALL_TESTS", False):
|
|
|
|
Config.set("graphics", "height", 1280)
|
|
|
|
Config.set("graphics", "width", 720)
|
|
|
|
Config.set("graphics", "position", "custom")
|
|
|
|
Config.set("graphics", "top", 0)
|
|
|
|
Config.set("graphics", "left", 0)
|
2022-10-11 09:21:05 +02:00
|
|
|
|
|
|
|
|
2024-03-20 02:57:38 +01:00
|
|
|
from pybitmessage.mockpb.class_addressGenerator import FakeAddressGenerator # noqa:E402
|
2022-10-11 09:21:05 +02:00
|
|
|
from pybitmessage.bitmessagekivy.mpybit import NavigateApp # noqa:E402
|
2024-03-20 02:57:38 +01:00
|
|
|
from pybitmessage.mockpb import network # noqa:E402
|
2022-09-19 18:04:34 +02:00
|
|
|
|
|
|
|
stats = network.stats
|
|
|
|
objectracker = network.objectracker
|
2021-06-11 19:14:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
"""main method for starting threads"""
|
|
|
|
# Start the address generation thread
|
|
|
|
addressGeneratorThread = FakeAddressGenerator()
|
|
|
|
# close the main program even if there are threads left
|
|
|
|
addressGeneratorThread.daemon = True
|
|
|
|
addressGeneratorThread.start()
|
|
|
|
state.kivyapp = NavigateApp()
|
|
|
|
state.kivyapp.run()
|
2022-11-08 08:30:49 +01:00
|
|
|
addressGeneratorThread.stopThread()
|
2021-06-11 19:14:57 +02:00
|
|
|
|
|
|
|
|
2022-09-19 18:04:34 +02:00
|
|
|
if __name__ == "__main__":
|
2021-06-11 19:14:57 +02:00
|
|
|
main()
|