How to use the birdseye.utils.IPYTHON_FILE_PATH function in birdseye

To help you get started, we’ve selected a few birdseye examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexmojaki / executing / tests / samples / bird.py View on Github external
def trace_function(self, func):
        # type: (FunctionType) -> FunctionType
        new_func = super(BirdsEye, self).trace_function(func)
        code_info = self._code_infos.get(new_func.__code__)
        if code_info:
            return new_func

        lines, start_lineno = inspect.getsourcelines(func)  # type: List[Text], int
        end_lineno = start_lineno + len(lines)
        name = safe_qualname(func)
        source_file = inspect.getsourcefile(func)
        if source_file.startswith('
github alexmojaki / birdseye / birdseye / db.py View on Github external
def all_file_paths(self):
        # type: () -> List[str]
        with self.session_scope() as session:
            paths = [f[0] for f in session.query(self.Function.file).distinct()
                     if not is_ipython_cell(f[0])]
        paths.sort()
        if IPYTHON_FILE_PATH in paths:
            paths.remove(IPYTHON_FILE_PATH)
            paths.insert(0, IPYTHON_FILE_PATH)
        return paths
github alexmojaki / birdseye / birdseye / bird.py View on Github external
def trace_function(self, func):
        # type: (FunctionType) -> FunctionType
        new_func = super(BirdsEye, self).trace_function(func)
        code_info = self._code_infos.get(new_func.__code__)
        if code_info:
            return new_func

        lines, start_lineno = inspect.getsourcelines(func)  # type: List[Text], int
        end_lineno = start_lineno + len(lines)
        name = safe_qualname(func)
        source_file = inspect.getsourcefile(func)
        if source_file.startswith('
github alexmojaki / birdseye / birdseye / db.py View on Github external
def all_file_paths(self):
        # type: () -> List[str]
        with self.session_scope() as session:
            paths = [f[0] for f in session.query(self.Function.file).distinct()
                     if not is_ipython_cell(f[0])]
        paths.sort()
        if IPYTHON_FILE_PATH in paths:
            paths.remove(IPYTHON_FILE_PATH)
            paths.insert(0, IPYTHON_FILE_PATH)
        return paths
github alexmojaki / birdseye / birdseye / server.py View on Github external
)
    ).order_by(filtered_calls.c.start_time.desc())
    funcs = group_by_attr(query, 'type')

    # Add any functions which were never called
    all_funcs = sorted(session.query(Function.name, Function.type)
                       .filter_by(file=path)
                       .distinct())
    func_names = {row.name for row in query}
    for func in all_funcs:
        if func.name not in func_names:
            funcs[func.type].append(func)

    return render_template('file.html',
                           funcs=funcs,
                           is_ipython=path == IPYTHON_FILE_PATH,
                           full_path=path,
                           short_path=basename(path))