Skip to content

Commit

Permalink
Fix some code that ruff thought was bad...
Browse files Browse the repository at this point in the history
Thank you ruff!
  • Loading branch information
freand76 committed Oct 4, 2024
1 parent aed5b37 commit eed6cbd
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/digsim/app/settings/_component_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,17 @@ def _setup_dialog(self, parameters):
widget = ComponentSettingsCheckBoxWidthBool(
self, parameter, parameter_dict, self._settings
)
elif parameter_dict["type"] == int:
elif parameter_dict["type"] == "int":
widget = ComponentSettingsSlider(self, parameter, parameter_dict, self._settings)
elif parameter_dict["type"] == str:
elif parameter_dict["type"] == "str":
single_line = parameter_dict.get("single_line", False)
if single_line:
widget = ComponentSettingSingleLineText(
self, parameter, parameter_dict, self._settings
)
else:
widget = ComponentSettingText(self, parameter, parameter_dict, self._settings)
elif parameter_dict["type"] == bool:
elif parameter_dict["type"] == "bool":
widget = ComponentSettingsCheckBox(self, parameter, parameter_dict, self._settings)
elif parameter_dict["type"] == "intrange":
widget = ComponentSettingsIntRangeSlider(
Expand All @@ -382,7 +382,7 @@ def _setup_dialog(self, parameters):
widget = ComponentSettingsNameSelector(
self, parameter, parameter_dict, self._settings
)
elif parameter_dict["type"] == list:
elif parameter_dict["type"] == "list":
widget = ComponentSettingsListSelector(
self, parameter, parameter_dict, self._settings
)
Expand Down
4 changes: 2 additions & 2 deletions src/digsim/circuit/components/_bus_bits.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, circuit, name=None, width=1, enable=None):
def get_parameters(cls):
return {
"width": {
"type": int,
"type": "int",
"min": 2,
"max": 32,
"default": 2,
Expand Down Expand Up @@ -59,7 +59,7 @@ def __init__(self, circuit, name=None, width=1):
def get_parameters(cls):
return {
"width": {
"type": int,
"type": "int",
"min": 2,
"max": 32,
"default": 2,
Expand Down
2 changes: 1 addition & 1 deletion src/digsim/circuit/components/_buzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def tone_frequency(self):
def get_parameters(cls):
return {
"tone": {
"type": list,
"type": "list",
"items": ["A", "B", "C", "D", "E", "F", "G"],
"default": "A",
"description": "Buzzer tone",
Expand Down
2 changes: 1 addition & 1 deletion src/digsim/circuit/components/_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def active(self):
def get_parameters(cls):
return {
"frequency": {
"type": int,
"type": "int",
"min": 1,
"max": 50,
"default": 1,
Expand Down
2 changes: 1 addition & 1 deletion src/digsim/circuit/components/_dip_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def has_action(self):
def get_parameters(cls):
return {
"bits": {
"type": int,
"type": "int",
"min": 2,
"max": 8,
"default": 8,
Expand Down
10 changes: 5 additions & 5 deletions src/digsim/circuit/components/_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, circuit, name, ports):
def get_parameters(cls):
return {
"ports": {
"type": int,
"type": "int",
"min": 2,
"max": 8,
"default": 2,
Expand Down Expand Up @@ -161,17 +161,17 @@ def update(self):
def get_parameters(cls):
return {
"async_reset": {
"type": bool,
"type": "bool",
"default": False,
"description": "Use asynchronous reset",
},
"clock_enable": {
"type": bool,
"type": "bool",
"default": False,
"description": "Use clock enable",
},
"width": {
"type": int,
"type": "int",
"min": 1,
"max": 32,
"default": 1,
Expand Down Expand Up @@ -215,7 +215,7 @@ def get_parameters(cls):
"description": "Number of input ports",
},
"width": {
"type": int,
"type": "int",
"min": 1,
"max": 32,
"default": 1,
Expand Down
4 changes: 2 additions & 2 deletions src/digsim/circuit/components/_hexdigit.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def segments(self, digit_id=0):
def get_parameters(cls):
return {
"digits": {
"type": int,
"type": "int",
"min": 1,
"max": 8,
"default": 1,
"description": "Number of digits",
},
"dot": {
"type": bool,
"type": "bool",
"default": False,
"description": "Use decimal dot",
},
Expand Down
6 changes: 3 additions & 3 deletions src/digsim/circuit/components/_label_wire.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ def get_parameters(cls):

return {
"label": {
"type": str,
"type": "str",
"single_line": True,
"default": "WireLabel",
"description": "Label name",
"invalid_list": label_list,
},
"width": {
"type": int,
"type": "int",
"min": 1,
"max": 32,
"default": 1,
Expand Down Expand Up @@ -160,7 +160,7 @@ def get_parameters(cls):

return {
"label": {
"type": list,
"type": "list",
"items": label_list,
"description": "Select label",
}
Expand Down
2 changes: 1 addition & 1 deletion src/digsim/circuit/components/_logic_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def signal_data(self):
def get_parameters(cls):
return {
"sample_rate": {
"type": int,
"type": "int",
"min": 10,
"max": 100,
"default": 20,
Expand Down
2 changes: 1 addition & 1 deletion src/digsim/circuit/components/_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, circuit, name=None, text=""):
def get_parameters(cls):
return {
"text": {
"type": str,
"type": "str",
"default": "Write something here...",
"description": "Note text",
"reconfigurable": True,
Expand Down
2 changes: 1 addition & 1 deletion src/digsim/circuit/components/_static_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_parameters(cls):
"reconfigurable": True,
},
"width": {
"type": int,
"type": "int",
"min": 1,
"max": 16,
"default": 1,
Expand Down

0 comments on commit eed6cbd

Please sign in to comment.