From fddd054d569676825db0be6fad92574412aac943 Mon Sep 17 00:00:00 2001 From: cis Date: Tue, 20 Jul 2021 14:43:55 +0530 Subject: [PATCH] made the peter requested changes --- kivy-requirements.txt | 9 ++++----- src/bitmessagekivy/tests/telenium_process.py | 10 ++++------ src/main_test.py | 21 ++++++++++---------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/kivy-requirements.txt b/kivy-requirements.txt index 8a0bc7a4..8d506a5d 100644 --- a/kivy-requirements.txt +++ b/kivy-requirements.txt @@ -1,6 +1,5 @@ -Kivy==2.0.0 -kivy-garden.qrcode==2021.314 +kivy-garden.qrcode -e git+https://github.com/kivymd/KivyMD#egg=kivymd -opencv-python==4.5.1.48 -pyzbar==0.1.8 -telenium==0.5.0 \ No newline at end of file +opencv-python +pyzbar +telenium \ No newline at end of file diff --git a/src/bitmessagekivy/tests/telenium_process.py b/src/bitmessagekivy/tests/telenium_process.py index 9dcdacc7..5e6a8ae8 100644 --- a/src/bitmessagekivy/tests/telenium_process.py +++ b/src/bitmessagekivy/tests/telenium_process.py @@ -19,18 +19,16 @@ tmp_db_file = ( ) -def cleanup(home=None, files=_files): +def cleanup(files=_files): """Cleanup application files""" - if not home: - home = tempfile.gettempdir() for pfile in files: try: - os.remove(os.path.join(home, pfile)) + os.remove(os.path.join(tempfile.gettempdir(), pfile)) except OSError: pass -def set_temp_data(): +def populate_test_data(): """Set temp data in tmp directory""" for file_name in tmp_db_file: old_source_file = os.path.join( @@ -47,7 +45,7 @@ class TeleniumTestProcess(TeleniumTestCase): def setUpClass(cls): """Setupclass is for setting temp environment""" os.environ["BITMESSAGE_HOME"] = tempfile.gettempdir() - set_temp_data() + populate_test_data() super(TeleniumTestProcess, cls).setUpClass() @classmethod diff --git a/src/main_test.py b/src/main_test.py index f521a3e6..5f7ffbb5 100644 --- a/src/main_test.py +++ b/src/main_test.py @@ -6,18 +6,17 @@ from threads import sqlThread def main(): - if state.enableObjProc: - # Start the address generation thread - addressGeneratorThread = FakeAddressGenerator() - # close the main program even if there are threads left - addressGeneratorThread.daemon = True - addressGeneratorThread.start() + # Start the address generation thread + addressGeneratorThread = FakeAddressGenerator() + # close the main program even if there are threads left + addressGeneratorThread.daemon = True + addressGeneratorThread.start() - sqlLookup = sqlThread() - # DON'T close the main program even if there are threads left. - # The closeEvent should command this thread to exit gracefully. - sqlLookup.daemon = False - sqlLookup.start() + sqlLookup = sqlThread() + # DON'T close the main program even if there are threads left. + # The closeEvent should command this thread to exit gracefully. + sqlLookup.daemon = False + sqlLookup.start() state.kivyapp = NavigateApp() state.kivyapp.run()