From 4217f58c2c28f84c251b7d0b8752cfb49121d7d2 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Fri, 25 Nov 2022 13:12:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0=E4=B8=BA=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=A8=8B=E5=BA=8F=E6=97=A0=E6=B3=95=E6=89=93?= =?UTF-8?q?=E5=BC=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - deb/DEBIAN/control | 2 +- mainwindow.py | 34 +++++++++++++++++++--------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4e9724c..9466e27 100755 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ env WINEPREFIX=容器路径 wine(wine的路径) 可执行文件路径 ``` 让你可以简易方便的使用 wine 是使用 Python3 的 PyQt5 构建的 -(自己美术功底太差,图标只能在网络上找了) (测试平台:deepin 20.7.1;UOS 家庭版 21.3.1;Ubuntu 22.04;Ubuntu 20.04;UOS 专业版 1050;openkylin) ![截图_选择区域_20221002221112.png](https://storage.deepin.org/thread/202210022215217037_截图_选择区域_20221002221112.png) 而打包器可以方便的把您的 wine 容器打包成 deb 包供他人使用,程序创建的 deb 构建临时文件夹目录树如下: diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control index f2b79f5..b662acf 100755 --- a/deb/DEBIAN/control +++ b/deb/DEBIAN/control @@ -1,5 +1,5 @@ Package: spark-deepin-wine-runner -Version: 2.5.0 +Version: 2.5.0-uos Maintainer: gfdgd xi <3025613752@qq.com>, 为什么您不喜欢熊出没和阿布呢 Homepage: https://gitee.com/gfdgd-xi/deep-wine-runner, https://github.com/gfdgd-xi/deep-wine-runner, https://gitlink.org.cn/gfdgd_xi/deep-wine-runner Architecture: all diff --git a/mainwindow.py b/mainwindow.py index 0f3da67..b52d570 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -1808,6 +1808,7 @@ def UploadLog(): traceback.print_exc() QtWidgets.QMessageBox.critical(window, "错误", "上传失败!") + def SaveLog(): path = QtWidgets.QFileDialog.getSaveFileName(window, "保存日志", get_home(), "txt文件(*.txt);;html 文件(*.html);;所有文件(*.*))") if not path[1]: @@ -1975,22 +1976,25 @@ except: def getFileFolderSize(fileOrFolderPath): """get size for file or folder""" totalSize = 0 - if not os.path.exists(fileOrFolderPath): - return totalSize - if os.path.isfile(fileOrFolderPath): - totalSize = os.path.getsize(fileOrFolderPath) # 5041481 - return totalSize - if os.path.isdir(fileOrFolderPath): - with os.scandir(fileOrFolderPath) as dirEntryList: - for curSubEntry in dirEntryList: - curSubEntryFullPath = os.path.join(fileOrFolderPath, curSubEntry.name) - if curSubEntry.is_dir(): - curSubFolderSize = getFileFolderSize(curSubEntryFullPath) # 5800007 - totalSize += curSubFolderSize - elif curSubEntry.is_file(): - curSubFileSize = os.path.getsize(curSubEntryFullPath) # 1891 - totalSize += curSubFileSize + try: + if not os.path.exists(fileOrFolderPath): return totalSize + if os.path.isfile(fileOrFolderPath): + totalSize = os.path.getsize(fileOrFolderPath) # 5041481 + return totalSize + if os.path.isdir(fileOrFolderPath): + with os.scandir(fileOrFolderPath) as dirEntryList: + for curSubEntry in dirEntryList: + curSubEntryFullPath = os.path.join(fileOrFolderPath, curSubEntry.name) + if curSubEntry.is_dir(): + curSubFolderSize = getFileFolderSize(curSubEntryFullPath) # 5800007 + totalSize += curSubFolderSize + elif curSubEntry.is_file(): + curSubFileSize = os.path.getsize(curSubEntryFullPath) # 1891 + totalSize += curSubFileSize + return totalSize + except: + return totalSize # 获取当前语言 def get_now_lang()->"获取当前语言":