Skip to content

Commit

Permalink
Merge pull request #12 from ltworf/master
Browse files Browse the repository at this point in the history
Various changes
  • Loading branch information
scottfrazer committed May 8, 2013
2 parents 1b0a9e4 + b6e4e0b commit d7efb32
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 500 deletions.
1 change: 0 additions & 1 deletion README

This file was deleted.

4 changes: 4 additions & 0 deletions xtermcolor/Main.py → scripts/xtermcolor
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
import sys, argparse
from xtermcolor.ColorMap import XTermColorMap, VT100ColorMap

Expand Down Expand Up @@ -50,3 +51,6 @@ def Cli():
start=cli.color, closest=rgb, ansi=ansi))
print("Example: " + colorizedMsg)
print("printf() string: " + cPrintfString(ansi))

if __name__=='__main__':
Cli()
16 changes: 3 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
import os

from xtermcolor import distribute_setup
distribute_setup.use_setuptools()

from setuptools import setup
from distutils.core import setup

version = '1.2.1'
README = os.path.join(os.path.dirname(__file__), 'README')
long_description = open(README).read()

setup(
name='xtermcolor',
version=version,
description=long_description,
description='Python module for colorizing output with xterm 256 color support',
author='Scott Frazer',
author_email='sfrazer@broadinstitute.org',
packages=['xtermcolor'],
package_data={'xtermcolor': ['distribute_setup.py']},
install_requires=[],
entry_points={
'console_scripts': [
'xtermcolor = xtermcolor.Main:Cli'
]
},
scripts=['scripts/xtermcolor'],
license = "MIT",
keywords = "xterm, ANSI, xterm-256, terminal, color",
url = "http://github.com/broadinstitute/xtermcolor",
Expand Down
2 changes: 1 addition & 1 deletion xtermcolor/ColorMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def convert(self, hexcolor):
def colorize(self, string, rgb=None, ansi=None,bg=None,ansi_bg=None):
'''Returns the colored string'''
if not isinstance(string,str):
raise TerminalColorMapException('String is not of <str> type')
string = str(string)
if rgb is None and ansi is None:
raise TerminalColorMapException('colorize: must specify one named parameter: rgb or ansi')
if rgb is not None and ansi is not None:
Expand Down
Loading

0 comments on commit d7efb32

Please sign in to comment.