Sort the by-hand list by the Watchlist's careers_opened_at and print the watch rating
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a2689e08d
commit
161e89c955
3 files changed
+28
-20
No files matched your search
+11
-7
@@ -409,12 +409,14 @@ def edit_company(store: Store, args: argparse.Namespace) -> int:
|
||||
|
||||
|
||||
def company_checked(store: Store, key: str) -> int:
|
||||
"""`app companies checked acme`: its careers page was looked at just now."""
|
||||
"""`app companies checked acme`: its careers page was looked at just now,
|
||||
which the Watchlist keeps as `careers_opened_at`, the same stamp opening
|
||||
the page from there sets."""
|
||||
if store.company(key) is None:
|
||||
print(f"companies checked: no company {key!r}", file=sys.stderr)
|
||||
return 1
|
||||
company = store.update_company(key, checked_at=store.now())
|
||||
print(json.dumps({"key": key, "checked_at": company.checked_at}))
|
||||
company = store.update_company(key, careers_opened_at=store.now())
|
||||
print(json.dumps({"key": key, "careers_opened_at": company.careers_opened_at}))
|
||||
return 0
|
||||
|
||||
|
||||
@@ -437,14 +439,16 @@ def remove_company(store: Store, key: str) -> int:
|
||||
|
||||
def list_by_hand(store: Store) -> int:
|
||||
"""`app companies by-hand`: the companies with no board shown that are not
|
||||
known from a search only, one line each, never checked first and then the
|
||||
longest ago, as the Sources page lists them; see `jobs.sources.by_hand`."""
|
||||
known from a search only, one line each, never opened first and then the
|
||||
longest ago; `watch` is the Watchlist's rating, yes, no or a dash for
|
||||
unrated. See `jobs.sources.by_hand`."""
|
||||
from app import jobs
|
||||
|
||||
rows = jobs.sources.by_hand(store)
|
||||
for c in rows:
|
||||
checked = c.checked_at[:10] or "never"
|
||||
print(f"{c.name:30} {c.hand_reason or '-':8} {checked:10} {c.careers_url}")
|
||||
watch = "-" if c.watch is None else "yes" if c.watch else "no"
|
||||
opened = c.careers_opened_at[:10] or "never"
|
||||
print(f"{c.name:30} {c.hand_reason or '-':8} {watch:4} {opened:10} {c.careers_url}")
|
||||
print(f"{len(rows)} by hand")
|
||||
return 0
|
||||
|
||||
|
||||
+3
-3
@@ -169,13 +169,13 @@ def known_from_search_only(company: Company, ever_boarded: set[str]) -> bool:
|
||||
|
||||
def by_hand(store: Store) -> list[Company]:
|
||||
"""The list checked by hand: companies with no board shown that are not
|
||||
known from a search only. Never checked first, then the longest ago; the
|
||||
name breaks a tie."""
|
||||
known from a search only. Never opened first, then the longest ago
|
||||
(`careers_opened_at`, the Watchlist's stamp); the name breaks a tie."""
|
||||
boards = store.company_boards()
|
||||
ever_boarded = {company_key(s.company) for s in store.subscriptions(source="ats")}
|
||||
rows = [c for c in store.companies()
|
||||
if c.key not in boards and not known_from_search_only(c, ever_boarded)]
|
||||
return sorted(rows, key=lambda c: (c.checked_at, c.name.casefold()))
|
||||
return sorted(rows, key=lambda c: (c.careers_opened_at, c.name.casefold()))
|
||||
|
||||
|
||||
class Conflict(ValueError):
|
||||
|
||||
Reference in new issue
Block a user