def transition_import_commune(self): shapefile = ShapeUnzip.getShapefile(self.start.shapefile) debug("unzipped") try : Commune.createCommuneGeometries(shapefile.filename, self.start.version) finally: shapefile.destroy() return 'done'
def transition_import_departement(self): shapefile = ShapeUnzip.getShapefile(self.start.shapefile) debug("unzipped") try : Departement.createDepartementGeometries(shapefile.filename, self.start.version) finally: shapefile.destroy() return 'done'
def importerCommune(cls, data, version): binData = base64.decodestring(data) shapefile = ShapeUnzip.getShapefile(binData) ret = False try : Commune.deleteOldCommune() Commune.createCommuneGeometries(shapefile.filename, version) ret = True finally: shapefile.destroy() return ret
def importerRegion(cls, data, version): binData = base64.decodestring(data) shapefile = ShapeUnzip.getShapefile(binData) ret = False try : Region.deleteOldRegion() Region.createRegionGeometries(shapefile.filename, version) ret = True finally: shapefile.destroy() return ret
def importerDepartement(cls, data, version): binData = base64.decodestring(data) shapefile = ShapeUnzip.getShapefile(binData) ret = False try : Departement.deleteOldDepartement() Departement.createDepartementGeometries(shapefile.filename, version) ret = True finally: shapefile.destroy() return ret