From d6fddec92bf897a4d32ccb6119b763fcefb24451 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 25 Sep 2017 13:53:50 -0400 Subject: [PATCH] updates Signed-off-by: Kenneth Reitz --- Pipfile | 3 ++- Pipfile.lock | 23 +++++++++++++++++++- README.rst | 48 ++++++++++++++++++++++++++++++++++++++++- click_tools/__init__.py | 1 + 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index a57e038..56cb101 100644 --- a/Pipfile +++ b/Pipfile @@ -6,4 +6,5 @@ name = "pypi" [dev-packages] [packages] -"e1839a8" = {path = ".", editable = true} \ No newline at end of file +"e1839a8" = {path = ".", editable = true} +click = "*" \ No newline at end of file diff --git a/Pipfile.lock b/Pipfile.lock index 87715dc..5a89620 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3fac0b64df22d047d7bc921ea8a8d255c15de0b8f305124f46b14f220e6fc905" + "sha256": "33cb85232dceab06582cd0ef5882cb391e8f6f3adc7242e1260489a7ba879bf1" }, "host-environment-markers": { "implementation_name": "cpython", @@ -34,6 +34,27 @@ ], "version": "==1.4.3" }, + "click": { + "hashes": [ + "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", + "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" + ], + "version": "==6.7" + }, + "colorama": { + "hashes": [ + "sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda", + "sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1" + ], + "version": "==0.3.9" + }, + "crayons": { + "hashes": [ + "sha256:6f51241d0c4faec1c04c1c0ac6a68f1d66a4655476ce1570b3f37e5166a599cc", + "sha256:5e17691605e564d63482067eb6327d01a584bbaf870beffd4456a3391bd8809d" + ], + "version": "==0.1.2" + }, "e1839a8": { "editable": true, "path": "." diff --git a/README.rst b/README.rst index 5c314d6..171b21f 100644 --- a/README.rst +++ b/README.rst @@ -1 +1,47 @@ -# click-tools +click-tools +=========== + +A collection of utilities (extracted from `clint `_), for use with Click. + +Examples +-------- + +Printing various colors:: + + import click + from click_tools import crayons + + click.echo( + '{red}{blue}{gren}'.format( + red=crayon.red('red'), + blue=crayon.blue('blue') + green=crayon.green('green') + ) + ) + + +Identation:: + + from click_tools import puts, indent + + puts('this is an example of text that is not indented') + with indent(4): + puts('This is indented text.') + + +Columns:: + + >>> from click_tools import cols + + >>> a = ( + 'a very long string that requires text-wrapping in order to be ' + 'printed correctly.' + ) + >>> b = 'this is other text\nothertext\nothertext' + + >>> click.echo(columns((a, 20), (b, 20), (b, None))) + a very long string this is other text this is other text + that requires othertext othertext + text-wrapping in othertext othertext + order to be printed + correctly. diff --git a/click_tools/__init__.py b/click_tools/__init__.py index f56fbd3..e610a21 100644 --- a/click_tools/__init__.py +++ b/click_tools/__init__.py @@ -4,5 +4,6 @@ from . import resources from . import utils from . import text from .cols import columns +from .text import * import crayons \ No newline at end of file