geminispace.info

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/geminispace.info.git
Log | Files | Refs | README | LICENSE

commit 6adbcc2b60e7d7f84540b8b7e5064c54d3042ed1
parent 6218770a47f53c2a6a23f0ed28c452a2fa8ff67b
Author: Natalie Pendragon <natpen@natpen.net>
Date:   Sun, 24 May 2020 23:00:23 -0400

Rename fully_qualified_massaged_url to indexable_url

Diffstat:
Mgus/crawl.py | 6+++---
Mgus/lib/gemini.py | 16++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/gus/crawl.py b/gus/crawl.py @@ -151,7 +151,7 @@ def index_binary(resource, response): index_writer = index_storage.open_index().writer() try: index_writer.add_document( - url=resource.fully_qualified_massaged_url, + url=resource.indexable_url, domain=resource.normalized_host, content_type=response.content_type, indexed_at=datetime.utcnow(), @@ -166,7 +166,7 @@ def index_prompt(resource, response): index_writer = index_storage.open_index().writer() try: index_writer.add_document( - url=resource.fully_qualified_massaged_url, + url=resource.indexable_url, domain=resource.normalized_host, content_type="input", prompt=response.prompt, @@ -182,7 +182,7 @@ def index_content(resource, response): index_writer = index_storage.open_index().writer() try: index_writer.add_document( - url=resource.fully_qualified_massaged_url, + url=resource.indexable_url, domain=resource.normalized_host, content_type=response.content_type, content=response.content, diff --git a/gus/lib/gemini.py b/gus/lib/gemini.py @@ -46,7 +46,7 @@ class GeminiResource(): self._normalized_url = None self._normalized_host = None self._fully_qualified_url = None - self._fully_qualified_massaged_url = None + self._indexable_url = None self.contained_resources = None def urlsplit_featureful(url, fully_qualified_parent_url=None, parent_hostname=None): @@ -128,20 +128,20 @@ class GeminiResource(): return self._fully_qualified_url - def _get_fully_qualified_massaged_url(self): + def _get_indexable_url(self): if not self.is_valid: return None - if self._fully_qualified_massaged_url is None: - fully_qualified_massaged_url = self.fully_qualified_url + if self._indexable_url is None: + indexable_url = self.fully_qualified_url if self.urlsplit.port == 1965: - fully_qualified_massaged_url = self.normalized_url.replace(self.urlsplit.hostname.lower() + ":1965", self.urlsplit.hostname.lower(), 1) - self._fully_qualified_massaged_url = fully_qualified_massaged_url - return self._fully_qualified_massaged_url + indexable_url = self.normalized_url.replace(self.urlsplit.hostname.lower() + ":1965", self.urlsplit.hostname.lower(), 1) + self._indexable_url = indexable_url + return self._indexable_url normalized_url = property(_get_normalized_url) normalized_host = property(_get_normalized_host) fully_qualified_url = property(_get_fully_qualified_url) - fully_qualified_massaged_url = property(_get_fully_qualified_massaged_url) + indexable_url = property(_get_indexable_url) def fetch(self): # NB: this intentionally does NOT fetch the normalized URL, because that could