Repository navigation
refactor: take the file controllers from opensemantic.core - #214
Open
simontaurus wants to merge 8 commits into
Open
simontaurus wants to merge 8 commits into
simontaurus wants to merge 8 commits into
Conversation
- base, local, memory and remote now wrap the implementations that moved to core, which owns the file models - LocalFileController keeps the path argument and filename-derived label - WikiFileController rebases on core's RemoteFileController - the session became optional and connects on first use from the credential registered for download_url or access_url - the package imports its modules, so the controllers register and a file entity resolves to one without importing it by name
- _ensure_session falls back to the registered credential, so an upload (which has no URL yet) can use the lazy session at all - from_other keeps a session the source carries instead of writing None - sessions are cached per credential, not per host, and a replaced credential replaces the session - LocalFileController without a file fails at construction, as the controller it replaces did - pin opensemantic.core to the branch carrying the file controllers
- a credential registered as host/path no longer becomes the WtSite iri, which built an API endpoint that does not exist - the cache is keyed by (host, credential), so one credential matching several subdomains does not serve them all the same session - pin oold to the branch carrying registered_credentials() - tests inspect the config the session is built from
Core renamed its path property to resolve_path(), because a property named like a model field wins over the field and makes its value unreadable - osw.express.FileResult declares exactly such a field. With path declared here instead, dict()["path"] and __fields__["path"] work again and the two names always name the same file.
Contributor
Release previewNo version bump from the current commits (stays at Changelog preview (truncated)Preview via python-semantic-release and conventional commits. |
Every characteristic branches off the Characteristic category, and the schema marks the link required - which oold enforces since the descriptor binding.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The file controllers moved to
opensemantic.core, which owns the file models.This package keeps the import paths and the wiki implementation.
base,local,memoryandremotewrap the implementations in core.WikiFileControllerrebases on core'sRemoteFileControllerand registersitself, so a file entity resolves to it through
get_file_controllerwithoutbeing imported by name.
uploaded has no URL yet, so the wiki is found from the credential registered
in
oold.backend.authwhen there is no URL to go by, and the error names theambiguity when several are registered.
different paths of one wiki are two logins, and one credential matching
several subdomains does not serve them all the same session. A replaced
credential replaces the session instead of being ignored for the lifetime of
the process.
from_otherkeeps a session the source already carries.LocalFileControllerkeepspathas a field in step with the model'slocal_path, sodict()["path"]and__fields__["path"]work as before.Core exposes the derived path as
resolve_path(): a property named like amodel field wins over that field in attribute lookup, which is exactly what
FileResult.pathruns into.tests/test_wiki_file_session.pycovers how the session is found and cached.Needs the file controllers from opensemantic.core, merged but not yet released,
so that dependency is pinned to its
mainuntil a version tag is cut.