-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GUI + Shuffle API Structure #31
Conversation
Earlier to get the GUI to work, we duplicated grid.py and cache.py as asyncio.run needed to be called in a different place. This commit reshuffles things around so the cache and grid methods can be called from both Qt and Rich.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
def columnCount(self, parent: QtCore.QModelIndex = QtCore.QModelIndex()) -> int: | ||
return 1 | ||
|
||
def data(self, index: QtCore.QModelIndex, role=QtCore.Qt.ItemDataRole.DisplayRole) -> Optional[str]: |
Check notice
Code scanning / CodeQL
Explicit returns mixed with implicit (fall through) returns
src/doppkit/qt/ExportView.py
Outdated
@@ -0,0 +1,117 @@ | |||
from typing import Optional, Union | |||
from qtpy import QtCore, QtWidgets |
Check notice
Code scanning / CodeQL
Unused import
signal.signal(signal.SIGTERM, close) | ||
qApp.aboutToQuit.connect(close) | ||
with contextlib.suppress(asyncio.CancelledError): | ||
await future |
Check notice
Code scanning / CodeQL
Statement has no effect
class Progress(Protocol): | ||
|
||
def update(self, name: str, completed: int) -> None: | ||
... |
Check notice
Code scanning / CodeQL
Statement has no effect
|
||
def create_task(self, name: str, total: int) -> None: | ||
... |
Check notice
Code scanning / CodeQL
Statement has no effect
... | ||
|
||
def complete_task(self, name: str) -> None: | ||
... |
Check notice
Code scanning / CodeQL
Statement has no effect
for export_file in export_files: | ||
filename = export_file["name"] | ||
download_url = export_file["url"] | ||
size = export_file.get("filesize", 0) |
Check notice
Code scanning / CodeQL
Unused local variable
src/doppkit/qt/cache.py
Outdated
@@ -0,0 +1,46 @@ | |||
from typing import Iterable, Union, TYPE_CHECKING |
Check notice
Code scanning / CodeQL
Unused import
@@ -0,0 +1,285 @@ | |||
import os | |||
from .. import __version__ | |||
from ..grid import Grid, AOI, Exportfile, Export |
Check notice
Code scanning / CodeQL
Unused import
This PR adds the
doppkit-gui
entry point, where a desktop application will launch if the required dependencies are installed (pip install doppkit[GUI]
). The application is to be considered extreme BETA, there is no progress feedback incorporated yet, and while it has been demonstrated to work in limited cases, it is highly experimental.To accommodate the GUI, significant restructuring of the project has been made. Type annotations have been added, and a
Progress
typing.Protocol
object is added togrid.py
that describes what methods and signatures need to be implemented for progress to be reported back should a developer not want to rely on the GUI orrich
.