from flask import Flask, request, make_response from flask.views import MethodView from werkzeug.exceptions import Unauthorized import json, re, sys, traceback from authentication import * from converters import * from util import * __app__ = Flask(__name__) __app__.always_authenticate = False class Endpoint(object): '''Main data endpoint class, manages''' def __init__(self,path,auth=None,rate=None,types=['json','xml'],default_type=None): '''Initializes the endpoint and sets the target path''' self.data = {} self.types = ['\.%s' % t for t in types] try: if default_type: raise Exception,'Using default_type' self.default_type = types[0] except: self.default_type = default_type self.path = self.mutatepath(path) self.auth = auth self.rate = rate