sjrct's route implementation#105
Closed
sjrct wants to merge 2 commits into
Closed
Conversation
This flavor uses the '@' prefix to mark what is an is not a container or alias (an intermediary destination).
As without any routes declared nothing will be routed anywhere (different behavoir from before), add_route needs to be called explicitly in some places. Also, need to have config on a instance rather than class basis so routes do not bleed from one test case into another.
Contributor
|
I pushed my (unfinished) branch to |
Contributor
|
Notes from meeting: implement special case container |
Contributor
|
Suggestion for the def route(self, source, resolve_all=False):
for d in self.config.get('routes', []):
dest = []
# Find all matching patterns of the same precedence level
meep = [p for p in d if re.match(p, source)]
if not meep:
continue
for pat in meep:
raw = d[pat] if type(d[pat]) == list else [ d[pat] ]
for ri in raw:
name = ri.split('/')[0]
if ri.startswith('@') and (resolve_all or not name in self.objects):
# Resolve aliases
dest.extend(self.route(ri))
else:
dest.append(ri)
return dest
return [] |
Member
Author
|
there is no way this is ever getting merged |
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.
This is a potential implementation. there are other options that are being discussed.
This flavor uses the '@' prefix to mark what is an is not a container or alias (an intermediary destination).
Example of routes key: