devboard ¤
Devboard package.
A development dashboard for your projects.
Classes:
-
Checkbox–A checkbox, added to rows to make them selectable.
-
Column–A Devboard column.
-
DataTable–A Devboard data table.
-
Devboard–The Devboard application.
-
Modal–A modal screen.
-
ModalMixin–Mixin class to add a modal method.
-
NotifyMixin–Mixin class to add notify methods.
-
Project–A class representing development projects.
-
Row–A Devboard row.
-
SelectableRow–A selectable row.
-
SelectableRowsDataTable–Data table with selectable rows.
-
Status–Git status data.
Functions:
-
get_parser–Return the CLI argument parser.
-
main–Run the main program.
Checkbox dataclass ¤
Checkbox(checked: bool = False)
A checkbox, added to rows to make them selectable.
Methods:
Attributes:
check ¤
check() -> None
Uncheck the checkbox.
Source code in src/devboard/_internal/datatable.py
30 31 32 | |
toggle ¤
toggle() -> bool
Toggle the checkbox.
Source code in src/devboard/_internal/datatable.py
38 39 40 41 | |
uncheck ¤
uncheck() -> None
Uncheck the checkbox.
Source code in src/devboard/_internal/datatable.py
34 35 36 | |
Column ¤
Bases: Container, ModalMixin, NotifyMixin
A Devboard column.
Methods:
-
action_apply–Apply an action to selected rows.
-
apply–Apply action on given row.
-
compose–Compose column widgets.
-
list_projects–List projects for this column.
-
modal–Push a modal.
-
notify_error–Notify error.
-
notify_info–Notify information.
-
notify_success–Notify success.
-
notify_warning–Notify warning.
-
on_mount–Fill data table.
-
populate_rows–Populate rows for this column.
-
update–Update the column (recompute data).
Attributes:
-
DEFAULT_CLASSES–Textual CSS classes.
-
HEADERS(tuple[str, ...]) –The data table headers.
-
THREADED(bool) –Whether actions of this column should run in the background.
-
TITLE(str) –The title of the column.
-
app(App) –Textual application.
-
table(DataTable) –Data table.
THREADED class-attribute instance-attribute ¤
THREADED: bool = True
Whether actions of this column should run in the background.
action_apply ¤
action_apply(action: str = 'default') -> None
Apply an action to selected rows.
Source code in src/devboard/_internal/board.py
71 72 73 74 75 76 77 78 79 | |
apply ¤
Apply action on given row.
Source code in src/devboard/_internal/board.py
139 140 141 | |
compose ¤
compose() -> ComposeResult
Compose column widgets.
Source code in src/devboard/_internal/board.py
59 60 61 62 | |
list_projects ¤
List projects for this column.
Source code in src/devboard/_internal/board.py
130 131 132 | |
modal ¤
modal(text: str) -> None
Push a modal.
Source code in src/devboard/_internal/modal.py
43 44 45 | |
notify_error ¤
Notify error.
Source code in src/devboard/_internal/notifications.py
22 23 24 | |
notify_info ¤
Notify information.
Source code in src/devboard/_internal/notifications.py
10 11 12 | |
notify_success ¤
Notify success.
Source code in src/devboard/_internal/notifications.py
14 15 16 | |
notify_warning ¤
Notify warning.
Source code in src/devboard/_internal/notifications.py
18 19 20 | |
on_mount ¤
on_mount() -> None
Fill data table.
Source code in src/devboard/_internal/board.py
64 65 66 | |
populate_rows staticmethod ¤
Populate rows for this column.
Source code in src/devboard/_internal/board.py
134 135 136 137 | |
update ¤
update() -> None
Update the column (recompute data).
Source code in src/devboard/_internal/board.py
89 90 91 92 93 94 95 96 97 | |
DataTable ¤
Bases: SelectableRowsDataTable
A Devboard data table.
Methods:
-
action_reverse_select–Reverse selection.
-
action_toggle_select_all–Toggle-select all rows.
-
action_toggle_select_down–Toggle selection down.
-
action_toggle_select_row–Toggle-select current row.
-
action_toggle_select_up–Toggle selection up.
-
add_rows–Add rows.
-
clear–Clear rows and optionally columns.
-
force_refresh–Force refresh table.
Attributes:
-
BINDINGS(ClassVar) –Key bindings for selecting rows.
-
ROW–The class to instantiate rows.
-
current_row(SelectableRow) –Currently selected row.
-
selectable_rows(Iterator[SelectableRow]) –Rows, as selectable ones.
-
selected_rows(Iterator[SelectableRow]) –Selected rows.
BINDINGS class-attribute instance-attribute ¤
BINDINGS: ClassVar = [
Binding(
"space",
"toggle_select_row",
"Toggle select",
show=False,
),
Binding(
"ctrl+a, *",
"toggle_select_all",
"Toggle select all",
show=False,
),
Binding(
"exclamation_mark",
"reverse_select",
"Reverse select",
show=False,
),
Binding(
"shift+up",
"toggle_select_up",
"Expand select up",
show=False,
),
Binding(
"shift+down",
"toggle_select_down",
"Expand select down",
show=False,
),
]
Key bindings for selecting rows.
action_reverse_select ¤
action_reverse_select() -> None
Reverse selection.
Source code in src/devboard/_internal/datatable.py
171 172 173 174 175 | |
action_toggle_select_all ¤
action_toggle_select_all() -> None
Toggle-select all rows.
Source code in src/devboard/_internal/datatable.py
160 161 162 163 164 165 166 167 168 169 | |
action_toggle_select_down ¤
action_toggle_select_down() -> None
Toggle selection down.
Source code in src/devboard/_internal/datatable.py
189 190 191 192 193 194 195 196 197 198 199 | |
action_toggle_select_row ¤
action_toggle_select_row() -> None
Toggle-select current row.
Source code in src/devboard/_internal/datatable.py
151 152 153 154 155 156 157 158 | |
action_toggle_select_up ¤
action_toggle_select_up() -> None
Toggle selection up.
Source code in src/devboard/_internal/datatable.py
177 178 179 180 181 182 183 184 185 186 187 | |
add_rows ¤
Add rows.
Automatically insert a column with checkboxes in position 0.
Source code in src/devboard/_internal/datatable.py
131 132 133 134 135 136 | |
clear ¤
clear(columns: bool = True) -> SelectableRowsDataTable
Clear rows and optionally columns.
When clearing columns, automatically re-add a column for checkboxes.
Source code in src/devboard/_internal/datatable.py
138 139 140 141 142 143 144 145 146 | |
force_refresh ¤
force_refresh() -> None
Force refresh table.
Source code in src/devboard/_internal/datatable.py
204 205 206 207 208 209 | |
Devboard ¤
Devboard(
*args: Any,
board: str | Path | None = None,
background_tasks: bool = True,
**kwargs: Any,
)
Bases: App, ModalMixin
The Devboard application.
Methods:
-
action_exit–Exit application.
-
action_refresh–Refresh all columns.
-
action_show_help–Show help.
-
compose–Compose the layout.
-
fetch_all–Run
git fetchin all projects, in background. -
modal–Push a modal.
-
on_mount–Run background tasks.
Attributes:
-
BINDINGS(ClassVar) –Application key bindings.
-
CSS_PATH–Path to the CSS file.
-
app(App) –Textual application.
Source code in src/devboard/_internal/app.py
48 49 50 51 52 53 54 55 56 57 58 59 | |
BINDINGS class-attribute instance-attribute ¤
BINDINGS: ClassVar = [
Binding("F5, ctrl+r", "refresh", "Refresh"),
Binding("question_mark", "show_help", "Help"),
Binding(
"ctrl+q, q, escape", "exit", "Exit", key_display="Q"
),
]
Application key bindings.
CSS_PATH class-attribute instance-attribute ¤
CSS_PATH = parent / 'devboard.tcss'
Path to the CSS file.
action_exit ¤
action_exit() -> None
Exit application.
Source code in src/devboard/_internal/app.py
93 94 95 96 | |
action_refresh ¤
action_refresh() -> None
Refresh all columns.
Source code in src/devboard/_internal/app.py
88 89 90 91 | |
action_show_help ¤
action_show_help() -> None
Show help.
Source code in src/devboard/_internal/app.py
78 79 80 81 82 83 84 85 86 | |
compose ¤
compose() -> ComposeResult
Compose the layout.
Source code in src/devboard/_internal/app.py
61 62 63 64 65 66 67 68 | |
fetch_all ¤
fetch_all() -> None
Run git fetch in all projects, in background.
Source code in src/devboard/_internal/app.py
101 102 103 104 105 106 107 108 109 | |
modal ¤
modal(text: str) -> None
Push a modal.
Source code in src/devboard/_internal/modal.py
43 44 45 | |
on_mount ¤
on_mount() -> None
Run background tasks.
Source code in src/devboard/_internal/app.py
70 71 72 73 | |
Modal ¤
Bases: ModalScreen
A modal screen.
Methods:
Attributes:
-
text–Text content.
Source code in src/devboard/_internal/modal.py
18 19 20 21 22 23 24 25 | |
compose ¤
compose() -> ComposeResult
Screen composition.
Source code in src/devboard/_internal/modal.py
27 28 29 | |
on_key ¤
on_key(event: Key) -> None
Dismiss on any unbound key.
Source code in src/devboard/_internal/modal.py
31 32 33 34 | |
ModalMixin ¤
NotifyMixin ¤
Mixin class to add notify methods.
Methods:
-
notify_error–Notify error.
-
notify_info–Notify information.
-
notify_success–Notify success.
-
notify_warning–Notify warning.
Attributes:
notify_error ¤
Notify error.
Source code in src/devboard/_internal/notifications.py
22 23 24 | |
notify_info ¤
Notify information.
Source code in src/devboard/_internal/notifications.py
10 11 12 | |
notify_success ¤
Notify success.
Source code in src/devboard/_internal/notifications.py
14 15 16 | |
notify_warning ¤
Notify warning.
Source code in src/devboard/_internal/notifications.py
18 19 20 | |
Project dataclass ¤
Project(path: Path)
A class representing development projects.
It is instantiated with a path, and then provides many utility properties and methods.
Methods:
-
checkout–Checkout branch, restore previous one when exiting.
-
delete–Delete branch.
-
fetch–Fetch.
-
lock–Lock project.
-
pull–Pull branch.
-
push–Push branch.
-
unlock–Unlock project.
-
unpulled–Number of unpulled commits, per branch.
-
unpushed–Number of unpushed commits, per branch.
-
unreleased–List unreleased commits.
Attributes:
-
DEFAULT_BRANCHES(tuple[str, ...]) –Name of common default branches. Mainly useful to compute unreleased commits.
-
LOCKS(dict[Project, Lock]) –Locks for projects, to avoid concurrent operations.
-
branch(Head) –Currently checked out branch.
-
default_branch(str) –Default branch (or main branch), as checked out when cloning.
-
is_dirty(bool) –Whether the project is in a "dirty" state (uncommitted modifications).
-
latest_tag(TagReference) –Latest tag.
-
name(str) –Name of the project.
-
path(Path) –Path of the project on the file-system.
-
repo(Repo) –GitPython's
Repoobject. -
status(Status) –Status of the project.
-
status_line(str) –Status of the project, as a string.
DEFAULT_BRANCHES class-attribute ¤
Name of common default branches. Mainly useful to compute unreleased commits.
LOCKS class-attribute ¤
LOCKS: dict[Project, Lock] = defaultdict(Lock)
Locks for projects, to avoid concurrent operations.
default_branch property ¤
default_branch: str
Default branch (or main branch), as checked out when cloning.
is_dirty property ¤
is_dirty: bool
Whether the project is in a "dirty" state (uncommitted modifications).
checkout ¤
Checkout branch, restore previous one when exiting.
Source code in src/devboard/_internal/projects.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
delete ¤
delete(branch: str) -> None
Delete branch.
Source code in src/devboard/_internal/projects.py
162 163 164 | |
fetch ¤
fetch() -> None
Fetch.
Source code in src/devboard/_internal/projects.py
185 186 187 188 189 190 | |
lock ¤
lock() -> bool
Lock project.
Source code in src/devboard/_internal/projects.py
197 198 199 | |
pull ¤
pull(branch: str | None = None) -> None
Pull branch.
Source code in src/devboard/_internal/projects.py
152 153 154 155 | |
push ¤
push(branch: str | None = None) -> None
Push branch.
Source code in src/devboard/_internal/projects.py
157 158 159 160 | |
unlock ¤
unlock() -> None
Unlock project.
Source code in src/devboard/_internal/projects.py
201 202 203 | |
unpulled ¤
Number of unpulled commits, per branch.
Source code in src/devboard/_internal/projects.py
109 110 111 112 113 114 115 | |
unpushed ¤
Number of unpushed commits, per branch.
Source code in src/devboard/_internal/projects.py
101 102 103 104 105 106 107 | |
unreleased ¤
List unreleased commits.
Source code in src/devboard/_internal/projects.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
Row dataclass ¤
Row(table: SelectableRowsDataTable, key: RowKey)
Bases: SelectableRow
A Devboard row.
Methods:
-
remove–Remove row from the table.
-
select–Select this row.
-
toggle_select–Toggle-select this row.
-
unselect–Unselect this row.
Attributes:
-
app(App) –Textual application.
-
checkbox(Checkbox) –Row checkbox.
-
data(list) –Row data (without checkbox).
-
index(int) –Row index.
-
key(RowKey) –The row key.
-
next(SelectableRow) –Next row (down).
-
previous(SelectableRow) –Previous row (up).
-
project(Project) –Devboard project.
-
selected(bool) –Whether this row is selected.
-
table(SelectableRowsDataTable) –The data table containing this row.
remove ¤
remove() -> None
Remove row from the table.
Source code in src/devboard/_internal/datatable.py
94 95 96 | |
select ¤
select() -> None
Select this row.
Source code in src/devboard/_internal/datatable.py
77 78 79 | |
toggle_select ¤
toggle_select() -> bool
Toggle-select this row.
Source code in src/devboard/_internal/datatable.py
85 86 87 | |
unselect ¤
unselect() -> None
Unselect this row.
Source code in src/devboard/_internal/datatable.py
81 82 83 | |
SelectableRow dataclass ¤
SelectableRow(table: SelectableRowsDataTable, key: RowKey)
A selectable row.
Methods:
-
remove–Remove row from the table.
-
select–Select this row.
-
toggle_select–Toggle-select this row.
-
unselect–Unselect this row.
Attributes:
-
app(App) –Textual application.
-
checkbox(Checkbox) –Row checkbox.
-
data(list) –Row data (without checkbox).
-
index(int) –Row index.
-
key(RowKey) –The row key.
-
next(SelectableRow) –Next row (down).
-
previous(SelectableRow) –Previous row (up).
-
selected(bool) –Whether this row is selected.
-
table(SelectableRowsDataTable) –The data table containing this row.
remove ¤
remove() -> None
Remove row from the table.
Source code in src/devboard/_internal/datatable.py
94 95 96 | |
select ¤
select() -> None
Select this row.
Source code in src/devboard/_internal/datatable.py
77 78 79 | |
toggle_select ¤
toggle_select() -> bool
Toggle-select this row.
Source code in src/devboard/_internal/datatable.py
85 86 87 | |
unselect ¤
unselect() -> None
Unselect this row.
Source code in src/devboard/_internal/datatable.py
81 82 83 | |
SelectableRowsDataTable ¤
Bases: DataTable
Data table with selectable rows.
Methods:
-
action_reverse_select–Reverse selection.
-
action_toggle_select_all–Toggle-select all rows.
-
action_toggle_select_down–Toggle selection down.
-
action_toggle_select_row–Toggle-select current row.
-
action_toggle_select_up–Toggle selection up.
-
add_rows–Add rows.
-
clear–Clear rows and optionally columns.
-
force_refresh–Force refresh table.
Attributes:
-
BINDINGS(ClassVar) –Key bindings for selecting rows.
-
ROW–The class to instantiate selectable rows.
-
current_row(SelectableRow) –Currently selected row.
-
selectable_rows(Iterator[SelectableRow]) –Rows, as selectable ones.
-
selected_rows(Iterator[SelectableRow]) –Selected rows.
BINDINGS class-attribute instance-attribute ¤
BINDINGS: ClassVar = [
Binding(
"space",
"toggle_select_row",
"Toggle select",
show=False,
),
Binding(
"ctrl+a, *",
"toggle_select_all",
"Toggle select all",
show=False,
),
Binding(
"exclamation_mark",
"reverse_select",
"Reverse select",
show=False,
),
Binding(
"shift+up",
"toggle_select_up",
"Expand select up",
show=False,
),
Binding(
"shift+down",
"toggle_select_down",
"Expand select down",
show=False,
),
]
Key bindings for selecting rows.
ROW class-attribute instance-attribute ¤
ROW = SelectableRow
The class to instantiate selectable rows.
action_reverse_select ¤
action_reverse_select() -> None
Reverse selection.
Source code in src/devboard/_internal/datatable.py
171 172 173 174 175 | |
action_toggle_select_all ¤
action_toggle_select_all() -> None
Toggle-select all rows.
Source code in src/devboard/_internal/datatable.py
160 161 162 163 164 165 166 167 168 169 | |
action_toggle_select_down ¤
action_toggle_select_down() -> None
Toggle selection down.
Source code in src/devboard/_internal/datatable.py
189 190 191 192 193 194 195 196 197 198 199 | |
action_toggle_select_row ¤
action_toggle_select_row() -> None
Toggle-select current row.
Source code in src/devboard/_internal/datatable.py
151 152 153 154 155 156 157 158 | |
action_toggle_select_up ¤
action_toggle_select_up() -> None
Toggle selection up.
Source code in src/devboard/_internal/datatable.py
177 178 179 180 181 182 183 184 185 186 187 | |
add_rows ¤
Add rows.
Automatically insert a column with checkboxes in position 0.
Source code in src/devboard/_internal/datatable.py
131 132 133 134 135 136 | |
clear ¤
clear(columns: bool = True) -> SelectableRowsDataTable
Clear rows and optionally columns.
When clearing columns, automatically re-add a column for checkboxes.
Source code in src/devboard/_internal/datatable.py
138 139 140 141 142 143 144 145 146 | |
force_refresh ¤
force_refresh() -> None
Force refresh table.
Source code in src/devboard/_internal/datatable.py
204 205 206 207 208 209 | |
Status dataclass ¤
Status(
added: list[Path],
deleted: list[Path],
modified: list[Path],
renamed: list[Path],
typechanged: list[Path],
untracked: list[Path],
)
get_parser ¤
get_parser() -> ArgumentParser
Return the CLI argument parser.
Returns:
-
ArgumentParser–An argparse parser.
Source code in src/devboard/_internal/cli.py
33 34 35 36 37 38 39 40 41 42 43 44 | |
main ¤
Run the main program.
This function is executed when you type devboard or python -m devboard.
Parameters:
Returns:
-
int–An exit code.
Source code in src/devboard/_internal/cli.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |