summaryrefslogtreecommitdiffstats
path: root/external_libs/python/termstyle/python-termstyle.xml
blob: b6b08bd7270d7455e0c176fbe2965aa050f75945 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='interface.xsl'?>
<interface xmlns="http://zero-install.sourceforge.net/2004/injector/interface" uri="http://gfxmonk.net/dist/0install/python-termstyle.xml">
	<name>termstyle</name>
	<summary>console colouring for python</summary>
	<homepage>http://github.com/gfxmonk/termstyle</homepage>
	<description>
=========
termstyle
=========

termstyle is a simple python library for adding coloured output to
terminal (console) programs.  The definitions come from ECMA-048_, the
"Control Functions for Coded Character Sets" standard.

Installation:
-------------

I thoroughly recommend using the zero-install feed (see the project homepage) to manage your dependencies if at all possible. zero-install_ provides a much better system than pip or easy_install, and works with absolutely any language and allows decentralised package management that requires no special privileges to install.

Example Usage:
--------------
::

	from termstyle import *
	print "%s:%s" % (red('Hey'), green('how are you?'))
	print blue('How ', bold('you'), ' doin?')

or, you can use a colour just as a string::

	print "%sBlue!%s" % (blue, reset)

Styles:
-------
::

	reset or default (no colour / style)

colour::

	black
	red
	green
	yellow
	blue
	magenta
	cyan
	white

background colour::

	bg_black
	bg_red
	bg_green
	bg_yellow
	bg_blue
	bg_magenta
	bg_cyan
	bg_white
	bg_default

In terminals supporting transparency ``bg_default`` is often used to set
the background to transparent [#]_.

weight::

	bold
	inverted

style::

	italic
	underscore

Controls:
---------
::

	auto() - sets colouring on only if sys.stdout is a terminal
	disabe() - disable colours
	enable() - enable colours

.. [#] Supporting terminals include rxvt-unicode_, and Eterm_.

.. _ECMA-048: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
.. _rxvt-unicode: http://software.schmorp.de/
.. _Eterm: http://www.eterm.org/
.. _zero-install: http://0install.net/

	</description>
	<pypi-extra xmlns="http://gfxmonk.net/dist/0install"><![CDATA[
	classifiers=[
		"License :: OSI Approved :: BSD License",
		"Programming Language :: Python",
		"Programming Language :: Python :: 3",
		"Intended Audience :: Developers",
		"Topic :: Software Development :: Libraries :: Python Modules",
	],
	keywords='output colour console ansi',
	license='BSD',
		]]></pypi-extra>
	<rich-description xmlns="http://gfxmonk.net/dist/0install">
		<div xmlns="http://www.w3.org/1999/xhtml">
			<h1 id="termstyle">termstyle</h1>
			<p>termstyle is a simple python library for adding coloured output to terminal (console) programs. The definitions come from <a href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf">ECMA-048</a>, the "Control Functions for Coded Character Sets" standard.</p>
			<h2 id="installation">Installation:</h2>
			<p>I thoroughly recommend using the zero-install feed (see the project homepage) to manage your dependencies if at all possible. <a href="http://0install.net/">zero-install</a> provides a much better system than pip or easy_install, and works with absolutely any language and allows decentralised package management that requires no special privileges to install.</p>
			<h2 id="example-usage">Example Usage:</h2>
			<pre><code>from termstyle import *
print "%s:%s" % (red('Hey'), green('how are you?'))
print blue('How ', bold('you'), ' doin?')
</code></pre>
			<p>or, you can use a colour just as a string:</p>
			<pre><code>print "%sBlue!%s" % (blue, reset)
</code></pre>
			<h2 id="styles">Styles:</h2>
			<pre><code>reset or default (no colour / style)
</code></pre>
			<p>colour:</p>
			<pre><code>black
red
green
yellow
blue
magenta
cyan
white
</code></pre>
			<p>background colour:</p>
			<pre><code>bg_black
bg_red
bg_green
bg_yellow
bg_blue
bg_magenta
bg_cyan
bg_white
bg_default
</code></pre>
			<p>In terminals supporting transparency <code>bg_default</code> is often used to set the background to transparent [#]_.</p>
			<p>weight:</p>
			<pre><code>bold
inverted
</code></pre>
			<p>style:</p>
			<pre><code>italic
underscore
</code></pre>
			<h2 id="controls">Controls:</h2>
			<pre><code>auto() - sets colouring on only if sys.stdout is a terminal
disabe() - disable colours
enable() - enable colours
</code></pre>
		</div>
	</rich-description>
	<group>
		<environment insert="" mode="prepend" name="PYTHONPATH"/>
		<implementation id="sha1new=1f5b66dcd48fa38740aa98bb2796f0adb7eeab04" released="2010-07-18" version="0.1.5">
			<manifest-digest sha256="9b0ff9b07c1d424484b5aa20fc2db7827a372d84515e8caf46b005f54a034e07"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.2.tgz" size="3114"/>
		</implementation>
		<implementation id="sha1new=9f728d8ba0eb5379c907b85a9662c54935f1e0ca" released="2010-11-05" version="0.1.6">
			<manifest-digest sha256="a7283c6fe262bc88ed270a91304da243c474d32353c2c9d6c6f4003bacfce27c"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.6.tgz" size="3607"/>
		</implementation>
		<implementation id="sha1new=93d781ad4b723d154462f990254f78d3bab7456e" released="2011-01-29" version="0.1.7">
			<manifest-digest sha256="31488cd005a3f9182e6738068a5e9ddfd6d28db370d8b0a0b16d5bbc53048665"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.7.tgz" size="4265"/>
		</implementation>
		<implementation id="sha1new=ada58698e40a6f11b40dbebaa11f70061b47172d" released="2011-03-15" version="0.1.8">
			<manifest-digest sha256="cbcee0509b194eec74a5fe923999b505293c5d0a20b3d79203fa6f47a942b24e"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.8.tgz" size="4312"/>
		</implementation>
		<implementation id="sha1new=e718d149b78028f3ac39ee4de42e0b7644ad48fb" released="2011-03-16" version="0.1.9">
			<manifest-digest sha256="ee3dc9b097ac0b7682fab8753a5dab45f0a9c189544c13a369ada8b9e1f4fde8"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.9.tgz" size="2901"/>
		</implementation>
		<implementation id="sha1new=0c4adef2eccc7ddcb48264c4bc2d84fcfa1072a4" released="2011-04-30" version="0.1.10">
			<manifest-digest sha256="df3b9e11077995f515239eb8382acdfa1741c35e867916917cf70ce53e49bd59"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.10.tgz" size="2903"/>
		</implementation>
	</group>
</interface>