utils.py 487 B

1234567891011121314151617
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. import os
  5. from datetime import datetime, timedelta, timezone
  6. DEFAULT_TIME = datetime(2023, 1, 1, 0, 0)
  7. def filepath_config(filename, mod_name='script') -> str:
  8. """
  9. 返回配置文件的路径
  10. """
  11. if mod_name == 'script':
  12. return os.path.join('./config', f'{filename}.json')
  13. else:
  14. return os.path.join('./config', f'{filename}.{mod_name}.json')