Example #1
0
def func_view(path, func_name):
    session = Session()
    query = (session.query(Call, Function).join(Function).filter_by(
        file=path, name=func_name).order_by(Call.start_time.desc())[:200])
    if query:
        func = query[0][1]
        calls = [p[0] for p in query]
    else:
        func = session.query(Function).filter_by(file=path, name=func_name)[0]
        calls = None

    return render_template('function.html', func=func, calls=calls)
Example #2
0
def file_view(path):
    return render_template('file.html',
                           funcs=sorted(Session().query(
                               Function.name).filter_by(file=path).distinct()),
                           is_ipython=path == IPYTHON_FILE_PATH,
                           full_path=path,
                           short_path=short_path(path))
Example #3
0
def all_file_paths():
    # type: () -> List[str]
    from birdseye.db import Function, Session
    paths = [f[0] for f in Session().query(Function.file).distinct()]
    paths.sort()
    if IPYTHON_FILE_PATH in paths:
        paths.remove(IPYTHON_FILE_PATH)
        paths.insert(0, IPYTHON_FILE_PATH)
    return paths
Example #4
0
from collections import namedtuple

import os

import sys
from littleutils import json_to_file, file_to_json

from birdseye.cheap_repr import register_repr
from tests import golden_script

from birdseye.utils import PY3, PY2
from birdseye import eye
from birdseye.db import Call, Session
from bs4 import BeautifulSoup

session = Session()


@eye
def bar():
    pass


@eye
def foo():
    x = 1
    y = 2
    if x + y > 5:
        1 / 0
    else:
        x * y
Example #5
0
def all_file_paths():
    from birdseye.db import Function, Session
    return [f[0] for f in Session().query(Function.file).distinct()]
Example #6
0
from collections import namedtuple, Set, Mapping
from unittest import skipUnless

from bs4 import BeautifulSoup
from cheap_repr import register_repr
from littleutils import json_to_file, file_to_json, string_to_file

import tests

str(tests)
from birdseye import eye, NodeValue, is_interesting_expression, is_obvious_builtin
from birdseye.db import Call, Session
from birdseye.utils import PY2, PY3
from tests import golden_script

session = Session()


@eye
def bar():
    pass


@eye
def foo():
    x = 1
    y = 2
    if x + y > 5:
        1 / 0
    else:
        x * y
Example #7
0
def call_view(call_id):
    call = Session().query(Call).filter_by(id=call_id).one()
    func = call.function
    return render_template('call.html', call=call, func=func)
Example #8
0
from unittest import skipUnless

from bs4 import BeautifulSoup
from cheap_repr import register_repr
from littleutils import json_to_file, file_to_json, string_to_file

import tests

str(tests)
from birdseye import eye, NodeValue, is_interesting_expression, is_obvious_builtin
from birdseye.db import Call, Session
from birdseye.utils import PY2, PY3
from tests import golden_script


session = Session()


@eye
def bar():
    pass


@eye
def foo():
    x = 1
    y = 2
    if x + y > 5:
        1 / 0
    else:
        x * y