core.paths
源文件
core/paths.py· 由scripts/gen_api_docs.py自动生成,请勿手改
模块说明:
集中式路径管理 —— 兼容开发环境和 PyInstaller 打包环境
开发环境: eve/ Main.py database/ reference.db ← 静态参考数据(item, industry_*, market_tree, item_dogma) blueprint.db ← 蓝图数据(blueprint_activities, _materials, _products, _skills) market.db ← 市场价格数据(market_prices, market_volume_snapshots) user.db ← 用户自有数据(hangars, inventory_items, production_plans, user_skills) data/caches/icons/ services/importers/getprices.py
PyInstaller 打包后: dist/EVE商人助手/ EVE商人助手.exe database/ reference.db market.db user.db data/caches/icons/ data/update_progress.json data/search_history.json data/window_geometry.json
函数
is_frozen
def is_frozen() -> bool判断是否运行在 PyInstaller 打包后的环境中
定义行:33
app_root
def app_root() -> str返回应用根目录(优先级:环境变量覆盖 > 打包环境 > 开发环境)
定义行:38
database_dir
def database_dir() -> str数据库目录
定义行:57
database_path
def database_path() -> str旧单库文件路径(迁移后保持兼容)
定义行:62
reference_db_path
def reference_db_path() -> str参考数据库路径(item, industry_*, market_tree, item_dogma)
定义行:67
market_db_path
def market_db_path() -> str市场价格数据库路径(market_prices, market_volume_snapshots)
定义行:72
user_db_path
def user_db_path() -> str用户数据数据库路径(hangars, inventory_items, production_plans, user_skills)
定义行:77
blueprint_db_path
def blueprint_db_path() -> str蓝图数据库路径(blueprint_activities, blueprint_materials, blueprint_products, blueprint_skills)
定义行:82
data_dir
def data_dir() -> str数据目录(图标缓存、搜索历史等)
定义行:87
icon_cache_dir
def icon_cache_dir() -> str图标缓存目录
定义行:92
progress_file
def progress_file() -> str更新进度文件路径
定义行:97
search_history_file
def search_history_file() -> str搜索历史文件路径
定义行:102
window_geometry_file
def window_geometry_file() -> str窗口位置文件路径
定义行:107
trade_cart_file
def trade_cart_file() -> str贸易购物车文件路径(跨区域价差排行加入的候选)
定义行:112
log_dir
def log_dir() -> Path日志目录(用户主目录 .eve-assistant 下,不随 exe 目录移动)
定义行:117
crashes_dir
def crashes_dir() -> Path崩溃转储目录(用户主目录 .eve-assistant 下,不随 exe 目录移动)
定义行:122
ensure_dirs_exist
def ensure_dirs_exist()确保所有必要目录存在(打包后首次运行时创建)
定义行:127