Skip to content

Commit

Permalink
Fix for python3.11 and under
Browse files Browse the repository at this point in the history
  • Loading branch information
mak448a committed Mar 20, 2024
1 parent d5c2ba1 commit af07ac3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 6 additions & 6 deletions src/discord_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/ui/licenses_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
################################################################################
Expand Down
18 changes: 9 additions & 9 deletions src/ui/login_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
################################################################################
Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/ui/main_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/ui/no_internet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
################################################################################
Expand Down

0 comments on commit af07ac3

Please sign in to comment.