Fix all bar one typing errors
This commit is contained in:
parent
df2652e6cc
commit
0c38fc2ef4
@ -7,7 +7,7 @@ import stackprinter # type: ignore
|
|||||||
from dbconfig import Session, scoped_session
|
from dbconfig import Session, scoped_session
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Iterable, List, Optional
|
from typing import Iterable, List, Optional, Union, ValuesView
|
||||||
|
|
||||||
from sqlalchemy.ext.associationproxy import association_proxy
|
from sqlalchemy.ext.associationproxy import association_proxy
|
||||||
|
|
||||||
@ -411,8 +411,9 @@ class PlaylistRows(Base):
|
|||||||
plr.note)
|
plr.note)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def delete_plrids_not_in_list(session: scoped_session, playlist_id: int,
|
def delete_plrids_not_in_list(
|
||||||
plrids: List[int]) -> None:
|
session: scoped_session, playlist_id: int,
|
||||||
|
plr_ids: Union[Iterable[int], ValuesView]) -> None:
|
||||||
"""
|
"""
|
||||||
Delete rows in given playlist that have a higher row number
|
Delete rows in given playlist that have a higher row number
|
||||||
than 'maxrow'
|
than 'maxrow'
|
||||||
@ -422,7 +423,7 @@ class PlaylistRows(Base):
|
|||||||
delete(PlaylistRows)
|
delete(PlaylistRows)
|
||||||
.where(
|
.where(
|
||||||
PlaylistRows.playlist_id == playlist_id,
|
PlaylistRows.playlist_id == playlist_id,
|
||||||
PlaylistRows.id.not_in(plrids)
|
PlaylistRows.id.not_in(plr_ids)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
# Delete won't take effect until commit()
|
# Delete won't take effect until commit()
|
||||||
@ -530,7 +531,7 @@ class PlaylistRows(Base):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def indexed_by_id(session: scoped_session,
|
def indexed_by_id(session: scoped_session,
|
||||||
plr_ids: Iterable[int]) -> dict:
|
plr_ids: Union[Iterable[int], ValuesView]) -> dict:
|
||||||
"""
|
"""
|
||||||
Return a dictionary of playlist_rows indexed by their plr id from
|
Return a dictionary of playlist_rows indexed by their plr id from
|
||||||
the passed plr_id list.
|
the passed plr_id list.
|
||||||
|
|||||||
@ -127,7 +127,7 @@ class CartButton(QPushButton):
|
|||||||
if event.type() == QEvent.MouseButtonRelease:
|
if event.type() == QEvent.MouseButtonRelease:
|
||||||
mouse_event = cast(QMouseEvent, event)
|
mouse_event = cast(QMouseEvent, event)
|
||||||
if mouse_event.button() == Qt.RightButton:
|
if mouse_event.button() == Qt.RightButton:
|
||||||
self.musicmuster.cart_edit(self, event) # type: ignore # FIXME
|
self.musicmuster.cart_edit(self, event)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return super().event(event)
|
return super().event(event)
|
||||||
|
|||||||
@ -839,7 +839,7 @@ class PlaylistTab(QTableWidget):
|
|||||||
# Now build a dictionary of
|
# Now build a dictionary of
|
||||||
# {display_row_number: display_row_plr}
|
# {display_row_number: display_row_plr}
|
||||||
plr_dict_by_id = PlaylistRows.indexed_by_id(
|
plr_dict_by_id = PlaylistRows.indexed_by_id(
|
||||||
session, iter(display_plr_ids.values())) # type: ignore # FIXME
|
session, display_plr_ids.values())
|
||||||
|
|
||||||
# Finally a dictionary of
|
# Finally a dictionary of
|
||||||
# {display_row_number: plr}
|
# {display_row_number: plr}
|
||||||
@ -858,7 +858,7 @@ class PlaylistTab(QTableWidget):
|
|||||||
session.flush()
|
session.flush()
|
||||||
PlaylistRows.delete_plrids_not_in_list(
|
PlaylistRows.delete_plrids_not_in_list(
|
||||||
session, self.playlist_id,
|
session, self.playlist_id,
|
||||||
iter(display_plr_ids.values())) # type: ignore # FIXME
|
display_plr_ids.values())
|
||||||
|
|
||||||
def scroll_current_to_top(self) -> None:
|
def scroll_current_to_top(self) -> None:
|
||||||
"""Scroll currently-playing row to top"""
|
"""Scroll currently-playing row to top"""
|
||||||
|
|||||||
114
poetry.lock
generated
114
poetry.lock
generated
@ -1,6 +1,6 @@
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "alembic"
|
name = "alembic"
|
||||||
version = "1.9.1"
|
version = "1.9.3"
|
||||||
description = "A database migration tool for SQLAlchemy."
|
description = "A database migration tool for SQLAlchemy."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -67,17 +67,6 @@ category = "dev"
|
|||||||
optional = false
|
optional = false
|
||||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "commonmark"
|
|
||||||
version = "0.9.1"
|
|
||||||
description = "Python parser for the CommonMark Markdown spec"
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = "*"
|
|
||||||
|
|
||||||
[package.extras]
|
|
||||||
test = ["hypothesis (==3.55.3)", "flake8 (==3.7.8)"]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "decorator"
|
name = "decorator"
|
||||||
version = "5.1.1"
|
version = "5.1.1"
|
||||||
@ -151,7 +140,7 @@ dev = ["dlint", "flake8-2020", "flake8-aaa", "flake8-absolute-import", "flake8-a
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "greenlet"
|
name = "greenlet"
|
||||||
version = "2.0.1"
|
version = "2.0.2"
|
||||||
description = "Lightweight in-process concurrent programming"
|
description = "Lightweight in-process concurrent programming"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -159,15 +148,15 @@ python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"
|
|||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
docs = ["sphinx", "docutils (<0.18)"]
|
docs = ["sphinx", "docutils (<0.18)"]
|
||||||
test = ["objgraph", "psutil", "faulthandler"]
|
test = ["objgraph", "psutil"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iniconfig"
|
name = "iniconfig"
|
||||||
version = "1.1.1"
|
version = "2.0.0"
|
||||||
description = "iniconfig: brain-dead simple config-ini parsing"
|
description = "brain-dead simple config-ini parsing"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipdb"
|
name = "ipdb"
|
||||||
@ -184,7 +173,7 @@ tomli = {version = "*", markers = "python_version > \"3.6\" and python_version <
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipython"
|
name = "ipython"
|
||||||
version = "8.7.0"
|
version = "8.9.0"
|
||||||
description = "IPython: Productive Interactive Computing"
|
description = "IPython: Productive Interactive Computing"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -199,7 +188,7 @@ jedi = ">=0.16"
|
|||||||
matplotlib-inline = "*"
|
matplotlib-inline = "*"
|
||||||
pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""}
|
pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""}
|
||||||
pickleshare = "*"
|
pickleshare = "*"
|
||||||
prompt-toolkit = ">=3.0.11,<3.1.0"
|
prompt-toolkit = ">=3.0.30,<3.1.0"
|
||||||
pygments = ">=2.4.0"
|
pygments = ">=2.4.0"
|
||||||
stack-data = "*"
|
stack-data = "*"
|
||||||
traitlets = ">=5"
|
traitlets = ">=5"
|
||||||
@ -267,9 +256,30 @@ babel = ["babel"]
|
|||||||
lingua = ["lingua"]
|
lingua = ["lingua"]
|
||||||
testing = ["pytest"]
|
testing = ["pytest"]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "markdown-it-py"
|
||||||
|
version = "2.1.0"
|
||||||
|
description = "Python port of markdown-it. Markdown parsing, done right!"
|
||||||
|
category = "main"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
|
[package.dependencies]
|
||||||
|
mdurl = ">=0.1,<1.0"
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
benchmarking = ["psutil", "pytest", "pytest-benchmark (>=3.2,<4.0)"]
|
||||||
|
code_style = ["pre-commit (==2.6)"]
|
||||||
|
compare = ["commonmark (>=0.9.1,<0.10.0)", "markdown (>=3.3.6,<3.4.0)", "mistletoe (>=0.8.1,<0.9.0)", "mistune (>=2.0.2,<2.1.0)", "panflute (>=2.1.3,<2.2.0)"]
|
||||||
|
linkify = ["linkify-it-py (>=1.0,<2.0)"]
|
||||||
|
plugins = ["mdit-py-plugins"]
|
||||||
|
profiling = ["gprof2dot"]
|
||||||
|
rtd = ["attrs", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx-book-theme"]
|
||||||
|
testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "markupsafe"
|
name = "markupsafe"
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
description = "Safely add untrusted strings to HTML/XML markup."
|
description = "Safely add untrusted strings to HTML/XML markup."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -294,6 +304,14 @@ category = "dev"
|
|||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mdurl"
|
||||||
|
version = "0.1.2"
|
||||||
|
description = "Markdown URL utilities"
|
||||||
|
category = "main"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mutagen"
|
name = "mutagen"
|
||||||
version = "1.46.0"
|
version = "1.46.0"
|
||||||
@ -323,11 +341,11 @@ reports = ["lxml"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mypy-extensions"
|
name = "mypy-extensions"
|
||||||
version = "0.4.3"
|
version = "1.0.0"
|
||||||
description = "Experimental type system extensions for programs checked with the mypy typechecker."
|
description = "Type system extensions for programs checked with the mypy type checker."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = "*"
|
python-versions = ">=3.5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mysqlclient"
|
name = "mysqlclient"
|
||||||
@ -339,7 +357,7 @@ python-versions = ">=3.5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "packaging"
|
name = "packaging"
|
||||||
version = "22.0"
|
version = "23.0"
|
||||||
description = "Core utilities for Python packages"
|
description = "Core utilities for Python packages"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -482,7 +500,7 @@ python-versions = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pygments"
|
name = "pygments"
|
||||||
version = "2.13.0"
|
version = "2.14.0"
|
||||||
description = "Pygments is a syntax highlighting package written in Python."
|
description = "Pygments is a syntax highlighting package written in Python."
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -493,14 +511,14 @@ plugins = ["importlib-metadata"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyqt5"
|
name = "pyqt5"
|
||||||
version = "5.15.7"
|
version = "5.15.9"
|
||||||
description = "Python bindings for the Qt cross platform application toolkit"
|
description = "Python bindings for the Qt cross platform application toolkit"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
PyQt5-Qt5 = ">=5.15.0"
|
PyQt5-Qt5 = ">=5.15.2"
|
||||||
PyQt5-sip = ">=12.11,<13"
|
PyQt5-sip = ">=12.11,<13"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -513,7 +531,7 @@ python-versions = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyqt5-sip"
|
name = "pyqt5-sip"
|
||||||
version = "12.11.0"
|
version = "12.11.1"
|
||||||
description = "The sip module support for PyQt5"
|
description = "The sip module support for PyQt5"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -553,7 +571,7 @@ python-versions = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytest"
|
name = "pytest"
|
||||||
version = "7.2.0"
|
version = "7.2.1"
|
||||||
description = "pytest: simple powerful testing with Python"
|
description = "pytest: simple powerful testing with Python"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -618,18 +636,18 @@ python-versions = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rich"
|
name = "rich"
|
||||||
version = "12.6.0"
|
version = "13.3.1"
|
||||||
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
|
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6.3,<4.0.0"
|
python-versions = ">=3.7.0"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
commonmark = ">=0.9.0,<0.10.0"
|
markdown-it-py = ">=2.1.0,<3.0.0"
|
||||||
pygments = ">=2.6.0,<3.0.0"
|
pygments = ">=2.14.0,<3.0.0"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"]
|
jupyter = ["ipywidgets (>=7.5.1,<9)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "six"
|
name = "six"
|
||||||
@ -641,7 +659,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sqlalchemy"
|
name = "sqlalchemy"
|
||||||
version = "1.4.45"
|
version = "1.4.46"
|
||||||
description = "Database Abstraction Library"
|
description = "Database Abstraction Library"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -754,7 +772,7 @@ python-versions = ">=3.7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "traitlets"
|
name = "traitlets"
|
||||||
version = "5.8.0"
|
version = "5.9.0"
|
||||||
description = "Traitlets Python configuration system"
|
description = "Traitlets Python configuration system"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -766,7 +784,7 @@ test = ["argcomplete (>=2.0)", "pre-commit", "pytest", "pytest-mock"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "types-psutil"
|
name = "types-psutil"
|
||||||
version = "5.9.5.5"
|
version = "5.9.5.6"
|
||||||
description = "Typing stubs for psutil"
|
description = "Typing stubs for psutil"
|
||||||
category = "main"
|
category = "main"
|
||||||
optional = false
|
optional = false
|
||||||
@ -782,7 +800,7 @@ python-versions = ">=3.7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "urllib3"
|
name = "urllib3"
|
||||||
version = "1.26.13"
|
version = "1.26.14"
|
||||||
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
description = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -795,7 +813,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wcwidth"
|
name = "wcwidth"
|
||||||
version = "0.2.5"
|
version = "0.2.6"
|
||||||
description = "Measures the displayed width of unicode strings in a terminal"
|
description = "Measures the displayed width of unicode strings in a terminal"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -816,7 +834,6 @@ backcall = [
|
|||||||
{file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"},
|
{file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"},
|
||||||
]
|
]
|
||||||
colorama = []
|
colorama = []
|
||||||
commonmark = []
|
|
||||||
decorator = [
|
decorator = [
|
||||||
{file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"},
|
{file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"},
|
||||||
{file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"},
|
{file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"},
|
||||||
@ -827,24 +844,20 @@ executing = []
|
|||||||
flake8 = []
|
flake8 = []
|
||||||
flakehell = []
|
flakehell = []
|
||||||
greenlet = []
|
greenlet = []
|
||||||
iniconfig = [
|
iniconfig = []
|
||||||
{file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"},
|
|
||||||
{file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"},
|
|
||||||
]
|
|
||||||
ipdb = []
|
ipdb = []
|
||||||
ipython = []
|
ipython = []
|
||||||
jedi = []
|
jedi = []
|
||||||
line-profiler = []
|
line-profiler = []
|
||||||
mako = []
|
mako = []
|
||||||
|
markdown-it-py = []
|
||||||
markupsafe = []
|
markupsafe = []
|
||||||
matplotlib-inline = []
|
matplotlib-inline = []
|
||||||
mccabe = []
|
mccabe = []
|
||||||
|
mdurl = []
|
||||||
mutagen = []
|
mutagen = []
|
||||||
mypy = []
|
mypy = []
|
||||||
mypy-extensions = [
|
mypy-extensions = []
|
||||||
{file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"},
|
|
||||||
{file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"},
|
|
||||||
]
|
|
||||||
mysqlclient = []
|
mysqlclient = []
|
||||||
packaging = []
|
packaging = []
|
||||||
parso = [
|
parso = [
|
||||||
@ -930,7 +943,4 @@ traitlets = []
|
|||||||
types-psutil = []
|
types-psutil = []
|
||||||
typing-extensions = []
|
typing-extensions = []
|
||||||
urllib3 = []
|
urllib3 = []
|
||||||
wcwidth = [
|
wcwidth = []
|
||||||
{file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"},
|
|
||||||
{file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"},
|
|
||||||
]
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user