tensorbay.client.status#

The basic concept of the status.

class tensorbay.client.status.Status(branch_name=None, *, draft_number=None, commit_id=None)[source]#

Bases: object

This class defines the basic concept of the status.

Parameters
  • branch_name (Optional[str]) – The branch name.

  • draft_number (Optional[int]) – The draft number (if the status is draft).

  • commit_id (Optional[str]) – The commit ID (if the status is commit).

Return type

None

property is_draft: bool#

Return whether the status is draft, True for draft, False for commit.

Returns

whether the status is draft, True for draft, False for commit.

property draft_number: Optional[int]#

Return the draft number.

Returns

The draft number.

property commit_id: Optional[str]#

Return the commit ID.

Returns

The commit ID.

get_status_info()[source]#

Get the dict containing the draft number or commit ID.

Returns

A dict containing the draft number or commit ID.

Return type

Dict[str, Any]

check_authority_for_commit()[source]#

Check whether the status is a legal commit.

Raises

StatusError – When the status is not a legal commit.

Return type

None

check_authority_for_draft()[source]#

Check whether the status is a legal draft.

Raises

StatusError – When the status is not a legal draft.

Return type

None

checkout(commit_id=None, draft_number=None)[source]#

Checkout to commit or draft.

Parameters
  • commit_id (Optional[str]) – The commit ID.

  • draft_number (Optional[int]) – The draft number.

Return type

None