Giter VIP home page Giter VIP logo

powerline-travis-ci's Introduction

PyPI Downloads

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

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

default

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": []
}

customized-passed

customized-faild

Changelog

0.1 - Nov. 6 2020

Initial release

powerline-travis-ci's People

Contributors

deepspace2 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.