Keep a remote listing and an office listing two roles in the per-place fold, since the kept role takes a copy's places and not its remote and the fetch gate then rejected the one behind the other
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f774b5147
commit
b4774f1da9
3 files changed
+31
-7
No files matched your search
+13
-4
@@ -82,6 +82,8 @@ class Copy:
|
||||
text: str = ""
|
||||
#: The link that opens this row on its host.
|
||||
url: str = ""
|
||||
#: Whether the row is a remote role (`roles.remote` is 'remote').
|
||||
remote: bool = False
|
||||
|
||||
|
||||
def _country(c: Copy) -> str:
|
||||
@@ -191,9 +193,15 @@ def fold(rows: Iterable[Copy]) -> Folded:
|
||||
|
||||
Within a `(company_key, title_key)` the kept rows of `assign` are grouped
|
||||
again, in `keep_order`: a row joins the first group whose members are all
|
||||
of its host and `similar` to it. Only a row with a link can be folded, as
|
||||
its link is what the kept role keeps. Every row of a merged group points
|
||||
at its first row, the rows that pointed at a folded one included."""
|
||||
of its host, `similar` to it and remote as it is or not. Only a row with
|
||||
a link can be folded, as its link is what the kept role keeps. Every row
|
||||
of a merged group points at its first row, the rows that pointed at a
|
||||
folded one included.
|
||||
|
||||
A remote listing and an office listing stay two roles: the kept role
|
||||
takes a copy's places and not its remote, so the fetch gate, which reads
|
||||
a remote role by its area, would reject the remote listing with an
|
||||
office role elsewhere, and the office one with a remote role elsewhere."""
|
||||
rows = list(rows)
|
||||
result = assign(rows)
|
||||
by_uid = {r.uid: r for r in rows}
|
||||
@@ -207,7 +215,8 @@ def fold(rows: Iterable[Copy]) -> Folded:
|
||||
groups: list[list[Copy]] = []
|
||||
for row in sorted(part, key=keep_order):
|
||||
for group in groups:
|
||||
if all(m.host == row.host and similar(m.text, row.text) for m in group):
|
||||
if all(m.host == row.host and m.remote == row.remote
|
||||
and similar(m.text, row.text) for m in group):
|
||||
group.append(row)
|
||||
break
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user