From af07ac37aa1082fc933538d4c6dbc8f372768ec5 Mon Sep 17 00:00:00 2001 From: mak448a Date: Tue, 19 Mar 2024 20:53:51 -0500 Subject: [PATCH] Fix for python3.11 and under --- .github/workflows/build-windows.yml | 11 +++++------ src/discord_integration.py | 12 ++++++------ src/ui/licenses_ui.py | 2 +- src/ui/login_ui.py | 18 +++++++++--------- src/ui/main_ui.py | 2 +- src/ui/no_internet.py | 2 +- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index c4cfc30..9eadb54 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -1,17 +1,16 @@ name: Build Windows run-name: Build Windows -on: - push: - tags: - - "**" -# on: [push] +# on: +# push: +# tags: +# - "**" +on: [push] jobs: Build-Windows: runs-on: windows-latest steps: - run: git clone https://github.com/mak448a/QTCord/ --depth=1 - run: cd QTCord && pip install -r requirements.txt && pip install pyinstaller && python3 package_windows.py - - run: ls - uses: actions/upload-artifact@v4 with: name: "QTCord-Windows" diff --git a/src/discord_integration.py b/src/discord_integration.py index cc235d6..16354b7 100644 --- a/src/discord_integration.py +++ b/src/discord_integration.py @@ -121,19 +121,19 @@ def get_guilds() -> dict: # Make sure to handle blank icons!!!! they are set to none # You get the rest of the info from this function. for server in r.json(): - if os.path.exists(f"{platformdirs.user_config_dir("QTCord")}/servers/{server["id"]}.png"): + if os.path.exists(f"{platformdirs.user_config_dir('QTCord')}/servers/{server['id']}.png"): continue - print(f"https://cdn.discordapp.com/icons/{server["id"]}/{server["icon"]}") - test = requests.get(f"https://cdn.discordapp.com/icons/{server["id"]}/{server["icon"]}") + print(f"https://cdn.discordapp.com/icons/{server['id']}/{server['icon']}") + test = requests.get(f"https://cdn.discordapp.com/icons/{server['id']}/{server['icon']}") # Handle no image servers if test.status_code == 404: continue - if not os.path.exists(f"{platformdirs.user_config_dir("QTCord")}/servers"): - os.makedirs(f"{platformdirs.user_config_dir("QTCord")}/servers") + if not os.path.exists(f"{platformdirs.user_config_dir('QTCord')}/servers"): + os.makedirs(f"{platformdirs.user_config_dir('QTCord')}/servers") - with open(f"{platformdirs.user_config_dir("QTCord")}/servers/{server["id"]}.png", "wb") as f: + with open(f"{platformdirs.user_config_dir('QTCord')}/servers/{server['id']}.png", "wb") as f: for chunk in test.iter_content(): f.write(chunk) diff --git a/src/ui/licenses_ui.py b/src/ui/licenses_ui.py index 70fdc47..2728294 100644 --- a/src/ui/licenses_ui.py +++ b/src/ui/licenses_ui.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'licenses.ui' ## -## Created by: Qt User Interface Compiler version 6.6.1 +## Created by: Qt User Interface Compiler version 6.6.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ diff --git a/src/ui/login_ui.py b/src/ui/login_ui.py index c18c1bd..4f1e096 100644 --- a/src/ui/login_ui.py +++ b/src/ui/login_ui.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'login.ui' ## -## Created by: Qt User Interface Compiler version 6.6.1 +## Created by: Qt User Interface Compiler version 6.6.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -28,7 +28,7 @@ def setupUi(self, MainWindow): self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout = QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName(u"verticalLayout") - self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) self.verticalLayout.addItem(self.verticalSpacer) @@ -47,7 +47,7 @@ def setupUi(self, MainWindow): self.verticalLayout_3.setContentsMargins(-1, 50, -1, -1) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") - self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer) @@ -63,7 +63,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_3.addWidget(self.email) - self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer_3) @@ -75,7 +75,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_6 = QHBoxLayout() self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") - self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_6.addItem(self.horizontalSpacer_2) @@ -92,7 +92,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_6.addWidget(self.password) - self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_6.addItem(self.horizontalSpacer_4) @@ -102,7 +102,7 @@ def setupUi(self, MainWindow): self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.horizontalLayout_4.setContentsMargins(-1, 10, -1, -1) - self.horizontalSpacer_5 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.horizontalSpacer_5 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_4.addItem(self.horizontalSpacer_5) @@ -111,14 +111,14 @@ def setupUi(self, MainWindow): self.horizontalLayout_4.addWidget(self.pushButton) - self.horizontalSpacer_6 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) + self.horizontalSpacer_6 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_4.addItem(self.horizontalSpacer_6) self.verticalLayout.addLayout(self.horizontalLayout_4) - self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) + self.verticalSpacer_4 = QSpacerItem(20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding) self.verticalLayout.addItem(self.verticalSpacer_4) diff --git a/src/ui/main_ui.py b/src/ui/main_ui.py index 358ff7d..12b0a42 100644 --- a/src/ui/main_ui.py +++ b/src/ui/main_ui.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'main.ui' ## -## Created by: Qt User Interface Compiler version 6.6.1 +## Created by: Qt User Interface Compiler version 6.6.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ diff --git a/src/ui/no_internet.py b/src/ui/no_internet.py index 2fe7760..c607e98 100644 --- a/src/ui/no_internet.py +++ b/src/ui/no_internet.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'no_internet.ui' ## -## Created by: Qt User Interface Compiler version 6.6.1 +## Created by: Qt User Interface Compiler version 6.6.2 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################