Skip to content
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

Add the ability to deal with remote ecore URI #4

Merged
merged 2 commits into from
Jun 7, 2017
Merged

Conversation

aranega
Copy link
Member

@aranega aranega commented Jun 7, 2017

This commit introduce a kind of switch that give the ability to fetch .ecore/.xmi files from a remote URI. This does not implies modifications to the pyecoregen CLI options.

When a remote URI is discovered (i.e, that begins with http(s)://, the URI implementation is simply changed from URI to HttpURI from pyecore.resources.resource.

This commit introduce a kind of switch that give the ability to fetch
.ecore/.xmi files from a remote URI. This does not implies
modifications to the pyecoregen CLI options. When a remote URI is
discovered (i.e, that begins with 'http(s)://', the URI implementation
is simply changed from the URI to HttpURI from pyecore.
@coveralls
Copy link

coveralls commented Jun 7, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling b5b4b16 on feature/http_uri into 12c718e on master.

@@ -53,10 +54,19 @@ def configure_logging(parsed_args):
)


def select_uri_implementation(ecore_model_path):
"""Select the right URI implementation regarding the Ecore model path schema."""
url_pattern = re.compile('^http(s)?://.*')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor: I suggest to make this a module level constant URL_PATTERN, so the compilation will happen only once during import.

Feel free to merge yourself, since I am offline for the rest of the day.

Thanks for leeting me know about the change,
Mike

@coveralls
Copy link

coveralls commented Jun 7, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling f9dc5ff on feature/http_uri into 12c718e on master.

@aranega
Copy link
Member Author

aranega commented Jun 7, 2017

I modified the commit as requested. I wasn't sure to put the pattern compilation as global var as the cli.py is used as 'one-shot'.

Also, I only add the PR for later (later later) review, you don't need to review it right away ;), this can totally wait until you go back from your vacations of course.

@aranega aranega merged commit 82364eb into master Jun 7, 2017
@aranega aranega deleted the feature/http_uri branch August 25, 2017 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants