Skip to content

Commit

Permalink
Refactored by Sourcery (#338)
Browse files Browse the repository at this point in the history
Co-authored-by: Sourcery AI <bot@sourcery.ai>
  • Loading branch information
sourcery-ai[bot] and sourcery-ai-bot committed Jun 2, 2020
1 parent 61cfbba commit e32e8a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gaphor/UML/tests/test_uml2.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,4 @@ def test_operation_parameter_deletion(factory):

c.unlink()

assert 0 == len(factory.lselect()), factory.lselect()
assert len(factory.lselect()) == 0, factory.lselect()
6 changes: 2 additions & 4 deletions gaphor/ui/diagrampage.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ def delete_selected_items(self):

@action(name="diagram.select-tool", state="toolbox-pointer")
def select_tool(self, tool_name: str):
tool = TransactionalToolChain(self.event_manager)
if self.view:
tool = TransactionalToolChain(self.event_manager)
tool.append(self.get_tool(tool_name))
self.view.tool = tool
icon_name = self.get_tool_icon_name(tool_name)
Expand Down Expand Up @@ -347,9 +347,7 @@ def confirm_deletion_of_items(self, last_in_model):
dialog.set_transient_for(self.widget.get_toplevel())
value = dialog.run()
dialog.destroy()
if value == Gtk.ResponseType.YES:
return True
return False
return value == Gtk.ResponseType.YES

def _on_key_press_event(self, view, event):
"""
Expand Down

0 comments on commit e32e8a9

Please sign in to comment.