-
Notifications
You must be signed in to change notification settings - Fork 8
Nasa Provider Plugin #40
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
Changes from all commits
6b391b5
28c8733
503b536
e0cd550
7c2f0f1
abec6a0
c858bb6
757a9dd
8dad40c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| from uuid import uuid4, UUID | ||
| import quest | ||
|
|
||
| the_providers = None | ||
|
|
||
| def generate_cache(update=False): | ||
| """Downloads features for all services and caches results. | ||
|
|
@@ -238,22 +239,27 @@ def load_drivers(namespace, names=None): | |
| return {name: driver.DriverManager(namespace, name, invoke_on_load='True') for name in names} | ||
|
|
||
|
|
||
| def load_providers(): | ||
| settings = get_settings() | ||
| def load_providers(update_cache=False): | ||
| global the_providers | ||
|
|
||
| # add web services | ||
| settings = get_settings() | ||
| web_services = list_drivers('services') | ||
| web_services.remove('user') | ||
|
|
||
| providers = {name: driver.DriverManager('quest.services', name, invoke_on_load=True, invoke_kwds={'name': name}).driver for name in web_services} | ||
| if update_cache or the_providers is None: | ||
| providers = {name: driver.DriverManager('quest.services', name, invoke_on_load=True, invoke_kwds={'name': name}).driver for name in web_services} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E501 line too long (153 > 120 characters) |
||
|
|
||
| if len(settings.get('USER_SERVICES', [])) > 0: | ||
| for uri in settings.get('USER_SERVICES', []): | ||
| try: | ||
| drv = driver.DriverManager('quest.services', 'user', invoke_on_load=True, invoke_kwds={'uri': uri}).driver | ||
| providers['user-' + drv.name] = drv | ||
| except Exception as e: | ||
| logger.error('Failed to load local service from %s, with exception: %s' % (uri, str(e))) | ||
| if len(settings.get('USER_SERVICES', [])) > 0: | ||
| for uri in settings.get('USER_SERVICES', []): | ||
| try: | ||
| drv = driver.DriverManager('quest.services', 'user', invoke_on_load=True, invoke_kwds={'uri': uri}).driver | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E501 line too long (126 > 120 characters) |
||
| providers['user-' + drv.name] = drv | ||
| except Exception as e: | ||
| logger.error('Failed to load local service from %s, with exception: %s' % (uri, str(e))) | ||
|
|
||
| the_providers = providers | ||
| else: | ||
| providers = the_providers | ||
|
|
||
| return providers | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,8 @@ | |
| """ | ||
|
|
||
| DOWNLOAD_OPTIONS_FROM_ALL_SERVICES = { | ||
| # 'svc://nasa:srtm-3-arc-second': {}, | ||
| # 'svc://nasa:srtm-30-arc-second': {}, | ||
| 'svc://nasa:srtm-3-arc-second': {}, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E121 continuation line under-indented for hanging indent |
||
| 'svc://nasa:srtm-30-arc-second': {}, | ||
| 'svc://noaa-ncdc:ghcn-daily': {'properties': [{'default': None, | ||
| 'description': 'parameter', | ||
| 'name': 'parameter', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (147 > 120 characters)