default_board ¤
User configuration of columns.
The only object that must be defined in this module is columns
, which is a list of Column
instances.
Classes:
-
Project
–Customized project class.
-
ToCommit
–A column showing projects with uncommitted changes.
-
ToPull
–A column showing branches with commits that should be pulled.
-
ToPush
–A column showing branches with commits that should be pushed.
-
ToRelease
–A column showing projects with commits that should be released.
Attributes:
-
BASE_DIR
–The base directory containing all your Git projects.
BASE_DIR module-attribute
¤
BASE_DIR = expanduser()
The base directory containing all your Git projects.
This variable is only used to list projects in Project.list_projects
and has no special meaning for Devboard.
Project dataclass
¤
Project(
LOCKS: dict[Project, Lock] = defaultdict(Lock),
DEFAULT_BRANCHES: tuple[str, ...] = ("main", "master"),
path: Path,
)
Bases: Project
Customized project class.
The original Project
is sub-classed for demonstration purpose. Feel free to add any attribute, property or method to it, to serve your own needs. You can also override its existing property and methods if needed. In the default class below, we add the list_projects
class method that will be passed to Column
instances, allowing them to iterate on your projects.
Methods:
-
checkout
–Checkout branch, restore previous one when exiting.
-
delete
–Delete branch.
-
fetch
–Fetch.
-
list_projects
–List all Git projects in a base directory.
-
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.
-
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
Repo
object. -
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.
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.
list_projects classmethod
¤
List all Git projects in a base directory.
unpulled ¤
Number of unpulled commits, per branch.
unpushed ¤
Number of unpushed commits, per branch.
ToCommit ¤
Bases: Column
A column showing projects with uncommitted changes.
Methods:
-
action_apply
–Apply an action to selected rows.
-
apply
–Process actions.
-
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
–Scan a project, feeding rows to the table.
-
update
–Update the column (recompute data).
Attributes:
-
DEFAULT_CLASSES
–Textual CSS classes.
-
table
(DataTable
) –Data table.
apply ¤
Process actions.
It handles two actions: status
and diff
.
status
: Show the Git status of the selected project in a modal windowdiff
: Show the Git diff of the selected project in a modal window.
populate_rows staticmethod
¤
Scan a project, feeding rows to the table.
It returns a single row with the project and its status line.
ToPull ¤
Bases: Column
A column showing branches with commits that should be pulled.
Methods:
-
action_apply
–Apply an action to selected rows.
-
apply
–Process actions.
-
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
–Scan a project, feeding rows to the table.
-
update
–Update the column (recompute data).
Attributes:
-
DEFAULT_CLASSES
–Textual CSS classes.
-
THREADED
(bool
) –Whether actions of this column should run in the background.
-
table
(DataTable
) –Data table.
THREADED class-attribute
instance-attribute
¤
THREADED: bool = True
Whether actions of this column should run in the background.
apply ¤
Process actions.
It handles a single default action: running git pull
for the selected row (project and branch).
populate_rows staticmethod
¤
Scan a project, feeding rows to the table.
It returns multiple rows, one for each branch having commits to pull from the remote.
ToPush ¤
Bases: Column
A column showing branches with commits that should be pushed.
Methods:
-
action_apply
–Apply an action to selected rows.
-
apply
–Process actions.
-
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
–Scan a project, feeding rows to the table.
-
update
–Update the column (recompute data).
Attributes:
-
DEFAULT_CLASSES
–Textual CSS classes.
-
THREADED
(bool
) –Whether actions of this column should run in the background.
-
table
(DataTable
) –Data table.
THREADED class-attribute
instance-attribute
¤
THREADED: bool = True
Whether actions of this column should run in the background.
apply ¤
Process actions.
It handles a single default action: running git push
for the selected row (project and branch).
populate_rows staticmethod
¤
Scan a project, feeding rows to the table.
It returns multiple rows, one for each branch having commits to push to the remote.
ToRelease ¤
Bases: Column
A column showing projects with commits that should be released.
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
–Scan a project, feeding rows to the table.
-
update
–Update the column (recompute data).
Attributes:
-
DEFAULT_CLASSES
–Textual CSS classes.
-
THREADED
(bool
) –Whether actions of this column should run in the background.
-
table
(DataTable
) –Data table.