a
This commit is contained in:
parent
5990717867
commit
4a294edd5a
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,6 +3,10 @@
|
||||
.vs/
|
||||
DR.code-workspace
|
||||
|
||||
# local libs
|
||||
pyglet/
|
||||
pyglet
|
||||
|
||||
# PYCharm file
|
||||
.idea/
|
||||
|
||||
|
@ -7,9 +7,27 @@ hi = """Difficult Rocket is writen by shenjackyuanjie
|
||||
mail: 3695888@qq.com or shyj3695888@163.com
|
||||
QQ: 3695888"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
## TODO 默认位置配置文件+可自定义工作路径
|
||||
|
||||
print("sys.path[0] = ", sys.path[0])
|
||||
print("sys.argv[0] = ", sys.argv[0])
|
||||
print("__file__ = ", __file__)
|
||||
print("os.path.abspath(__file__) = ", os.path.abspath(__file__))
|
||||
print("os.path.realpath(__file__) = ", os.path.realpath(__file__))
|
||||
print("os.path.dirname(os.path.realpath(__file__)) = ",
|
||||
os.path.dirname(os.path.realpath(__file__)))
|
||||
print("os.path.split(os.path.realpath(__file__)) = ",
|
||||
os.path.split(os.path.realpath(__file__)))
|
||||
print("os.path.split(os.path.realpath(__file__))[0] = ",
|
||||
os.path.split(os.path.realpath(__file__))[0])
|
||||
print("os.getcwd() = ", os.getcwd())
|
||||
|
||||
if __name__ == '__main__':
|
||||
from bin import main
|
||||
|
||||
print(hi)
|
||||
game = main.Game()
|
||||
game.start()
|
||||
game.start()
|
@ -139,7 +139,7 @@ def configs(name, option=None) -> dict:
|
||||
raise IndexError(log)
|
||||
return data
|
||||
|
||||
|
||||
"""
|
||||
name_handlers = {'time.time': str(time.time()),
|
||||
'dir': str(os.getcwd()),
|
||||
'py_v': str(sys.version.split(' ')[0])
|
||||
@ -158,3 +158,32 @@ def name_handler(name: str, configs=dict) -> str:
|
||||
names['date'] = str(time.strftime(names['date'], time.gmtime(time.time())))
|
||||
handler_name = name.format(**names)
|
||||
return handler_name
|
||||
"""
|
||||
|
||||
names = {'{time.time}': str(time.time()),
|
||||
'{dir}': str(os.getcwd()),
|
||||
'{py_v}': str(sys.version.split(' ')[0])}
|
||||
|
||||
|
||||
def default_name_handler(name: str) -> str:
|
||||
"""
|
||||
won't change the string
|
||||
just return one
|
||||
"""
|
||||
name = name
|
||||
name = name.replace('{time.time}', str(time.time()))
|
||||
name = name.replace('{dir}', str(os.getcwd()))
|
||||
name = name.replace('{py_v}', str(sys.version.split(' ')[0]))
|
||||
return name
|
||||
|
||||
|
||||
def name_handler(name: str, configs=None) -> str:
|
||||
if configs is None:
|
||||
return default_name_handler(name)
|
||||
name = default_name_handler(name)
|
||||
for need_replace in configs:
|
||||
replace = configs[need_replace]
|
||||
if need_replace == '{date}':
|
||||
replace = time.strftime(configs['{date}'], time.gmtime(time.time()))
|
||||
name = name.replace(need_replace, replace)
|
||||
return name
|
||||
|
@ -82,7 +82,7 @@ class Game:
|
||||
self.main_logger.debug('%s %s' % (self.lang['logger.logfile_fmt'], self.log_config['fmt']))
|
||||
self.main_logger.debug('%s %s' % (self.lang['logger.logfile_datefmt'], self.log_config['date_fmt']))
|
||||
|
||||
def python_version_check(self):
|
||||
def python_version_check(self): # best 3.8+ and write at 3.8.9
|
||||
self.main_logger.info('%s %s' % (self.lang['version.now_on'], self.on_python_v))
|
||||
if self.on_python_v_info[0] == 2:
|
||||
self.main_logger.critical('%s' % self.lang['version.need3+'])
|
||||
|
@ -5,8 +5,15 @@
|
||||
- [README](https://github.com/shenjackyuanjie/Difficult-Rocket)
|
||||
- [中文README](https://github.com/shenjackyuanjie/Difficult-Rocket/blob/main/docs/README-cn.md)
|
||||
|
||||
## 2021/04/17 V 0.4.1
|
||||
|
||||
## 2021/05/24 V 0.4.2
|
||||
|
||||
### DEBUG
|
||||
|
||||
- using python version 3.8.9 still report `best3.8+`(lang name)(actually is debugging)
|
||||
|
||||
## 2021/04/17 V 0.4.1
|
||||
|
||||
PS:
|
||||
|
||||
- `Va.b.c`
|
||||
|
Loading…
Reference in New Issue
Block a user