isort followed by black
All checks were successful
CI / test (push) Successful in 9m47s
Lint / test (push) Successful in 40s
Trivy / test (push) Successful in 22s

This commit is contained in:
Miguel Jacq 2025-12-11 14:03:08 +11:00
parent 0862ce7fd6
commit fb873edcb5
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
56 changed files with 311 additions and 360 deletions

View file

@ -3,19 +3,17 @@ from __future__ import annotations
import importlib.metadata
import requests
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QLabel,
QTextEdit,
QDialogButtonBox,
QLabel,
QMessageBox,
QTextEdit,
QVBoxLayout,
)
from . import strings
BUG_REPORT_HOST = "https://nr.mig5.net"
ROUTE = "forms/bouquin/bugs"

View file

@ -1,15 +1,14 @@
from __future__ import annotations
from PySide6.QtCore import QSize, QRect, Qt
from PySide6.QtGui import QPainter, QPalette, QColor, QFont, QFontMetrics
from PySide6.QtCore import QRect, QSize, Qt
from PySide6.QtGui import QColor, QFont, QFontMetrics, QPainter, QPalette
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QPlainTextEdit,
QDialogButtonBox,
QComboBox,
QDialog,
QDialogButtonBox,
QLabel,
QPlainTextEdit,
QVBoxLayout,
QWidget,
)

View file

@ -1,9 +1,9 @@
from __future__ import annotations
import re
from typing import Optional, Dict
from typing import Dict, Optional
from PySide6.QtGui import QColor, QTextCharFormat, QFont
from PySide6.QtGui import QColor, QFont, QTextCharFormat
class CodeHighlighter:

View file

@ -5,16 +5,15 @@ import datetime as _dt
import hashlib
import html
import json
import markdown
import mimetypes
import re
from dataclasses import dataclass
from pathlib import Path
from sqlcipher3 import dbapi2 as sqlite
from sqlcipher3 import Binary
from typing import List, Sequence, Tuple, Dict
from typing import Dict, List, Sequence, Tuple
import markdown
from sqlcipher3 import Binary
from sqlcipher3 import dbapi2 as sqlite
from . import strings

View file

@ -8,8 +8,8 @@ and TagBrowserDialog).
from __future__ import annotations
from pathlib import Path
import tempfile
from pathlib import Path
from typing import TYPE_CHECKING, Optional
from PySide6.QtCore import QUrl

View file

@ -5,32 +5,32 @@ from typing import Optional
from PySide6.QtCore import Qt
from PySide6.QtGui import QColor
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QHBoxLayout,
QFormLayout,
QComboBox,
QLineEdit,
QTableWidget,
QTableWidgetItem,
QAbstractItemView,
QHeaderView,
QPushButton,
QComboBox,
QDialog,
QFileDialog,
QMessageBox,
QWidget,
QFormLayout,
QFrame,
QToolButton,
QHBoxLayout,
QHeaderView,
QLineEdit,
QListWidget,
QListWidgetItem,
QMessageBox,
QPushButton,
QSizePolicy,
QStyle,
QTableWidget,
QTableWidgetItem,
QToolButton,
QVBoxLayout,
QWidget,
)
from . import strings
from .db import DBManager, DocumentRow
from .settings import load_db_config
from .time_log import TimeCodeManagerDialog
from . import strings
class TodaysDocumentsWidget(QFrame):

View file

@ -1,20 +1,15 @@
from __future__ import annotations
from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import (
QShortcut,
QTextCursor,
QTextCharFormat,
QTextDocument,
)
from PySide6.QtGui import QShortcut, QTextCharFormat, QTextCursor, QTextDocument
from PySide6.QtWidgets import (
QWidget,
QHBoxLayout,
QLineEdit,
QLabel,
QPushButton,
QCheckBox,
QHBoxLayout,
QLabel,
QLineEdit,
QPushButton,
QTextEdit,
QWidget,
)
from . import strings

View file

@ -1,19 +1,22 @@
from __future__ import annotations
import difflib, re, html as _html
import difflib
import html as _html
import re
from datetime import datetime
from PySide6.QtCore import Qt, Slot
from PySide6.QtWidgets import (
QAbstractItemView,
QDialog,
QVBoxLayout,
QHBoxLayout,
QListWidget,
QListWidgetItem,
QPushButton,
QMessageBox,
QTextBrowser,
QPushButton,
QTabWidget,
QAbstractItemView,
QTextBrowser,
QVBoxLayout,
)
from . import strings

View file

@ -2,44 +2,39 @@ from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from sqlcipher3 import dbapi2 as sqlite3
from PySide6.QtCore import Qt, QDate, QUrl, Signal
from PySide6.QtGui import (
QImage,
QTextDocument,
QPageLayout,
QDesktopServices,
)
from PySide6.QtCore import QDate, Qt, QUrl, Signal
from PySide6.QtGui import QDesktopServices, QImage, QPageLayout, QTextDocument
from PySide6.QtPrintSupport import QPrinter
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QHBoxLayout,
QFormLayout,
QLabel,
QLineEdit,
QAbstractItemView,
QButtonGroup,
QCheckBox,
QComboBox,
QDateEdit,
QCheckBox,
QTextEdit,
QTableWidget,
QTableWidgetItem,
QAbstractItemView,
QHeaderView,
QPushButton,
QRadioButton,
QButtonGroup,
QDialog,
QDoubleSpinBox,
QFileDialog,
QFormLayout,
QHBoxLayout,
QHeaderView,
QLabel,
QLineEdit,
QMessageBox,
QPushButton,
QRadioButton,
QTableWidget,
QTableWidgetItem,
QTextEdit,
QVBoxLayout,
QWidget,
)
from sqlcipher3 import dbapi2 as sqlite3
from . import strings
from .db import DBManager, TimeLogRow
from .reminders import Reminder, ReminderType
from .settings import load_db_config
from . import strings
class InvoiceDetailMode(str, Enum):

View file

@ -4,13 +4,13 @@ from pathlib import Path
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QDialogButtonBox,
QFileDialog,
QHBoxLayout,
QLabel,
QLineEdit,
QPushButton,
QDialogButtonBox,
QFileDialog,
QVBoxLayout,
)
from . import strings

View file

@ -1,7 +1,7 @@
from __future__ import annotations
from PySide6.QtCore import Qt, QEvent
from PySide6.QtWidgets import QWidget, QVBoxLayout, QLabel, QPushButton
from PySide6.QtCore import QEvent, Qt
from PySide6.QtWidgets import QLabel, QPushButton, QVBoxLayout, QWidget
from . import strings
from .theme import ThemeManager

View file

@ -2,13 +2,14 @@ from __future__ import annotations
import sys
from pathlib import Path
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon
from .settings import APP_NAME, APP_ORG, get_settings
from .main_window import MainWindow
from .theme import Theme, ThemeConfig, ThemeManager
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QApplication
from . import strings
from .main_window import MainWindow
from .settings import APP_NAME, APP_ORG, get_settings
from .theme import Theme, ThemeConfig, ThemeManager
def main():

View file

@ -2,21 +2,21 @@ from __future__ import annotations
import datetime
import os
import sys
import re
import sys
from pathlib import Path
from PySide6.QtCore import (
QDate,
QTimer,
Qt,
QSettings,
Slot,
QUrl,
QEvent,
QSignalBlocker,
QDateTime,
QEvent,
QSettings,
QSignalBlocker,
Qt,
QTime,
QTimer,
QUrl,
Slot,
)
from PySide6.QtGui import (
QAction,
@ -31,23 +31,24 @@ from PySide6.QtGui import (
QTextListFormat,
)
from PySide6.QtWidgets import (
QApplication,
QCalendarWidget,
QDialog,
QFileDialog,
QLabel,
QMainWindow,
QMenu,
QMessageBox,
QPushButton,
QSizePolicy,
QSplitter,
QTableView,
QTabWidget,
QVBoxLayout,
QWidget,
QLabel,
QPushButton,
QApplication,
)
from . import strings
from .bug_report_dialog import BugReportDialog
from .db import DBManager
from .documents import DocumentsDialog, TodaysDocumentsWidget
@ -60,10 +61,9 @@ from .pomodoro_timer import PomodoroManager
from .reminders import UpcomingRemindersWidget
from .save_dialog import SaveDialog
from .search import Search
from .settings import APP_ORG, APP_NAME, load_db_config, save_db_config
from .settings import APP_NAME, APP_ORG, load_db_config, save_db_config
from .settings_dialog import SettingsDialog
from .statistics_dialog import StatisticsDialog
from . import strings
from .tags_widget import PageTagsWidget
from .theme import ThemeManager
from .time_log import TimeLogWidget

View file

@ -5,28 +5,28 @@ import re
from pathlib import Path
from typing import Optional, Tuple
from PySide6.QtCore import QRect, Qt, QTimer, QUrl
from PySide6.QtGui import (
QDesktopServices,
QFont,
QFontDatabase,
QFontMetrics,
QImage,
QMouseEvent,
QTextBlock,
QTextBlockFormat,
QTextCharFormat,
QTextCursor,
QTextDocument,
QTextFormat,
QTextBlockFormat,
QTextImageFormat,
QDesktopServices,
)
from PySide6.QtCore import Qt, QRect, QTimer, QUrl
from PySide6.QtWidgets import QDialog, QTextEdit
from .theme import ThemeManager
from .markdown_highlighter import MarkdownHighlighter
from .code_block_editor_dialog import CodeBlockEditorDialog
from . import strings
from .code_block_editor_dialog import CodeBlockEditorDialog
from .markdown_highlighter import MarkdownHighlighter
from .theme import ThemeManager
class MarkdownEditor(QTextEdit):

View file

@ -14,7 +14,7 @@ from PySide6.QtGui import (
QTextDocument,
)
from .theme import ThemeManager, Theme
from .theme import Theme, ThemeManager
class MarkdownHighlighter(QSyntaxHighlighter):

View file

@ -6,10 +6,10 @@ from typing import Optional
from PySide6.QtCore import Qt, QTimer, Signal, Slot
from PySide6.QtWidgets import (
QFrame,
QVBoxLayout,
QHBoxLayout,
QLabel,
QPushButton,
QVBoxLayout,
QWidget,
)

View file

@ -4,30 +4,30 @@ from dataclasses import dataclass
from enum import Enum
from typing import Optional
from PySide6.QtCore import Qt, QDate, QTime, QDateTime, QTimer, Slot, Signal
from PySide6.QtCore import QDate, QDateTime, Qt, QTime, QTimer, Signal, Slot
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QHBoxLayout,
QFormLayout,
QLineEdit,
QAbstractItemView,
QComboBox,
QTimeEdit,
QPushButton,
QDateEdit,
QDialog,
QFormLayout,
QFrame,
QWidget,
QToolButton,
QHBoxLayout,
QHeaderView,
QLineEdit,
QListWidget,
QListWidgetItem,
QStyle,
QSizePolicy,
QMessageBox,
QPushButton,
QSizePolicy,
QSpinBox,
QStyle,
QTableWidget,
QTableWidgetItem,
QAbstractItemView,
QHeaderView,
QSpinBox,
QDateEdit,
QTimeEdit,
QToolButton,
QVBoxLayout,
QWidget,
)
from . import strings
@ -566,8 +566,8 @@ class UpcomingRemindersWidget(QFrame):
if not selected_items:
return
from PySide6.QtWidgets import QMenu
from PySide6.QtGui import QAction
from PySide6.QtWidgets import QMenu
menu = QMenu(self)

View file

@ -3,13 +3,7 @@ from __future__ import annotations
import datetime
from PySide6.QtGui import QFontMetrics
from PySide6.QtWidgets import (
QDialog,
QVBoxLayout,
QLabel,
QLineEdit,
QDialogButtonBox,
)
from PySide6.QtWidgets import QDialog, QDialogButtonBox, QLabel, QLineEdit, QVBoxLayout
from . import strings

View file

@ -6,12 +6,12 @@ from typing import Iterable, Tuple
from PySide6.QtCore import Qt, Signal
from PySide6.QtWidgets import (
QFrame,
QHBoxLayout,
QLabel,
QLineEdit,
QListWidget,
QListWidgetItem,
QSizePolicy,
QHBoxLayout,
QVBoxLayout,
QWidget,
)

View file

@ -1,6 +1,7 @@
from __future__ import annotations
from pathlib import Path
from PySide6.QtCore import QSettings, QStandardPaths
from .db import DBConfig

View file

@ -2,38 +2,36 @@ from __future__ import annotations
from pathlib import Path
from PySide6.QtCore import Qt, Slot
from PySide6.QtGui import QPalette
from PySide6.QtWidgets import (
QCheckBox,
QComboBox,
QDialog,
QFrame,
QDialogButtonBox,
QFileDialog,
QFormLayout,
QFrame,
QGroupBox,
QHBoxLayout,
QLabel,
QLineEdit,
QFormLayout,
QHBoxLayout,
QVBoxLayout,
QMessageBox,
QPushButton,
QDialogButtonBox,
QRadioButton,
QSizePolicy,
QSpinBox,
QMessageBox,
QWidget,
QTabWidget,
QTextEdit,
QVBoxLayout,
QWidget,
)
from PySide6.QtCore import Qt, Slot
from PySide6.QtGui import QPalette
from .db import DBConfig, DBManager
from .settings import load_db_config, save_db_config
from .theme import Theme
from .key_prompt import KeyPrompt
from . import strings
from .db import DBConfig, DBManager
from .key_prompt import KeyPrompt
from .settings import load_db_config, save_db_config
from .theme import Theme
class SettingsDialog(QDialog):

View file

@ -3,26 +3,25 @@ from __future__ import annotations
import datetime as _dt
from typing import Dict
from PySide6.QtCore import Qt, QSize, Signal
from PySide6.QtGui import QColor, QPainter, QPen, QBrush
from PySide6.QtCore import QSize, Qt, Signal
from PySide6.QtGui import QBrush, QColor, QPainter, QPen
from PySide6.QtWidgets import (
QComboBox,
QDialog,
QVBoxLayout,
QFormLayout,
QLabel,
QGroupBox,
QHBoxLayout,
QComboBox,
QLabel,
QScrollArea,
QWidget,
QSizePolicy,
QVBoxLayout,
QWidget,
)
from . import strings
from .db import DBManager
from .settings import load_db_config
# ---------- Activity heatmap ----------

View file

@ -1,5 +1,5 @@
from importlib.resources import files
import json
from importlib.resources import files
# Get list of locales
root = files("bouquin") / "locales"

View file

@ -1,22 +1,22 @@
from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import QColor
from PySide6.QtWidgets import (
QColorDialog,
QDialog,
QVBoxLayout,
QHBoxLayout,
QInputDialog,
QLabel,
QMessageBox,
QPushButton,
QTreeWidget,
QTreeWidgetItem,
QPushButton,
QLabel,
QColorDialog,
QMessageBox,
QInputDialog,
QVBoxLayout,
)
from sqlcipher3.dbapi2 import IntegrityError
from . import strings
from .db import DBManager
from .settings import load_db_config
from . import strings
from sqlcipher3.dbapi2 import IntegrityError
class TagBrowserDialog(QDialog):

View file

@ -4,16 +4,16 @@ from typing import Optional
from PySide6.QtCore import Qt, Signal
from PySide6.QtWidgets import (
QCompleter,
QFrame,
QHBoxLayout,
QVBoxLayout,
QWidget,
QToolButton,
QLabel,
QLineEdit,
QSizePolicy,
QStyle,
QCompleter,
QToolButton,
QVBoxLayout,
QWidget,
)
from . import strings

View file

@ -1,11 +1,13 @@
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from PySide6.QtGui import QPalette, QColor, QGuiApplication, QTextCharFormat
from PySide6.QtWidgets import QApplication, QCalendarWidget, QWidget
from PySide6.QtCore import QObject, Signal, Qt
from weakref import WeakSet
from PySide6.QtCore import QObject, Qt, Signal
from PySide6.QtGui import QColor, QGuiApplication, QPalette, QTextCharFormat
from PySide6.QtWidgets import QApplication, QCalendarWidget, QWidget
class Theme(Enum):
SYSTEM = "system"

View file

@ -2,50 +2,49 @@ from __future__ import annotations
import csv
import html
from collections import defaultdict
from datetime import datetime
from sqlcipher3.dbapi2 import IntegrityError
from typing import Optional
from PySide6.QtCore import Qt, QDate, QUrl, Signal
from PySide6.QtGui import QPainter, QColor, QImage, QTextDocument, QPageLayout
from PySide6.QtCore import QDate, Qt, QUrl, Signal
from PySide6.QtGui import QColor, QImage, QPageLayout, QPainter, QTextDocument
from PySide6.QtPrintSupport import QPrinter
from PySide6.QtWidgets import (
QAbstractItemView,
QCalendarWidget,
QComboBox,
QCompleter,
QDateEdit,
QDialog,
QDialogButtonBox,
QFrame,
QVBoxLayout,
QHBoxLayout,
QWidget,
QDoubleSpinBox,
QFileDialog,
QFormLayout,
QLabel,
QComboBox,
QLineEdit,
QDoubleSpinBox,
QPushButton,
QTableWidget,
QTableWidgetItem,
QAbstractItemView,
QFrame,
QHBoxLayout,
QHeaderView,
QTabWidget,
QInputDialog,
QLabel,
QLineEdit,
QListWidget,
QListWidgetItem,
QDateEdit,
QMessageBox,
QCompleter,
QToolButton,
QPushButton,
QSizePolicy,
QStyle,
QInputDialog,
QTableWidget,
QTableWidgetItem,
QTabWidget,
QToolButton,
QVBoxLayout,
QWidget,
)
from sqlcipher3.dbapi2 import IntegrityError
from . import strings
from .db import DBManager
from .settings import load_db_config
from .theme import ThemeManager
from . import strings
class TimeLogWidget(QFrame):

View file

@ -1,7 +1,7 @@
from __future__ import annotations
from PySide6.QtCore import Signal, Qt
from PySide6.QtGui import QAction, QKeySequence, QFont, QFontDatabase, QActionGroup
from PySide6.QtCore import Qt, Signal
from PySide6.QtGui import QAction, QActionGroup, QFont, QFontDatabase, QKeySequence
from PySide6.QtWidgets import QToolBar
from . import strings

View file

@ -5,23 +5,17 @@ import os
import re
import subprocess # nosec
import tempfile
from importlib.resources import files
from pathlib import Path
import requests
from importlib.resources import files
from PySide6.QtCore import QStandardPaths, Qt
from PySide6.QtWidgets import (
QApplication,
QMessageBox,
QWidget,
QProgressDialog,
)
from PySide6.QtGui import QPixmap, QImage, QPainter, QGuiApplication
from PySide6.QtGui import QGuiApplication, QImage, QPainter, QPixmap
from PySide6.QtSvg import QSvgRenderer
from PySide6.QtWidgets import QApplication, QMessageBox, QProgressDialog, QWidget
from .settings import APP_NAME
from . import strings
from .settings import APP_NAME
# Where to fetch the latest version string from
VERSION_URL = "https://mig5.net/bouquin/version.txt"