From 95623b0f7a3054d77f9bf0152a0213acf6b2dc51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Mercader?= Date: Tue, 29 Mar 2011 16:24:14 +0100 Subject: [PATCH] Set format as WMS if the harvested document refers to a service --- ckanext/harvest/controllers/harvesting.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ckanext/harvest/controllers/harvesting.py b/ckanext/harvest/controllers/harvesting.py index 1708298..272c5a6 100644 --- a/ckanext/harvest/controllers/harvesting.py +++ b/ckanext/harvest/controllers/harvesting.py @@ -42,6 +42,7 @@ def gen_new_name(title): while counter < 101: if name+str(counter) not in taken: return name+str(counter) + counter = counter + 1 return None class HarvestingJobController(object): @@ -192,11 +193,13 @@ class HarvestingJobController(object): package_data['name'] = name resource_locator = gemini_values.get('resource-locator', []) and gemini_values['resource-locator'][0].get('url') or '' if resource_locator: + # TODO: Are we sure that all services are WMS? + _format = 'WMS' if extras['resource-type'] == 'service' else 'Unverified' package_data['resources'] = [ { 'url': resource_locator, 'description': 'Resource locator', - 'format': 'Unverified', + 'format': _format, }, # These are generated in Drupal now #{