Skip to main content

Colored Horizontal Rule For Terminal

Project description

Tired of destroying the Enter key by creating a “void zone” in your terminal so that you can see the error that you’re trying to debug? If yes, this is for you. termrule allows you to create colored horizontal rule in terminal. Use it in place of the old <hr /> tag in terminal. This script is inspired from hr.py by euangoddard.

Installation:

$ pip install termrule

Supported Colors:

Below is the list of all color names you can use, if an invalid color is entered, an InvalidColorException will be raised.

  • grey
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

Usage:

The color parameter is optional, if it is not passed, then the default termina color will be used.

Command Line:

usage: tr [-h] [--color COLOR] symbol [symbol ...]

positional arguments:
  symbol         Symbol for horizontal line

optional arguments:
  -h, --help     show this help message and exit
  --color COLOR  Color of the line
$ tr "#"
#################################### # Till the end of terminal

$ tr "#-#"
#-##-##-##-##-##-##-##-##-##-##-##- # Till the end of termnial

$ tr "@" --color red
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ # Till the end of terminal in red color

Script:

>>> from tr import TermRule
>>> r = TermRule()
>>> r.tr(["#", "-"], color="cyan")
##################################### # Till the end of terminal in cyan color
-------------------------------------
>>> r.tr(["^"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # Till the end of terminal in default color
>>> r.tr(["@-@"])
@-@@-@@-@@-@@-@@-@@-@@-@@-@@-@@-@@-@@

Dependencies:

termcolor is the only dependency; it is used for colored outputs, and I hope you know that python 2.7 is also required (isn’t that obvious?)

License:

termrule is distributed under MIT license, see LICENSE for more details

Project details


Release history Release notifications

History Node

0.13

History Node

0.12

History Node

0.11

This version
History Node

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
termrule-0.10-py2.7.egg (4.2 kB) Copy SHA256 hash SHA256 Egg 2.7 Jul 19, 2014
termrule-0.10-py2-none-any.whl (3.3 kB) Copy SHA256 hash SHA256 Wheel py2 Jul 19, 2014
termrule-0.10.tar.gz (1.8 kB) Copy SHA256 hash SHA256 Source None Jul 19, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page