Skip to content

Commit 31ac57c

Browse files
committed
Format code with black
1 parent e94349a commit 31ac57c

19 files changed

Lines changed: 25 additions & 40 deletions

bookmark_checker/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
__version__ = "1.0.0"
44
__date__ = "2025-08-29"
5-

bookmark_checker/__main__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44

55
if __name__ == "__main__":
66
main()
7-

bookmark_checker/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,3 @@ def main() -> None:
8888

8989
if __name__ == "__main__":
9090
main()
91-

bookmark_checker/core/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Core bookmark processing modules."""
2-

bookmark_checker/core/dedupe.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,3 @@ def group_duplicates(
137137
report.sort(key=lambda x: (-x["count"], x["title"].lower()))
138138

139139
return dict(grouped), report
140-

bookmark_checker/core/exporters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,3 @@ def export_dedupe_report_csv(report: list[dict[str, Any]], path: str) -> None:
117117
"sources": " | ".join(item["sources"]),
118118
}
119119
)
120-

bookmark_checker/core/merge.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,3 @@ def merge_collections(
6565
merged.add(merged_bookmark)
6666

6767
return merged, report
68-

bookmark_checker/core/models.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ def __eq__(self, other: object) -> bool:
2525
"""Equality based on canonical URL and title."""
2626
if not isinstance(other, Bookmark):
2727
return False
28-
return (
29-
(self.canonical_url or self.url) == (other.canonical_url or other.url)
30-
and self.title == other.title
31-
)
28+
return (self.canonical_url or self.url) == (
29+
other.canonical_url or other.url
30+
) and self.title == other.title
3231

3332

3433
class BookmarkCollection:
@@ -57,4 +56,3 @@ def __len__(self) -> int:
5756
def __iter__(self):
5857
"""Iterate over bookmarks."""
5958
return iter(self.bookmarks)
60-

bookmark_checker/core/parsers.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ def get_folder_path_for_element(element: Any) -> str:
6262
"""Get folder path by finding all parent DLs and their associated H3 folders."""
6363
path_parts = []
6464
current_dl = element.find_parent("dl")
65-
65+
6666
# Walk up the tree through all parent DLs
6767
visited_dls = set()
6868
while current_dl:
6969
if current_dl in visited_dls:
7070
break
7171
visited_dls.add(current_dl)
72-
72+
7373
# Find the H3 that is associated with this DL
7474
# The H3 can be:
7575
# 1. A direct previous sibling of the DL
7676
# 2. Inside a DT that is a previous sibling of the DL
7777
# 3. Inside a DT that is a child of the parent DL
78-
78+
7979
folder_name = None
80-
80+
8181
# Method 1: Check if H3 is a direct previous sibling
8282
for prev_sib in current_dl.previous_siblings:
8383
if not hasattr(prev_sib, "name"):
@@ -91,7 +91,7 @@ def get_folder_path_for_element(element: Any) -> str:
9191
if h3 and hasattr(h3, "get_text"):
9292
folder_name = h3.get_text(strip=True)
9393
break
94-
94+
9595
# Method 3: Check parent DL's children for DT with H3 before this DL
9696
if not folder_name and current_dl.parent:
9797
parent = current_dl.parent
@@ -120,25 +120,25 @@ def get_folder_path_for_element(element: Any) -> str:
120120
break
121121
if folder_name:
122122
break
123-
123+
124124
if folder_name:
125125
path_parts.insert(0, folder_name)
126-
126+
127127
# Move to parent DL
128128
current_dl = current_dl.find_parent("dl")
129-
129+
130130
return "/".join(path_parts)
131131

132132
# Find all bookmark links (A tags)
133133
all_links = soup.find_all("a", href=True)
134-
134+
135135
for link in all_links:
136136
url = link.get("href", "").strip()
137137
if not url or url.startswith("data:"):
138138
continue
139-
139+
140140
title = link.get_text(strip=True) or url
141-
141+
142142
# Parse ADD_DATE if present
143143
added = None
144144
add_date = link.get("add_date")
@@ -148,10 +148,10 @@ def get_folder_path_for_element(element: Any) -> str:
148148
added = datetime.fromtimestamp(timestamp)
149149
except (ValueError, OSError):
150150
pass
151-
151+
152152
# Get folder path
153153
folder_path = get_folder_path_for_element(link)
154-
154+
155155
bookmark = Bookmark(
156156
url=url,
157157
title=title,
@@ -227,4 +227,3 @@ def parse_node(node: dict[str, Any], folder_path: str = "") -> None:
227227
parse_node(roots[root_key], root_key.replace("_", " ").title())
228228

229229
return collection
230-

bookmark_checker/core/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,3 @@ def domain_from_url(url: str) -> str:
106106
return netloc
107107
except Exception:
108108
return ""
109-

0 commit comments

Comments
 (0)