Skip to content

Commit

Permalink
[feat] upgrade to pyside6
Browse files Browse the repository at this point in the history
  • Loading branch information
bgallois committed Feb 15, 2024
1 parent 5998298 commit 1f4f920
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 40 deletions.
2 changes: 1 addition & 1 deletion autoformating.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
autopep8 --in-place --aggressive src/*.py
autopep8 --in-place --aggressive fastanalyzer/*.py
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pyside2-rcc fastanalyzer/resources.qrc -o fastanalyzer/rc_ressources.py
pyside2-uic fastanalyzer/fastanalyzer.ui -o fastanalyzer/ui_fastanalyzer.py
pyside2-uic fastanalyzer/plot.ui -o fastanalyzer/ui_plot.py
pyside2-uic fastanalyzer/plot_settings.ui -o fastanalyzer/ui_plot_settings.py
pyside2-uic fastanalyzer/data_calc.ui -o fastanalyzer/ui_data_calc.py
pyside6-rcc fastanalyzer/resources.qrc -o fastanalyzer/rc_ressources.py
pyside6-uic fastanalyzer/fastanalyzer.ui -o fastanalyzer/ui_fastanalyzer.py
pyside6-uic fastanalyzer/plot.ui -o fastanalyzer/ui_plot.py
pyside6-uic fastanalyzer/plot_settings.ui -o fastanalyzer/ui_plot_settings.py
pyside6-uic fastanalyzer/data_calc.ui -o fastanalyzer/ui_data_calc.py
2 changes: 0 additions & 2 deletions fastanalyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@

if __name__ == '__main__':
main()


8 changes: 4 additions & 4 deletions fastanalyzer/data_calc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PySide2.QtWidgets import QApplication, QMainWindow, QAction, QActionGroup, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow, QTableWidget, QTableWidgetItem, QWidget
from PySide2.QtCore import Signal, QFile, QCoreApplication, QStandardPaths, Qt, QTimer, QSignalBlocker
from PySide2.QtGui import QColor, QIcon, QPen, QPainter, QPalette, QPixmap, QFont, QFontDatabase
import PySide2.QtXml
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow, QTableWidget, QTableWidgetItem, QWidget
from PySide6.QtCore import Signal, QFile, QCoreApplication, QStandardPaths, Qt, QTimer, QSignalBlocker
from PySide6.QtGui import QColor, QIcon, QPen, QPainter, QAction, QActionGroup, QPalette, QPixmap, QFont, QFontDatabase
import PySide6.QtXml
from ui_data_calc import Ui_DataCalc
import numpy as np

Expand Down
42 changes: 23 additions & 19 deletions fastanalyzer/fastanalyzer.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
#!/usr/bin/env python
from ui_fastanalyzer import Ui_FastAnalyzer
import PySide6.QtXml
from PySide6.QtGui import QColor, QIcon, QPen, QPainter, QAction, QActionGroup, QPalette, QPixmap, QFont, QFontDatabase
from PySide6.QtCore import Signal, Slot, QFile, QStandardPaths, Qt, QTimer, QCoreApplication, QSettings
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow, QTableWidget, QTableWidgetItem
import fastanalysis as fa
from data_calc import DataCalc
from plot import Plot
import pickle
import rc_ressources
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import rc_ressources
import sys
import pickle

from plot import Plot
from data_calc import DataCalc
import fastanalysis as fa

from PySide2.QtWidgets import QApplication, QMainWindow, QAction, QActionGroup, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow, QTableWidget, QTableWidgetItem
from PySide2.QtCore import Signal, Slot, QFile, QStandardPaths, Qt, QTimer, QCoreApplication, QSettings
from PySide2.QtGui import QColor, QIcon, QPen, QPainter, QPalette, QPixmap, QFont, QFontDatabase
import PySide2.QtXml
from ui_fastanalyzer import Ui_FastAnalyzer


dirname = os.path.dirname(PySide2.__file__)
dirname = os.path.dirname(PySide6.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path

Expand All @@ -40,7 +37,7 @@ def __init__(self):
self.license = int(self.settings.value("main/license", "0o0"), 8)
timer = QTimer(self)
timer.timeout.connect(self.checkLicense)
timer.setInterval(1000*60)
timer.setInterval(1000 * 60)
timer.start()
self.restoreGeometry(self.settings.value("main/geometry"))
self.restoreState(self.settings.value("main/windowState"))
Expand Down Expand Up @@ -79,7 +76,8 @@ def __init__(self):
winView.toggled.connect(tileView.setEnabled)
self.ui.menuView.addAction(tileView)

if int(self.settings.value("main/mode", 0)) == 0:
if self.settings.value(
"main/mode", QMdiArea.TabbedView) == QMdiArea.SubWindowView:
winView.setChecked(True)
else:
tileView.setEnabled(False)
Expand Down Expand Up @@ -287,9 +285,14 @@ def addTable(self):

def checkLicense(self):
self.license += 1
self.ui.statusbar.showMessage("{} minutes remaining in demo".format(30-self.license))
self.ui.statusbar.showMessage(
"{} minutes remaining in demo".format(
30 - self.license))
if self.license > 30:
QMessageBox.critical(self, "License expired", "The demo version of FastAnalyzer is expired, check https://www.fasttrack.sh/blog for more information.")
QMessageBox.critical(
self,
"License expired",
"The demo version of FastAnalyzer is expired, check https://www.fasttrack.sh/blog for more information.")
self.close()


Expand All @@ -304,7 +307,8 @@ def main():
app.setOrganizationDomain("fasttrack.sh")
widget = FastAnalyzer()
widget.show()
sys.exit(app.exec_())
sys.exit(app.exec())


if __name__ == '__main__':
main()
9 changes: 5 additions & 4 deletions fastanalyzer/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from PySide2.QtWidgets import QApplication, QMainWindow, QAction, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow
from PySide2.QtCore import Signal, QFile, QCoreApplication, QStandardPaths, Qt, QTimer
from PySide2.QtGui import QColor, QIcon, QPen, QPainter, QPalette, QPixmap, QFont, QFontDatabase
from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow
from PySide6.QtCore import Signal, QFile, QCoreApplication, QStandardPaths, Qt, QTimer
from PySide6.QtGui import QColor, QIcon, QPen, QPainter, QAction, QPalette, QPixmap, QFont, QFontDatabase
from ui_plot import Ui_Plot

from plot_settings import PlotSettings
Expand All @@ -17,7 +17,8 @@ def __init__(self, data, parent=None, params=None):
self.data = data
self.ui = Ui_Plot()
self.ui.setupUi(self)
self.settingsWindow = PlotSettings(self, params=params, keys=self.data.getDataframe().columns.values.tolist())
self.settingsWindow = PlotSettings(
self, params=params, keys=self.data.getDataframe().columns.values.tolist())
self.ui.settingsDock.setWidget(self.settingsWindow)

self.canvas = FigureCanvas(
Expand Down
8 changes: 4 additions & 4 deletions fastanalyzer/plot_settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PySide2.QtWidgets import QWidget, QApplication, QMainWindow, QAction, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow
from PySide2.QtCore import Signal, QFile, QStandardPaths, Qt, QTimer
from PySide2.QtGui import QColor, QIcon, QPen, QPainter, QPalette, QPixmap, QFont, QFontDatabase
import PySide2.QtXml
from PySide6.QtWidgets import QWidget, QApplication, QMainWindow, QFileDialog, QMessageBox, QLabel, QMdiArea, QMdiSubWindow
from PySide6.QtCore import Signal, QFile, QStandardPaths, Qt, QTimer
from PySide6.QtGui import QColor, QIcon, QPen, QPainter, QPalette, QAction, QPixmap, QFont, QFontDatabase
import PySide6.QtXml
from ui_plot_settings import Ui_PlotSettings


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fastanalysis>=0.0.3
matplotlib>=3.5.2
numpy>=1.22.4
PySide2>=5.15.2.1
PySide6
seaborn>=0.11.2
statannotations>=0.4.4

0 comments on commit 1f4f920

Please sign in to comment.