Merge pull request #151 from nyanpasu64/cleanup

Cleanup code
pull/357/head
nyanpasu64 2019-01-21 22:56:53 -08:00 zatwierdzone przez GitHub
commit ec0177f96a
6 zmienionych plików z 17 dodań i 15 usunięć

Wyświetl plik

@ -2,5 +2,17 @@
<code_scheme name="Project" version="173">
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="RIGHT_MARGIN" value="88" />
<Python>
<option name="NEW_LINE_AFTER_COLON" value="true" />
<option name="FROM_IMPORT_NEW_LINE_AFTER_LEFT_PARENTHESIS" value="true" />
<option name="FROM_IMPORT_NEW_LINE_BEFORE_RIGHT_PARENTHESIS" value="true" />
<option name="FROM_IMPORT_PARENTHESES_FORCE_IF_MULTILINE" value="true" />
<option name="FROM_IMPORT_TRAILING_COMMA_IF_MULTILINE" value="true" />
</Python>
<codeStyleSettings language="Python">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

Wyświetl plik

@ -1,6 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

Wyświetl plik

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import time
import warnings
from contextlib import ExitStack, contextmanager
from enum import unique, IntEnum
from fractions import Fraction
@ -12,16 +11,9 @@ import attr
from corrscope import outputs as outputs_
from corrscope.channel import Channel, ChannelConfig
from corrscope.config import (
KeywordAttrs,
register_enum,
Ignored,
CorrError,
CorrWarning,
)
from corrscope.renderer import MatplotlibRenderer, RendererConfig
from corrscope.config import KeywordAttrs, register_enum, CorrError
from corrscope.layout import LayoutConfig
from corrscope.renderer import MatplotlibRenderer, RendererConfig
from corrscope.triggers import ITriggerConfig, CorrelationTriggerConfig, PerFrameCache
from corrscope.util import pushd, coalesce
from corrscope.wave import Wave

Wyświetl plik

@ -7,7 +7,7 @@ from PyQt5.QtCore import pyqtSlot
from PyQt5.QtGui import QPalette, QColor
from PyQt5.QtWidgets import QWidget
from corrscope.config import CorrError
from corrscope.config import CorrError, DumpableAttrs
from corrscope.triggers import lerp
from corrscope.util import obj_name, perr
@ -18,7 +18,6 @@ __all__ = ["PresentationModel", "map_gui", "behead", "rgetattr", "rsetattr"]
WidgetUpdater = Callable[[], None]
Attrs = Any
class PresentationModel(qc.QObject):
@ -35,7 +34,7 @@ class PresentationModel(qc.QObject):
combo_text: Dict[str, List[str]]
edited = qc.pyqtSignal()
def __init__(self, cfg: Attrs):
def __init__(self, cfg: DumpableAttrs):
super().__init__()
self.cfg = cfg
self.update_widget: Dict[str, WidgetUpdater] = {}
@ -58,7 +57,7 @@ class PresentationModel(qc.QObject):
else:
raise AttributeError(f"cannot set attribute {key} on {obj_name(self)}()")
def set_cfg(self, cfg: Attrs):
def set_cfg(self, cfg: DumpableAttrs):
self.cfg = cfg
for updater in self.update_widget.values():
updater()

Wyświetl plik