python 3.11 & code quality improvements

This commit is contained in:
Ace
2023-11-07 22:49:48 +01:00
parent 4f2dacc35a
commit 93c968da53
24 changed files with 243 additions and 151 deletions

View File

@@ -1 +1 @@
from config import Config
from .config import Config

View File

@@ -57,8 +57,6 @@ class module_test(unittest.TestCase):
print('OK')
if Config.USE_PREVIEW:
preview(merge(im_black, im_colour))
im = merge(im_black, im_colour)
im.show()
if __name__ == '__main__':

View File

@@ -112,8 +112,6 @@ class TestTextToDisplay(unittest.TestCase):
print('OK')
if Config.USE_PREVIEW:
preview(merge(im_black, im_colour))
im = merge(im_black, im_colour)
im.show()
if delete_file_after_parse:
print("cleaning up temp file")

View File

@@ -46,7 +46,6 @@ class module_test(unittest.TestCase):
print('OK')
if Config.USE_PREVIEW:
preview(merge(im_black, im_colour))
merge(im_black, im_colour).show()
else:
print('No api key given, omitting test')

View File

@@ -13,7 +13,7 @@ preview = Inkyimage.preview
merge = Inkyimage.merge
owm_api_key = Config.OPENWEATHERMAP_API_KEY
location = 'Stuttgart, DE'
location = '2825297'
tests = [
{
@@ -184,7 +184,8 @@ class module_test(unittest.TestCase):
im_black, im_colour = module.generate_image()
print('OK')
if Config.USE_PREVIEW:
preview(merge(im_black, im_colour))
merged = merge(im_black, im_colour)
preview(merged)