Skip to content

Commit

Permalink
Formatting fixes by black and removed rouge single quote
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin-St committed Jan 16, 2024
1 parent 94b53a2 commit 987a839
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doorstop/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def run_remove(args, cwd, _, catch=True):
with utilities.capture(catch=catch) as success:
# get the item
tree = _get_tree(args, cwd)
item = tree.find_item(args.uid,only_active=False)
item = tree.find_item(args.uid, only_active=False)

# delete it
item.delete()
Expand Down
6 changes: 3 additions & 3 deletions doorstop/core/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ def find_document(prefix):
return document


def find_item(uid,only_active = True):
def find_item(uid, only_active=True):
"""Find an item without an explicitly building a tree.
:param uid: UID
:param only_active: Returns only active items
"""
tree = _get_tree()
item = tree.find_item(uid,only_active=only_active)
item = tree.find_item(uid, only_active=only_active)
return item


Expand Down
6 changes: 3 additions & 3 deletions doorstop/core/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def remove_item(self, value, reorder=True):
"""
uid = UID(value)
item = self.find_item(uid,only_active=False)
item = self.find_item(uid, only_active=False)
item.delete()
if reorder:
self.reorder()
Expand Down Expand Up @@ -780,7 +780,7 @@ def _items_by_level(items, keep=None):
for item in items_at_level:
yield level, item

def find_item(self, value, only_active = True, _kind=""):
def find_item(self, value, only_active=True, _kind=""):
"""Return an item by its UID.
:param value: item or UID
Expand All @@ -798,7 +798,7 @@ def find_item(self, value, only_active = True, _kind=""):
if item.active:
return item
else:
log.trace("item is inactive: {}".format(item)) # type: ignore'
log.trace("item is inactive: {}".format(item)) # type: ignore
if not only_active:
return item

Expand Down
2 changes: 1 addition & 1 deletion doorstop/core/tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_find_item(self, mock_find_item):
_clear_tree()
uid = "req1"
find_item(uid)
mock_find_item.assert_called_once_with(uid,only_active=True)
mock_find_item.assert_called_once_with(uid, only_active=True)

def test_tree_finds_documents(self):
"""Verify items can be found using a convenience function."""
Expand Down
4 changes: 2 additions & 2 deletions doorstop/core/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def remove_item(self, value, reorder=True):
uid = UID(value)
for document in self:
try:
document.find_item(uid,only_active=False)
document.find_item(uid, only_active=False)
except DoorstopError:
pass # item not found in that document
else:
Expand Down Expand Up @@ -445,7 +445,7 @@ def find_item(self, value, only_active=True, _kind=""):
except KeyError:
for document in self:
try:
item = document.find_item(uid, only_active=only_active,_kind=_kind)
item = document.find_item(uid, only_active=only_active, _kind=_kind)
except DoorstopError:
pass # item not found in that document
else:
Expand Down

0 comments on commit 987a839

Please sign in to comment.