一些小改动(换新电脑啦,好耶
This commit is contained in:
parent
f94345472b
commit
06bd88e9ac
@ -245,7 +245,7 @@ class window(pyglet.window.Window):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def on_mouse_motion(self, x, y, dx, dy):
|
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):
|
def on_mouse_press(self, x, y, button, modifiers):
|
||||||
if button == mouse.LEFT:
|
if button == mouse.LEFT:
|
||||||
|
@ -138,17 +138,16 @@ def configs(name, option=None) -> dict:
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
name_handlers = {'{time.time}': str(time.time()),
|
name_handlers = {'time.time': str(time.time()),
|
||||||
'{dir}': str(os.getcwd()),
|
'dir': str(os.getcwd()),
|
||||||
'{py_v}': str(sys.version.split(' ')[0])
|
'py_v': str(sys.version.split(' ')[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def name_handler(name: str, configs=None) -> str:
|
def name_handler(name: str, configs={}) -> str:
|
||||||
names = configs
|
names = name_handlers
|
||||||
names = names.update(name_handlers)
|
names.update(configs)
|
||||||
print(names)
|
handler_name = name.format(**names)
|
||||||
handler_name = name.format(names)
|
|
||||||
if configs is None:
|
if configs is None:
|
||||||
return handler_name
|
return handler_name
|
||||||
return name
|
return name
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
'main': '{date} DR.log',
|
'main': '{date} DR.log',
|
||||||
// {date} -> date
|
// {date} -> date
|
||||||
'formats': {
|
'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
|
// format at https://docs.python.org/zh-cn/3.8/library/time.html#time.strftime
|
||||||
// can and more {xx} by adding more obj EZ
|
// can and more {xx} by adding more obj EZ
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
'caption': 'Simple Rocket {version}',
|
'caption': 'Simple Rocket {version}',
|
||||||
// {version} -> version of SR
|
// {version} -> version of SR
|
||||||
'caption_option': {
|
'caption_option': {
|
||||||
'{version}': '0.2.1'
|
'version': '0.2.1'
|
||||||
},
|
},
|
||||||
'resizable': 'true',
|
'resizable': 'true',
|
||||||
// bool
|
// bool
|
||||||
|
Loading…
Reference in New Issue
Block a user