powerline-travis-ci
A light-hearted Powerline segment for fetching and showing the status
of the last build on travis. The segment will only be shown if the current directory contains a .travis.yml file.
Keep in mind that powerline-travis-ci is in early, rapid development stage so its API/configuration format may change.
Requirements
- Powerline
- A travis-ci.com API token
Installation
pip install powerline-travis-ci
Activation
The very minimum required to activate the segment is to add the following to your theme JSON:
{
"function": "powerline_travis_ci.latest_build_state",
"args": {
"token": API_TOKEN,
"username": TRAVIS_USERNAME
}
}
and the following to your colorscheme JSON (the colors can be customized):
"groups": {
...,
"latest_travis_build_state": {
"fg": "gray9",
"bg": "gray2",
"attrs": []
}
}
Configuration and Customization
The following optional args are available:
| Argument | Type | Description | Default |
|---|---|---|---|
canceled_text |
string | Text or icon to show for the canceled state |
"Canceled" |
created_text |
string | Text or icon to show for the created state |
"Created" |
errored_text |
string | Text or icon to show for the errored state |
"Errored" |
failed_text |
string | Text or icon to show for the failed state |
"Failed" |
for_current_branch |
boolean | If true the state shown is the state of the latest build of the checked out git branch |
false |
git_path |
string | Only used if for_current_branch is true |
"git" |
passed_text |
string | Text or icon to show for the passed state |
"Passed" |
post_state_text |
string | Text or icon to append the state. If contains <travis_url> a clickable link to travis will be shown (if the supported by your terminal) |
"" |
pre_state_text |
string | Text or icon to prepend before the state. If contains <travis_url> a clickable link to travis will be shown (if the supported by your terminal) |
"" |
received_text |
string | Text or icon to show for the received state |
"Received" |
show_state_branch |
boolean | If true the name of the git branch will be shown along the state |
false |
started_text |
string | Text or icon to show for the started state |
"Started" |
Highlight Groups
In addition to the generic latest_travis_build_state group, each state can be customized independently with highlight group latest_travis_build_state_{state}.
For example,
"latest_travis_build_state_passed": {
"fg": "white",
"bg": "darkestgreen",
"attrs": []
}
If a specific state does not have a highlight group then the style of "latest_travis_build_state" group will be used.
Examples
Default configuration
Customized text and highlight groups for "passed" and "failed" states
{
"function": "powerline_travis_ci.latest_build_state",
"args": {
"token": API_TOKEN,
"username": TRAVIS_USERNAME,
"passed_text": "✔",
"failed_text": "❌",
"pre_state_text": "Travis: "
}
}
"latest_travis_build_state": {
"fg": "white",
"bg": "gray2",
"attrs": []
},
"latest_travis_build_state_passed": {
"fg": "white",
"bg": "darkestgreen",
"attrs": []
},
"latest_travis_build_state_failed": {
"fg": "white",
"bg": "darkestred",
"attrs": []
}
Changelog
0.1 - Nov. 6 2020
Initial release
Release files for powerline-travis-ci 0.1.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| powerline_travis_ci-0.1.post1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / powerline_travis_ci-0.1.post1-py3-none-any.whl
| Download URL | powerline_travis_ci-0.1.post1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
387b90cbb5379ccbb126c29abc1fb022353af837d6e1c823b27be614477983aa
|
|
BLAKE2b-256 checksum How to use checksums |
b8f7c368e96e6a4715f2cad9e40cd471a9a73362f0226f315294ac94c16683ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.8
|