# Report window


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Duration formatting

------------------------------------------------------------------------

<a
href="https://github.com/sayanbanerjee32/snooper_pkg/blob/main/snooper_pkg/report_window.py#L23"
target="_blank" style="float:right; font-size:smaller">source</a>

### fmt_duration

``` python
def fmt_duration(
    seconds
):
```

*Format a duration in seconds as whole minutes and seconds.*

## Application summary table

------------------------------------------------------------------------

<a
href="https://github.com/sayanbanerjee32/snooper_pkg/blob/main/snooper_pkg/report_window.py#L28"
target="_blank" style="float:right; font-size:smaller">source</a>

### show_apps

``` python
def show_apps(
    root, report_data
):
```

*Create and populate the foreground-application summary table.*

## Session summary

------------------------------------------------------------------------

<a
href="https://github.com/sayanbanerjee32/snooper_pkg/blob/main/snooper_pkg/report_window.py#L45"
target="_blank" style="float:right; font-size:smaller">source</a>

### show_summary

``` python
def show_summary(
    root, report_data
):
```

*Add the session summary fields to the report window.*

## Selected-app title details

------------------------------------------------------------------------

<a
href="https://github.com/sayanbanerjee32/snooper_pkg/blob/main/snooper_pkg/report_window.py#L76"
target="_blank" style="float:right; font-size:smaller">source</a>

### update_titles

``` python
def update_titles(
    title_tree, report_data, app_tree
):
```

*Replace title-table rows with title durations for the selected app.*

------------------------------------------------------------------------

<a
href="https://github.com/sayanbanerjee32/snooper_pkg/blob/main/snooper_pkg/report_window.py#L64"
target="_blank" style="float:right; font-size:smaller">source</a>

### show_titles

``` python
def show_titles(
    root
):
```

*Create the table used to show titles for the selected application.*

## Report window lifecycle

------------------------------------------------------------------------

<a
href="https://github.com/sayanbanerjee32/snooper_pkg/blob/main/snooper_pkg/report_window.py#L93"
target="_blank" style="float:right; font-size:smaller">source</a>

### show_report

``` python
def show_report(
    parent, report_data, report_title:str='Usage Report', is_show_titles:bool=True
):
```

*Open a report as a child of the application’s Tk root.*

1.  Report-data shape: this module treats report_data\[“events”\] as a
    list of app-summary dictionaries. The project context describes a
    preferred future structure where “events” is a dictionary containing
    “top_apps”, “titles_by_app”, and “timeline”. Confirm the reporter’s
    current return shape before documenting that structure more
    specifically.

2.  Title-data availability: update_titles assumes every app event has a
    “top_titles” key, including any idle event. Confirm whether idle
    rows include that key or whether they should be excluded from
    title-detail display.

3.  Configuration default timing: is_show_titles = cf.SHOW_WINDOW_TITLES
    is evaluated when the function is defined, rather than when it is
    called. That is valid for a static configuration setting, but it
    will not reflect changes to cf.SHOW_WINDOW_TITLES made later in the
    same process.
