一些小改动(换新电脑啦,好耶

This commit is contained in:
瑗杰 沈 2021-04-05 18:22:17 +08:00
parent f94345472b
commit 06bd88e9ac
4 changed files with 10 additions and 11 deletions

View File

@ -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:

View File

@ -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

View File

@ -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
}

View File

@ -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