Skip to content

Commit

Permalink
修复 Steam userdata 不存在时无法启动软件
Browse files Browse the repository at this point in the history
  • Loading branch information
XcantloadX committed Sep 11, 2024
1 parent 6ec4095 commit c951332
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/editor/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def system_steam_save_path(self) -> list[tuple[str, str]]:
logger.warning('Steam not found')
return []
saves_path = os.path.join(steam_path, 'userdata')
logger.debug(f'saves_path: {saves_path}')
if not os.path.exists(saves_path):
logger.warning('Steam saves does not exist')
return []
# 列出子文件夹(多账号)
accounts = os.listdir(saves_path)
save_files: list[tuple[str, str]] = []
Expand Down
3 changes: 3 additions & 0 deletions app/native_ui/implement.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import logging
import datetime
import traceback
import subprocess
Expand All @@ -8,6 +9,8 @@

import wx

logging.basicConfig(format='[%(asctime)s][%(levelname)s] %(message)s', level=logging.DEBUG)

import app.utils as utils
import app.editor.locator as locator
from .form import FrameMain, FrameSlotManager
Expand Down
4 changes: 2 additions & 2 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mkdir output
--name "PWAAT Save Editor" `
.\app\entry_native.py
# app\entry.py
sleep 1
sleep 3

$bat = @"
@echo off
Expand All @@ -32,7 +32,7 @@ cp $file_name output

# REPL
&pyinstaller --noconfirm .\packages.spec
sleep 1
sleep 3

$bat = @"
@echo off
Expand Down

0 comments on commit c951332

Please sign in to comment.