This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, redirect, url_for, make_response, abort | |
from mongoengine.fields import get_db | |
from bson import ObjectId | |
from gridfs import GridFS | |
from gridfs.errors import NoFile | |
from <your_app> import app | |
@app.route('/files/<oid>') | |
def serve_gridfs_file(oid): | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def file = new File(args[0]) | |
def mb = new groovy.xml.StreamingMarkupBuilder() | |
new OutputStreamWriter(new FileOutputStream(args[1]),'utf-16') << mb.bind { | |
mkp.xmlDeclaration() | |
mkp.declareNamespace( kml: "http://earth.google.com/kml/2.0" ) | |
kml { | |
Document { | |
Folder { |
NewerOlder