Rename plugins/atshosts to plugins/readers
Every import, test and live doc follows the new path; behaviour is unchanged. tests/test_atshosts.py becomes tests/test_readers.py. plan-readers.md and review-ingest.md keep the old name, since they describe the state before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
af337ef558
commit
73dec9028e
48 files changed
+104
-104
No files matched your search
@@ -5,7 +5,7 @@ The seed list and the LinkedIn flow both start from a company name and a
|
||||
website, not from a board. This module gets from the one to the other: it
|
||||
fetches the site's careers page, or the pages the home page links to as
|
||||
careers, and looks for a link into one of the hosts in `HOSTS`. A readable
|
||||
host (one with a module in `plugins/atshosts/`, which the `ats` plugin
|
||||
host (one with a module in `plugins/readers/`, which the `ats` plugin
|
||||
parses) becomes a `board` target the pull can read; any other host is
|
||||
recorded as `ats`, with its slug where the URL carries one, so the company is
|
||||
kept as one the app cannot read yet rather than dropped. The patterns and
|
||||
@@ -48,7 +48,7 @@ from urllib.parse import urljoin
|
||||
import httpx
|
||||
|
||||
from desk.sources import USER_AGENT
|
||||
from plugins import atshosts
|
||||
from plugins import readers
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -58,7 +58,7 @@ MAX_BYTES = 2 << 20
|
||||
MAX_PAGES = 6
|
||||
|
||||
#: The hosts the `ats` plugin parses; a match on one of these is a `board`.
|
||||
READABLE: tuple[str, ...] = tuple(atshosts.HOSTS)
|
||||
READABLE: tuple[str, ...] = tuple(readers.HOSTS)
|
||||
|
||||
#: host -> pattern over a URL, for the hosts discovery names but the app
|
||||
#: cannot read. Group 1, where there is one, is the slug the host names the
|
||||
@@ -104,14 +104,14 @@ def _hosts(modules: Mapping[str, ModuleType],
|
||||
#: host -> pattern over a URL, every host discovery can name. The slug is
|
||||
#: group 1, or, for a pattern with more groups, the groups that matched
|
||||
#: joined by "/" (Lever's `eu/<site>`).
|
||||
HOSTS: tuple[tuple[str, re.Pattern[str]], ...] = _hosts(atshosts.HOSTS, _UNREADABLE)
|
||||
HOSTS: tuple[tuple[str, re.Pattern[str]], ...] = _hosts(readers.HOSTS, _UNREADABLE)
|
||||
|
||||
#: The hosts whose slugs keep the case the URL wrote them in, by their
|
||||
#: module's `KEEP_CASE`: a Workday site is `LEGO_External`, and both its
|
||||
#: listing and its robots.txt paths are case-sensitive. Every other slug is
|
||||
#: lowercased, which is how a page that writes `BoschGroup` and one that
|
||||
#: writes `boschgroup` name one board.
|
||||
_KEEP_CASE = frozenset(name for name, module in atshosts.HOSTS.items()
|
||||
_KEEP_CASE = frozenset(name for name, module in readers.HOSTS.items()
|
||||
if getattr(module, "KEEP_CASE", False))
|
||||
|
||||
#: What a Teamtailor feed carries and a page that only looks like one does not:
|
||||
@@ -257,14 +257,14 @@ def fetch_page(client: httpx.Client, url: str) -> tuple[str, str]:
|
||||
#: rate limit that a run of guesses trips, and a Workable site links its
|
||||
#: board plainly anyway.
|
||||
_PROBES: dict[str, Callable[[str], str]] = {
|
||||
name: module.probe_url for name, module in atshosts.HOSTS.items()
|
||||
name: module.probe_url for name, module in readers.HOSTS.items()
|
||||
if hasattr(module, "probe_url")}
|
||||
|
||||
|
||||
def _probe_slugs(host: str, guess: str) -> tuple[str, ...]:
|
||||
"""The slugs a guessed name is probed as on `host`: the name itself, and
|
||||
for Lever the name on its EU instance too (the module's `probe_slugs`)."""
|
||||
module = atshosts.HOSTS[host]
|
||||
module = readers.HOSTS[host]
|
||||
return module.probe_slugs(guess) if hasattr(module, "probe_slugs") else (guess,)
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ def probe(client: httpx.Client, host: str, slug: str) -> bool:
|
||||
return False
|
||||
if not response.is_success:
|
||||
return False
|
||||
module = atshosts.HOSTS[host]
|
||||
module = readers.HOSTS[host]
|
||||
return module.probe_ok(response.content) if hasattr(module, "probe_ok") else True
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -663,7 +663,7 @@ HAND_REASONS: tuple[str, ...] = get_args(HandReason)
|
||||
#: read as when a role was posted, checked against live boards on
|
||||
#: 2026-09-29:
|
||||
#:
|
||||
#: - `greenhouse`: `plugins.atshosts.greenhouse.parse` already prefers
|
||||
#: - `greenhouse`: `plugins.readers.greenhouse.parse` already prefers
|
||||
#: `first_published` over `updated_at`. A live board (adyen) showed a job
|
||||
#: with `first_published` five months before `updated_at`, proving the
|
||||
#: first stays fixed while the second moves on an edit — the resettable
|
||||
|
||||
Reference in new issue
Block a user