def writeCountyMapper(cacheList): filename = utility.saveFileDialog('gcm', 'countyMapper') log.debug('county mapper filename: %s' %filename) f = codecs.open(filename, 'w', encoding='utf-8', errors='strict') for cache in cacheList: f.write("%s\t%s\t%s\t%s\n" %(cache.gcid, cache.lat, cache.lon, cache.cacheName)) f.close() return filename
def writeKML(cacheList): filename = utility.saveFileDialog('kml') log.debug(filename) f = codecs.open(filename, 'w', encoding="utf-8", errors="strict") initKML(f) for cache in cacheList: createCircleKML(f, str(cache.lat) + ' ' + str(cache.lon), 0.161, cache.cacheName) closeKML(f) f.close()
def writeCSV(cacheList): filename = utility.saveFileDialog('csv') log.debug(filename) f = codecs.open(filename, 'w', encoding="utf-8", errors="strict") f.write('GCID,cacheName,Difficulty, Terrain\n') for cache in cacheList: try: f.write("%s,%s,%s,%s\n" %(cache.gcid, cache.cacheName, cache.difficulty, cache.terrain)) except UnicodeDecodeError: log.critical('Unicode error') f.close()