Browse Source

Fix lint issues.

pianoroll
Ben Niemann 3 years ago
parent
commit
03ed61951e
  1. 2
      3rdparty/typeshed/PyQt5/QtWidgets.pyi
  2. 12
      noisicaa/builtin_nodes/pianoroll_track/model.py
  3. 2
      noisicaa/builtin_nodes/pianoroll_track/track_ui.py
  4. 11
      noisicaa/ui/pianoroll.py
  5. 2
      noisicaa/ui/project_view.py
  6. 2
      noisicaa/value_types/midi_event.py
  7. 1
      noisidev/uitest.py

2
3rdparty/typeshed/PyQt5/QtWidgets.pyi vendored

@ -1029,11 +1029,11 @@ class QAction(QtCore.QObject):
class QActionGroup(QtCore.QObject):
triggered = ... # type: PYQT_SIGNAL
def __init__(self, parent: QtCore.QObject) -> None: ...
def hovered(self, a0: QAction) -> None: ...
def triggered(self, a0: QAction) -> None: ...
def setExclusive(self, a0: bool) -> None: ...
def setVisible(self, a0: bool) -> None: ...
def setDisabled(self, b: bool) -> None: ...

12
noisicaa/builtin_nodes/pianoroll_track/model.py

@ -160,9 +160,10 @@ class PianoRollTrackConnector(node_connector.NodeConnector):
class PianoRollEvent(_model.PianoRollEvent):
def create(self, *, midi_event: value_types.MidiEvent, **kwargs: Any) -> None:
def create(self, *, midi_event: value_types.MidiEvent = None, **kwargs: Any) -> None:
super().create(**kwargs)
assert midi_event is not None
self.midi_event = midi_event
@property
@ -255,9 +256,10 @@ class Interval(object):
class PianoRollSegment(_model.PianoRollSegment):
def create(self, *, duration: audioproc.MusicalDuration, **kwargs: Any) -> None:
def create(self, *, duration: audioproc.MusicalDuration = None, **kwargs: Any) -> None:
super().create(**kwargs)
assert duration is not None
self.duration = duration
def add_event(self, midi_event: value_types.MidiEvent) -> PianoRollEvent:
@ -300,13 +302,15 @@ class PianoRollSegment(_model.PianoRollSegment):
class PianoRollSegmentRef(_model.PianoRollSegmentRef):
def create(
self, *,
time: audioproc.MusicalTime,
segment: PianoRollSegment,
time: audioproc.MusicalTime = None,
segment: PianoRollSegment = None,
**kwargs: Any
) -> None:
super().create(**kwargs)
assert time is not None
self.time = time
assert segment is not None
self.segment = segment

2
noisicaa/builtin_nodes/pianoroll_track/track_ui.py

@ -744,7 +744,7 @@ class PianoRollTrackEditor(
label = QtWidgets.QLabel("Velocity")
font = QtGui.QFont(label.font())
font.setPointSize(font.pointSize() / 1.2)
font.setPointSizeF(font.pointSizeF() / 1.2)
label.setFont(font)
l = QtWidgets.QVBoxLayout()

11
noisicaa/ui/pianoroll.py

@ -1484,10 +1484,15 @@ class PianoRollGrid(slots.SlotContainer, QtWidgets.QWidget):
overlay_color = self.overlayColor()
if overlay_color.alpha() > 0:
edge_color = overlay_color
s_color = QtGui.QColor(255, 255, 255)
tl_color = edge_color.fromHsvF(edge_color.hueF(), 0.3 * edge_color.saturationF(), 0.5 + 0.5 * edge_color.valueF())
br_color = edge_color.fromHsvF(edge_color.hueF(), 0.3 * edge_color.saturationF(), 0.5 * edge_color.valueF())
tl_color = QtGui.QColor.fromHsvF(
overlay_color.hueF(),
0.3 * overlay_color.saturationF(),
0.5 + 0.5 * overlay_color.valueF())
br_color = QtGui.QColor.fromHsvF(
overlay_color.hueF(),
0.3 * overlay_color.saturationF(),
0.5 * overlay_color.valueF())
w = self.width()
h = self.height()

2
noisicaa/ui/project_view.py

@ -300,4 +300,4 @@ class ProjectView(ui_base.AbstractProjectView):
super().hideEvent(evt)
self.set_session_value(
self.__session_prefix + 'splitter-state', bytes(self.__splitter.saveState()))
self.__session_prefix + 'splitter-state', self.__splitter.saveState().data())

2
noisicaa/value_types/midi_event.py

@ -38,7 +38,7 @@ class MidiEvent(proto_value.ProtoValue):
self.__time.to_float(), ' '.join('%02x' % m for m in self.__midi))
__repr__ = __str__
def __hash__(self) -> str:
def __hash__(self) -> int:
return hash((self.__time, self.__midi))
def to_proto(self) -> 'audioproc.MidiEvent':

1
noisidev/uitest.py

@ -392,6 +392,7 @@ class UITestCase(unittest_mixins.ProcessManagerMixin, qttest.QtTestCase):
self.node_db_client = None
self.app = None
self.context = None
self.widget_under_test = None
async def setup_testcase(self):
self.hid_state = HIDState()

Loading…
Cancel
Save