Some type annotations and some export key refactoring by exarkun · Pull Request #477 · gridsync/gridsync

and others added 28 commits

May 5, 2022 15:31
I don't know what the deal with QThread is but it's more work to use than
Twisted's thread API and when you make a mistake, it SIGABRTs your whole
process instead of giving you an exception, so let's not use it if we don't
have to.
Without this, mypy (and/or pyqt5-stubs?) thinks ZKAPBarChartView's
inherited `chart()` method will always/only return a plain `QChart`
(and will throw an "attr-defined" error -- "'QChart' has no attribute
'update_chart'"). Using a custom getter here avoids this confusion:
`ZKAPBarChartView.get_chart` will always/only return a `ZKAPBarChart`.
As with the previous commit, using this custom/type-annotated getter
informs mypy that we are always/only expecting `View` to use a `Model`
(from gridsync/gui/model.py) for its model and not some other, broader
type that's missing the methods/attributes we want to type-check.
…ome-more-type-annotations.2
This avoids a TypeError from pynacl that disrupts key export.

@exarkun

@exarkun exarkun deleted the some-more-type-annotations.2 branch

June 16, 2022 15:15