-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shortcuts expansion can fail with Python version #46
Comments
As far as I can tell, the issue is that short cut expansion happens after splitting into endpoints at
will be expanded to the endpoints
In the example provided in this issue, however,
which results in a single, mal-formed endpoint
Now this raises the following questions about the order of shortcut expansion and splitting into endpoints:
I do not have a strong opinion on (1) or (2) but I think we should give it some thought and then decide either way. I personally would like to rule out (3) because it will probably be very confusing and likely cause more harm than good. |
I have a simple solution that would be a fourth solution: diff --git a/jgo/jgo.py b/jgo/jgo.py
index 0adae45..5ea9ee1 100644
--- a/jgo/jgo.py
+++ b/jgo/jgo.py
@@ -368,7 +368,7 @@ def split_endpoint_string(endpoint_string):
def endpoints_from_strings(endpoint_strings, shortcuts={}):
_logger.debug('Creating endpoints from strings %s with shortcuts %s', endpoint_strings, shortcuts)
- return [Endpoint.parse_endpoint(expand_coordinate(ep, shortcuts=shortcuts)) for ep in endpoint_strings]
+ return [Endpoint.parse_endpoint(ep2) for ep in endpoint_strings for ep2 in expand_coordinate(ep, shortcuts=shortcuts).split('+')]
def coordinates_from_endpoints(endpoints):
return [ep.get_coordinates() for ep in endpoints] In this case, expanded shortcuts would be split again:
I still have to get a better intuition. Let me know what you think @ctrueden |
Maybe an issue with shortcut containing concatenated endpoints?
Create the following
.jgorc
:Then try launching it:
The text was updated successfully, but these errors were encountered: