diff options
Diffstat (limited to 'chimere/tasks.py')
-rw-r--r-- | chimere/tasks.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chimere/tasks.py b/chimere/tasks.py index 9eff7f5..01ee113 100644 --- a/chimere/tasks.py +++ b/chimere/tasks.py @@ -85,13 +85,13 @@ def importing(importer_pk): if importer.state != IMPORT_MESSAGES['import_pending'][0]: # import canceled or done return - importer.state = unicode(IMPORT_MESSAGES['import_process'][0]) + importer.state = str(IMPORT_MESSAGES['import_process'][0]) importer.save() new_item, updated_item, error = importer.manager.get() importer.state = error + '\n' if error else '' - importer.state += unicode(IMPORT_MESSAGES['import_done'][0]) + importer.state += str(IMPORT_MESSAGES['import_done'][0]) importer.state += \ - u" - " + unicode(IMPORT_MESSAGES['import_done'][1]) % { + u" - " + str(IMPORT_MESSAGES['import_done'][1]) % { 'new': new_item, 'updated': updated_item} importer.state = importer.state importer.save() @@ -109,20 +109,20 @@ def exporting(importer_pk, extra_args=[]): if importer.state != IMPORT_MESSAGES['export_pending'][0]: # import canceled or done return - importer.state = unicode(IMPORT_MESSAGES['export_process'][0]) + importer.state = str(IMPORT_MESSAGES['export_process'][0]) importer.save() error = None try: updated_item, error = importer.manager.put(extra_args) - except OsmApi.ApiError, error: + except OsmApi.ApiError as error: pass if error: - importer.state = unicode(IMPORT_MESSAGES['export_failed'][0]) \ - + u" - " + unicode(IMPORT_MESSAGES['export_failed'][1]) % error + importer.state = str(IMPORT_MESSAGES['export_failed'][0]) \ + + u" - " + str(IMPORT_MESSAGES['export_failed'][1]) % error importer.save() return - importer.state = unicode(IMPORT_MESSAGES['export_done'][0]) + u" - " \ - + unicode(IMPORT_MESSAGES['export_done'][1]) % { + importer.state = str(IMPORT_MESSAGES['export_done'][0]) + u" - " \ + + str(IMPORT_MESSAGES['export_done'][1]) % { 'updated': updated_item} importer.save() return True |