diff options
Diffstat (limited to 'chimere/utils.py')
-rw-r--r-- | chimere/utils.py | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/chimere/utils.py b/chimere/utils.py index f6300cb..40bc5ad 100644 --- a/chimere/utils.py +++ b/chimere/utils.py @@ -21,11 +21,34 @@ Utilitaries """ +from urllib2 import urlopen, URLError + class ImportManager: - pass + u""" + Generic class for specific importers + """ + def __init__(self, importer_instance): + self.importer_instance = importer_instance + + def get(self): + pass + + def put(self): + pass class KMLManager(ImportManager): - pass + u""" + KML importer/exporter + """ + def get(self): + u""" + Get data from the source + Return a tuple with number of item imported and the detail + """ + try: + source = urlopen(self.importer_instance.source_url) + except URLError as error: + return (0, error.reason) class OSMManager(ImportManager): pass |