diff --git a/bin/client.py b/bin/client.py index d3f1d7d..5e8795c 100644 --- a/bin/client.py +++ b/bin/client.py @@ -245,7 +245,7 @@ class window(pyglet.window.Window): """ def on_mouse_motion(self, x, y, dx, dy): - pass + self.logger.debug('按键移动 %s %s %s %s' % (x, y, dx, dy)) def on_mouse_press(self, x, y, button, modifiers): if button == mouse.LEFT: diff --git a/bin/configs.py b/bin/configs.py index 40d7542..c6b1fba 100644 --- a/bin/configs.py +++ b/bin/configs.py @@ -138,17 +138,16 @@ def configs(name, option=None) -> dict: return data -name_handlers = {'{time.time}': str(time.time()), - '{dir}': str(os.getcwd()), - '{py_v}': str(sys.version.split(' ')[0]) +name_handlers = {'time.time': str(time.time()), + 'dir': str(os.getcwd()), + 'py_v': str(sys.version.split(' ')[0]) } -def name_handler(name: str, configs=None) -> str: - names = configs - names = names.update(name_handlers) - print(names) - handler_name = name.format(names) +def name_handler(name: str, configs={}) -> str: + names = name_handlers + names.update(configs) + handler_name = name.format(**names) if configs is None: return handler_name return name diff --git a/configs/logging.json5 b/configs/logging.json5 index a9e6cf2..107fb5b 100644 --- a/configs/logging.json5 +++ b/configs/logging.json5 @@ -26,7 +26,7 @@ 'main': '{date} DR.log', // {date} -> date 'formats': { - '{date}': '%Y-%m-%d %H-%M-%S' + 'date': '%Y-%m-%d %H-%M-%S' // format at https://docs.python.org/zh-cn/3.8/library/time.html#time.strftime // can and more {xx} by adding more obj EZ } diff --git a/configs/sys_value/window.json5 b/configs/sys_value/window.json5 index ce6c1d4..6b19a61 100644 --- a/configs/sys_value/window.json5 +++ b/configs/sys_value/window.json5 @@ -6,7 +6,7 @@ 'caption': 'Simple Rocket {version}', // {version} -> version of SR 'caption_option': { - '{version}': '0.2.1' + 'version': '0.2.1' }, 'resizable': 'true', // bool