Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish

on: workflow_dispatch

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: read
steps:
- name: Checkout Source
uses: actions/checkout@v7

- name: Install UV and Python
uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.13"
enable-cache: true

- name: Build Package
run: uv build

- name: Publish Package
run: uv publish
7 changes: 6 additions & 1 deletion .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,23 @@ jobs:
with:
python-version: "3"
architecture: x64

- name: Checkout Source
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Install Dependencies
run: pip install -r requirements.txt -r requirements-dev.txt

- name: Ruff Check
run: |
ruff --version
ruff check

- name: Pyright Check
run: |
pyright --version
pyright

- name: Isort Check
run: |
isort --version
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
.venv/
.ruff_cache/
*.pyc
uv.lock

# Build
__pycache__/
dist/
build/

# Tests
.pytest_cache
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,11 @@ ignore = [

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["ANN", "SLF", "TC", "PLC2701"]
"utils/*" = ["ANN", "SLF", "TC"]

[tool.ruff.format]
quote-style = "double"

[tool.pyright]
include = ["subtle"]
exclude = ["**/__pycache__"]

reportIncompatibleMethodOverride = false

pythonVersion = "3.11"
11 changes: 5 additions & 6 deletions subtle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -39,14 +39,13 @@
# ============

__package__ = "subtle"
__copyright__ = "Copyright 2024, Veronica Berglyd Olsen"
__copyright__ = "Copyright (C) Veronica Berglyd Olsen"
__license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net"
__version__ = "0.1.0"
__hexversion__ = "0x000100a0"
__date__ = "2024-10-11"
__version__ = "26.1"
__date__ = "2026-06-24"

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -161,7 +160,7 @@ def main(sysArgs: list | None = None) -> GuiMain | None:
cHandle.setFormatter(logging.Formatter(fmt=logFmt, style="{"))
pkgLogger.addHandler(cHandle)

logger.info("Starting Subtle %s (%s) %s", __version__, __hexversion__, __date__)
logger.info("Starting Subtle %s (%s)", __version__, __date__)

# Finish initialising config
CONFIG.initialise()
Expand Down
3 changes: 3 additions & 0 deletions subtle/assets/subtle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion subtle/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
10 changes: 9 additions & 1 deletion subtle/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
====================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -165,6 +165,14 @@ def getSetting(self, key: str) -> str:
"""Get a generic string setting."""
return str(self._data["Settings"].get(key, ""))

def assetPath(self, resource: str, kind: str | None = None) -> Path:
"""Return the path to an asset."""
path = self._appPath / "assets"
if kind:
path /= kind
return path / resource


##
# Setters
##
Expand Down
2 changes: 1 addition & 1 deletion subtle/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/core/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==============

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/core/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
===========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/core/mediafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=============================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/core/mkvextract.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==================================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/core/spellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
======================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/formats/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=======================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/formats/pgssubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/formats/srtsubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/formats/ssasubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/filetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
======================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/highlighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
===========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/imageviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/mediaview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=======================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/subsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/texteditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/gui/toolspanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
10 changes: 8 additions & 2 deletions subtle/guimain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -38,7 +38,8 @@
from subtle.ocr.tesseract import TesseractOCR

from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QMainWindow, QSplitter
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QApplication, QMainWindow, QSplitter

if TYPE_CHECKING:
from PyQt6.QtGui import QCloseEvent
Expand Down Expand Up @@ -67,6 +68,11 @@ def __init__(self) -> None:
logger.debug("Ready: GUI")
logger.info("Subtle is ready ...")

mIcon = CONFIG.assetPath("icons") / "subtle.svg"
self.nwIcon = QIcon(str(mIcon)) if mIcon.exists() else QIcon()
self.setWindowIcon(self.nwIcon)
QApplication.setWindowIcon(self.nwIcon)

# Cached Data
# ===========

Expand Down
2 changes: 1 addition & 1 deletion subtle/ocr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=======================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/ocr/tesseract.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
==============================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion subtle/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
===========================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=======================

This file is a part of Subtle
Copyright 2024, Veronica Berglyd Olsen
Copyright (C) Veronica Berglyd Olsen

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
Loading
Loading