# Path: app.py



import os
import sys
from functools import wraps
from flask import request, current_app
from flask import jsonify
from app import app
# -*- coding: utf-8 -*-
"""
    decorators.jsonp
    ~~~~~~~~~~~~~~~~

    JSONP decorator
    http://flask.pocoo.org/snippets/79/
"""

sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))




def jsonp(func):
    """Wraps JSONified output for JSONP requests."""
    @wraps(func)
    def decorated_function(*args, **kwargs):
        callback = request.args.get('callback', False)
        if callback:
            data = str(func(*args, **kwargs).data)
            content = str(callback) + '(' + data + ')'
            mimetype = 'application/javascript'
            return current_app.response_class(content, mimetype=mimetype)
        else:
            return func(*args, **kwargs)
    return decorated_function

    

# Path: app.py



# Path: decorators/jsonp.py
import os
import sys
from functools import wraps
from flask import request, current_app
from flask import jsonify
from app import app

# -*- coding: utf-8 -*-
"""
    decorators.jsonp
    ~~~~~~~~~~~~~~~~

    JSONP decorator
    http://flask.pocoo.org/snippets/79/
"""

sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.dirname(__file__))))




def jsonp(func):
    """Wraps JSONified output for JSONP requests."""
    @wraps(func)
    def decorated_function(*args, **kwargs):
        callback = request.args.get('callback', False)
        if callback:
            data = str(func(*args, **kwargs).data)
            content = str(callback) + '(' + data + ')'
            mimetype = 'application/javascript'
            return current_app.response_class(content, mimetype=mimetype)
        else:
            return func(*args, **kwargs)
    return decorated_function

    

@app.route('/')