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


Download files

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

Source Distribution

termrule-0.10.tar.gz (1.8 kB view details)

Uploaded Source

Built Distributions

termrule-0.10-py2.7.egg (4.2 kB view details)

Uploaded Source

termrule-0.10-py2-none-any.whl (3.3 kB view details)

Uploaded Python 2

File details

Details for the file termrule-0.10.tar.gz.

File metadata

  • Download URL: termrule-0.10.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for termrule-0.10.tar.gz
Algorithm Hash digest
SHA256 47dc00aff6a6287ec71a6f44cf99e75f5fc892da324a835cc3551c16e1ca1767
MD5 7dbf3f6b2dc24d505c5c1e3d123a941e
BLAKE2b-256 64a6309cea83ecffea0069052bfa6684f36d72a5da10360eaa8a71ab633d27e9

See more details on using hashes here.

File details

Details for the file termrule-0.10-py2.7.egg.

File metadata

  • Download URL: termrule-0.10-py2.7.egg
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for termrule-0.10-py2.7.egg
Algorithm Hash digest
SHA256 e1f6cac30850b826bf1357490a0e2687f2421e6a53e5a16115e7b817a72feb4a
MD5 3e7547ddbc09d5b709313e443827ad8a
BLAKE2b-256 28a2a1cb6aac10dd978391a0708bff5a04b52827c36217692babb6641690b030

See more details on using hashes here.

File details

Details for the file termrule-0.10-py2-none-any.whl.

File metadata

File hashes

Hashes for termrule-0.10-py2-none-any.whl
Algorithm Hash digest
SHA256 148409e9d77ba3b52abee4e961ef2273310671d3fe63e2747c0708e3fcf7aa8f
MD5 169ade9ada26c0825880389549cb2402
BLAKE2b-256 ad9900331437ca9d23308f9d76c16b8dfd23c261bf43e7b33cf5ae21666ffc28

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page