Compare commits

..

No commits in common. "36e644a736c25f8819e1237a77e36df7c9e876a9" and "5b2253ae72db06c62f65f6bb03d08496b6b3bb94" have entirely different histories.

10 changed files with 23 additions and 52 deletions

View File

@ -15,7 +15,7 @@ classifiers =
package_dir =
= src
packages = find:
python_requires = >=3.8
python_requires = >=3.6
install_requires =
requests
requests-futures

View File

@ -1,9 +1,6 @@
from configparser import ConfigParser
from pathlib import Path
try:
from PySide6 import QtCore
except ImportError:
from PySide2 import QtCore
from fime.exceptions import FimeException

View File

@ -7,9 +7,6 @@ from datetime import datetime, date, timedelta
from threading import Thread, Event
from typing import List
try:
from PySide6 import QtCore
except ImportError:
from PySide2 import QtCore
data_dir_path = os.path.join(QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.AppDataLocation),

View File

@ -3,9 +3,6 @@
# Created by: The Resource Compiler for Qt version 5.15.2
# WARNING! All changes made in this file will be lost!
try:
from PySide6 import QtCore
except ImportError:
from PySide2 import QtCore
qt_resource_data = b"\

View File

@ -1,6 +1,3 @@
try:
from PySide6 import QtGui, QtWidgets
except ImportError:
from PySide2 import QtGui, QtWidgets
from fime.task_completer import TaskCompleter

View File

@ -4,12 +4,8 @@ import signal
import sys
from functools import partial
try:
from PySide6 import QtCore, QtWidgets
PYSIDE_6 = True
except ImportError:
from PySide2 import QtCore, QtWidgets
PYSIDE_6 = False
from PySide2.QtWidgets import QMessageBox
# noinspection PyUnresolvedReferences
import fime.icons
@ -24,7 +20,6 @@ from fime.util import get_screen_height, get_icon
class App:
def __init__(self):
self.app = QtWidgets.QApplication(sys.argv)
self.app.setQuitOnLastWindowClosed(False)
data = Data()
self.tasks = Tasks(data)
@ -33,7 +28,7 @@ class App:
icon = get_icon("appointment-new")
self.menu = QtWidgets.QMenu(None)
self.menu = QtWidgets.QMenu()
self.import_task = ImportTask(None)
self.import_task.accepted.connect(self.new_task_imported)
@ -121,8 +116,7 @@ class App:
exit_action = self.menu.addAction("Close")
exit_action.triggered.connect(self.app.quit)
def sigterm_handler(self, signo, _frame):
print(f'handling signal "{signal.strsignal(signo)}"')
def sigterm_handler(self, _signo, _frame):
self.app.quit()
def run(self):
@ -132,9 +126,6 @@ class App:
timer.start(500)
signal.signal(signal.SIGTERM, self.sigterm_handler)
signal.signal(signal.SIGINT, self.sigterm_handler)
if PYSIDE_6:
self.app.exec()
else:
self.app.exec_()
@QtCore.Slot()
@ -158,7 +149,7 @@ def main():
app = App()
app.run()
except FimeException as e:
QtWidgets.QMessageBox.critical(None, "Error", str(e), QtWidgets.QMessageBox.Ok)
QMessageBox.critical(None, "Error", str(e), QMessageBox.Ok)
if __name__ == "__main__":

View File

@ -1,10 +1,9 @@
try:
from PySide6 import QtCore, QtGui, QtWidgets
except ImportError:
from PySide2 import QtCore, QtGui, QtWidgets
from datetime import datetime
from PySide2.QtWidgets import QHeaderView
from fime.data import Tasks
from fime.util import get_screen_height, get_icon
@ -42,9 +41,9 @@ class Report(QtWidgets.QDialog):
self.tableWidget.setItemDelegateForColumn(0, Report.TaskItemCompleter(self._tasks, self))
self.header = QtWidgets.QHeaderView(QtCore.Qt.Orientation.Horizontal)
self.header.setMinimumSectionSize(1)
self.header.setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents)
self.header.setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget.setHorizontalHeader(self.header)
self.header.setSectionResizeMode(self.header.logicalIndex(0), QtWidgets.QHeaderView.Stretch)
self.header.setSectionResizeMode(self.header.logicalIndex(0), QHeaderView.Stretch)
self.previous_button = QtWidgets.QPushButton()
self.previous_button.setText("Previous")

View File

@ -5,16 +5,15 @@ from functools import reduce
from queue import Queue, Empty
from urllib.parse import urlparse, parse_qs
try:
from PySide6 import QtCore, QtWidgets
except ImportError:
from PySide2 import QtCore, QtWidgets
from PySide2 import QtCore
from PySide2.QtCore import QTimer
from PySide2.QtWidgets import QCompleter
from requests_futures.sessions import FuturesSession
from fime.config import Config
class TaskCompleter(QtWidgets.QCompleter):
class TaskCompleter(QCompleter):
def __init__(self, parent=None, *args, **kwargs):
super().__init__([], parent, *args, **kwargs)
self.setFilterMode(QtCore.Qt.MatchFlag.MatchContains)
@ -27,7 +26,7 @@ class TaskCompleter(QtWidgets.QCompleter):
self.response_text = ""
self.model_data = set()
self.escalate = False
self.update_timer = QtCore.QTimer(self)
self.update_timer = QTimer(self)
self.update_timer.timeout.connect(self.process_response)
self.update_timer.setInterval(250)
self.queue = Queue()

View File

@ -1,6 +1,3 @@
try:
from PySide6 import QtCore, QtGui, QtWidgets
except ImportError:
from PySide2 import QtCore, QtGui, QtWidgets
from fime.util import get_icon

View File

@ -1,6 +1,3 @@
try:
from PySide6 import QtGui
except ImportError:
from PySide2 import QtGui