Exemple #1
0
    def test_key_value_store(self):
        kv = Database().key_value_store

        self.assertIsNone(kv.thing)

        kv.thing = 'foo'
        self.assertEqual(kv.thing, 'foo')

        kv.thing = 'bar'
        self.assertEqual(kv.thing, 'bar')
Exemple #2
0
from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell

app = Flask('birdseye')
app.jinja_env.auto_reload = True

Humanize(app)


class FileConverter(PathConverter):
    regex = '.*?'


app.url_map.converters['file'] = FileConverter


db = Database()
Session = db.Session
Function = db.Function
Call = db.Call


@app.route('/')
@db.provide_session
def index(session):
    all_paths = db.all_file_paths()

    recent_calls = (session.query(*(Call.basic_columns + Function.basic_columns))
                        .join(Function)
                        .order_by(Call.start_time.desc())[:100])

    files = OrderedDict()
Exemple #3
0
 def db(self):
     return Database(self._db_uri)
Exemple #4
0
from birdseye.db import Database

Database(_skip_version_check=True).clear()

print('Database cleared!')