miui-auto-tasks/utils/system_info.py
Night-stars-1 f85232e5ee
chore: 添加签到重试,仅每日签到获取token (#229)
* fix: 修复无法构建docker镜像的问题

* Update Dockerfile

* 🔧 自动更新requirements

* chore: 添加自动每日运行时间提示

* chore: 将时间类型从str改成int

* Add files via upload

* chore: 更新日志收集方法

* chore: 遵守代码规范

* chore: update issue templates

* chore: 删除测试代码

* chore: 更改日志输出样式

* chore: docker生成配置时随机生成自动运行时间

* chore: trailing-whitespace

* chore: 日志添加换行

* chore: 未配置验证码解决方案时直接跳过

* chore: 使用遍历方法找到键值,提升泛用性

* chore: 使用cron执行自动任务

* chore: snake_case

* chore: 修改运行时间

* Update config.py

* chore: 添加签到重试,仅每日签到获取token

* 🔧 自动更新requirements

* chore: 更新版本号

* Update config.py

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-05 01:21:41 +11:00

39 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
Date: 2023-11-13 20:29:19
LastEditors: Night-stars-1 nujj1042633805@gmail.com
LastEditTime: 2023-11-19 14:39:20
"""
import platform
from urllib.request import getproxies
from utils.logger import log
def print_info():
"""打印系统信息"""
log.info("MIUI-AUTO-TASK v1.7.3")
log.info('---------- 系统信息 -------------')
system_info()
log.info('---------- 项目信息 -------------')
log.info("这是一个免费且开源的项目,如果你是付费购买获得请务必退款")
log.info("项目地址https://github.com/0-8-4/miui-auto-tasks")
log.info("欢迎 star感谢所有项目贡献者已经提交issues的人帮助项目发展的人")
log.info('---------- 脚本日志 -------------')
def system_info():
"""系统信息"""
log.info(show_info('操作系统平台', platform.platform()))
log.info(show_info('操作系统版本', platform.version()))
log.info(show_info('操作系统名称', platform.system()))
log.info(show_info('操作系统位元', platform.architecture()))
log.info(show_info('操作系统类型', platform.machine()))
log.info(show_info('处理器信息', platform.processor()))
log.info(show_info('Python 版本', str(platform.python_version()) + ' ' + str(platform.python_build())))
if getproxies():
log.info(show_info('系统代理', getproxies()))
def show_info(tip: str, info: str):
"""格式化输出"""
return f"{tip}: {info}"