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

38 lines
1.1 KiB
Python
Raw Normal View History

2022-10-11 09:21:05 +02:00
# pylint: disable=unused-import, wrong-import-position, ungrouped-imports
# flake8: noqa:E401, E402
"""Mock kivy app with mock threads."""
2022-10-11 09:21:05 +02:00
import os
from kivy.config import Config
import multiqueue
from pybitmessage import state
2022-10-11 09:21:05 +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)
from pybitmessage.mock.class_addressGenerator import FakeAddressGenerator # noqa:E402
from pybitmessage.bitmessagekivy.mpybit import NavigateApp # noqa:E402
from pybitmessage.mock.network import stats, objectracker # noqa:E402
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()
if __name__ == '__main__':
main()