From 95159da0fcfff57a2ea84acfafce0e0c0d919f62 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 17 Jul 2022 15:52:17 +0200 Subject: [PATCH] Fixed pynput imports --- src/cpl_core/console/console.py | 6 +++--- src/cpl_core/cpl-core.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpl_core/console/console.py b/src/cpl_core/console/console.py index 43f9e044..3475b64d 100644 --- a/src/cpl_core/console/console.py +++ b/src/cpl_core/console/console.py @@ -6,8 +6,6 @@ from typing import Union, Optional from art import text2art import colorama -from pynput import keyboard -from pynput.keyboard import Key from tabulate import tabulate from termcolor import colored @@ -173,7 +171,7 @@ class Console: Console.write_line() @classmethod - def _select_menu_key_press(cls, key: Key): + def _select_menu_key_press(cls, key): r"""Event function when key press is detected Parameter @@ -181,6 +179,7 @@ class Console: key: :class:`pynput.keyboard.Key` Pressed key """ + from pynput.keyboard import Key if key == Key.down: if cls._selected_menu_item_index == len(cls._select_menu_items) - 1: return @@ -400,6 +399,7 @@ class Console: Console.write_line(message, '\n') cls._show_select_menu() + from pynput import keyboard with keyboard.Listener( on_press=cls._select_menu_key_press, suppress=False ) as listener: diff --git a/src/cpl_core/cpl-core.json b/src/cpl_core/cpl-core.json index 0479ec0a..20fd842e 100644 --- a/src/cpl_core/cpl-core.json +++ b/src/cpl_core/cpl-core.json @@ -4,7 +4,7 @@ "Version": { "Major": "2022", "Minor": "7", - "Micro": "0.post2" + "Micro": "0.post3" }, "Author": "Sven Heidemann", "AuthorEmail": "sven.heidemann@sh-edraft.de",