# Path: app.py



import os
import sys
import os, errno, sqlite3
from time import sleep, time
from cPickle import loads, dumps
    from thread import get_ident
    from dummy_thread import get_ident
from werkzeug.contrib.cache import BaseCache
from app import app
        return rv

    def delete(self, key):
        with self._get_conn(key) as conn:
            conn.execute(self._del_sql, (key,))

    def set(self, key, value, timeout=None):
        if not timeout:
            timeout = self.default_timeout
        value = buffer(dumps(value, 2))
        expire = time() + timeout
        with self._get_conn(key) as conn:
            conn.execute(self._set_sql, (key, value, expire))

    def add(self, key, value, timeout=None):
        if not timeout:
            timeout = self.default_timeout
        expire = time() + timeout
        value = buffer(dumps(value, 2))
        with self._get_conn(key) as conn:
            try:
                conn.execute(self._add_sql, (key, value, expire))
            except sqlite3.IntegrityError:
                pass

    def clear(self):
        for bucket in os.listdir(self.path):
            os.unlink(os.path.join(self.path, bucket))



# Path: app.py



# Path: performance/sqlite_cache.py
import os
import sys
import os, errno, sqlite3
from time import sleep, time
from cPickle import loads, dumps
    from thread import get_ident
    from dummy_thread import get_ident
from werkzeug.contrib.cache import BaseCache
from app import app

        return rv

    def delete(self, key):
        with self._get_conn(key) as conn:
            conn.execute(self._del_sql, (key,))

    def set(self, key, value, timeout=None):
        if not timeout:
            timeout = self.default_timeout
        value = buffer(dumps(value, 2))
        expire = time() + timeout
        with self._get_conn(key) as conn:
            conn.execute(self._set_sql, (key, value, expire))

    def add(self, key, value, timeout=None):
        if not timeout:
            timeout = self.default_timeout
        expire = time() + timeout
        value = buffer(dumps(value, 2))
        with self._get_conn(key) as conn:
            try:
                conn.execute(self._add_sql, (key, value, expire))
            except sqlite3.IntegrityError:
                pass

    def clear(self):
        for bucket in os.listdir(self.path):
            os.unlink(os.path.join(self.path, bucket))



@app.route('/')