mirror of
https://github.com/not-kennethreitz/click-tools.git
synced 2026-06-05 23:20:19 +00:00
@@ -6,4 +6,5 @@ name = "pypi"
|
||||
[dev-packages]
|
||||
|
||||
[packages]
|
||||
"e1839a8" = {path = ".", editable = true}
|
||||
"e1839a8" = {path = ".", editable = true}
|
||||
click = "*"
|
||||
Generated
+22
-1
@@ -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": "."
|
||||
|
||||
+47
-1
@@ -1 +1,47 @@
|
||||
# click-tools
|
||||
click-tools
|
||||
===========
|
||||
|
||||
A collection of utilities (extracted from `clint <https://github.com/kennethreitz/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.
|
||||
|
||||
@@ -4,5 +4,6 @@ from . import resources
|
||||
from . import utils
|
||||
from . import text
|
||||
from .cols import columns
|
||||
from .text import *
|
||||
|
||||
import crayons
|
||||
Reference in New Issue
Block a user