Skip to content

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 ¤

DEFAULT_BRANCHES: tuple[str, ...] = ('main', 'master')

Name of common default branches. Mainly useful to compute unreleased commits.

branch property ¤

branch: Head

Currently checked out branch.

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).

latest_tag property ¤

latest_tag: TagReference

Latest tag.

name property ¤

name: str

Name of the project.

path instance-attribute ¤

path: Path

Path of the project on the file-system.

repo property ¤

repo: Repo

GitPython's Repo object.

status property ¤

status: Status

Status of the project.

status_line property ¤

status_line: str

Status of the project, as a string.

checkout ¤

checkout(branch: str | None) -> Iterator[None]

Checkout branch, restore previous one when exiting.

delete ¤

delete(branch: str) -> None

Delete branch.

fetch ¤

fetch() -> None

Fetch.

list_projects classmethod ¤

list_projects() -> Iterator[Project]

List all Git projects in a base directory.

lock ¤

lock() -> bool

Lock project.

pull ¤

pull(branch: str | None = None) -> None

Pull branch.

push ¤

push(branch: str | None = None) -> None

Push branch.

unlock ¤

unlock() -> None

Unlock project.

unpulled ¤

unpulled(remote: str = 'origin') -> dict[str, int]

Number of unpulled commits, per branch.

unpushed ¤

unpushed(remote: str = 'origin') -> dict[str, int]

Number of unpushed commits, per branch.

unreleased ¤

unreleased(branch: str | None = None) -> list[Commit]

List unreleased commits.

ToCommit ¤

Bases: Column

A column showing projects with uncommitted changes.

Methods:

Attributes:

DEFAULT_CLASSES class-attribute instance-attribute ¤

DEFAULT_CLASSES = 'box'

Textual CSS classes.

table property ¤

table: DataTable

Data table.

action_apply ¤

action_apply(action: str = 'default') -> None

Apply an action to selected rows.

apply ¤

apply(action: str, row: Row) -> None

Process actions.

It handles two actions: status and diff.

  • status: Show the Git status of the selected project in a modal window
  • diff: Show the Git diff of the selected project in a modal window.

compose ¤

compose() -> ComposeResult

Compose column widgets.

list_projects ¤

list_projects() -> Iterator[Project]

List projects for this column.

modal ¤

modal(text: str) -> None

Push a modal.

notify_error ¤

notify_error(message: str, timeout: float = 3.0) -> None

Notify error.

notify_info ¤

notify_info(message: str, timeout: float = 3.0) -> None

Notify information.

notify_success ¤

notify_success(message: str, timeout: float = 3.0) -> None

Notify success.

notify_warning ¤

notify_warning(message: str, timeout: float = 3.0) -> None

Notify warning.

on_mount ¤

on_mount() -> None

Fill data table.

populate_rows staticmethod ¤

populate_rows(project: Project) -> list[tuple[Any, ...]]

Scan a project, feeding rows to the table.

It returns a single row with the project and its status line.

update ¤

update() -> None

Update the column (recompute data).

ToPull ¤

Bases: Column

A column showing branches with commits that should be pulled.

Methods:

Attributes:

DEFAULT_CLASSES class-attribute instance-attribute ¤

DEFAULT_CLASSES = 'box'

Textual CSS classes.

THREADED class-attribute instance-attribute ¤

THREADED: bool = True

Whether actions of this column should run in the background.

table property ¤

table: DataTable

Data table.

action_apply ¤

action_apply(action: str = 'default') -> None

Apply an action to selected rows.

apply ¤

apply(action: str, row: Row) -> None

Process actions.

It handles a single default action: running git pull for the selected row (project and branch).

compose ¤

compose() -> ComposeResult

Compose column widgets.

list_projects ¤

list_projects() -> Iterator[Project]

List projects for this column.

modal ¤

modal(text: str) -> None

Push a modal.

notify_error ¤

notify_error(message: str, timeout: float = 3.0) -> None

Notify error.

notify_info ¤

notify_info(message: str, timeout: float = 3.0) -> None

Notify information.

notify_success ¤

notify_success(message: str, timeout: float = 3.0) -> None

Notify success.

notify_warning ¤

notify_warning(message: str, timeout: float = 3.0) -> None

Notify warning.

on_mount ¤

on_mount() -> None

Fill data table.

populate_rows staticmethod ¤

populate_rows(project: Project) -> list[tuple[Any, ...]]

Scan a project, feeding rows to the table.

It returns multiple rows, one for each branch having commits to pull from the remote.

update ¤

update() -> None

Update the column (recompute data).

ToPush ¤

Bases: Column

A column showing branches with commits that should be pushed.

Methods:

Attributes:

DEFAULT_CLASSES class-attribute instance-attribute ¤

DEFAULT_CLASSES = 'box'

Textual CSS classes.

THREADED class-attribute instance-attribute ¤

THREADED: bool = True

Whether actions of this column should run in the background.

table property ¤

table: DataTable

Data table.

action_apply ¤

action_apply(action: str = 'default') -> None

Apply an action to selected rows.

apply ¤

apply(action: str, row: Row) -> None

Process actions.

It handles a single default action: running git push for the selected row (project and branch).

compose ¤

compose() -> ComposeResult

Compose column widgets.

list_projects ¤

list_projects() -> Iterator[Project]

List projects for this column.

modal ¤

modal(text: str) -> None

Push a modal.

notify_error ¤

notify_error(message: str, timeout: float = 3.0) -> None

Notify error.

notify_info ¤

notify_info(message: str, timeout: float = 3.0) -> None

Notify information.

notify_success ¤

notify_success(message: str, timeout: float = 3.0) -> None

Notify success.

notify_warning ¤

notify_warning(message: str, timeout: float = 3.0) -> None

Notify warning.

on_mount ¤

on_mount() -> None

Fill data table.

populate_rows staticmethod ¤

populate_rows(project: Project) -> list[tuple[Any, ...]]

Scan a project, feeding rows to the table.

It returns multiple rows, one for each branch having commits to push to the remote.

update ¤

update() -> None

Update the column (recompute data).

ToRelease ¤

Bases: Column

A column showing projects with commits that should be released.

Methods:

Attributes:

DEFAULT_CLASSES class-attribute instance-attribute ¤

DEFAULT_CLASSES = 'box'

Textual CSS classes.

THREADED class-attribute instance-attribute ¤

THREADED: bool = True

Whether actions of this column should run in the background.

table property ¤

table: DataTable

Data table.

action_apply ¤

action_apply(action: str = 'default') -> None

Apply an action to selected rows.

apply ¤

apply(action: str, row: Row) -> None

Apply action on given row.

compose ¤

compose() -> ComposeResult

Compose column widgets.

list_projects ¤

list_projects() -> Iterator[Project]

List projects for this column.

modal ¤

modal(text: str) -> None

Push a modal.

notify_error ¤

notify_error(message: str, timeout: float = 3.0) -> None

Notify error.

notify_info ¤

notify_info(message: str, timeout: float = 3.0) -> None

Notify information.

notify_success ¤

notify_success(message: str, timeout: float = 3.0) -> None

Notify success.

notify_warning ¤

notify_warning(message: str, timeout: float = 3.0) -> None

Notify warning.

on_mount ¤

on_mount() -> None

Fill data table.

populate_rows staticmethod ¤

populate_rows(project: Project) -> list[tuple[Any, ...]]

Scan a project, feeding rows to the table.

It returns a single row with the project and a summary of commit types.

update ¤

update() -> None

Update the column (recompute data).