Replace shell script with console scripts

This commit is contained in:
Oliver Bristow 2018-08-04 20:18:21 +01:00 committed by Oliver Bristow
commit f9ec8cba39
No known key found for this signature in database
GPG key ID: FF13F04BD2C87186
3 changed files with 8 additions and 14 deletions

View file

@ -1,11 +0,0 @@
#!/bin/bash
# Copyright (c) 2013 Martin Ueding <dev@martin-ueding.de>
# Small launcher script for the main module.
# Licence: GPL 3
set -e
set -u
python3 -m colout.colout "$@"

View file

@ -927,8 +927,8 @@ def write_all( as_all, stream_in, stream_out, function, *args ):
map_write( stream_in, stream_out, function, *args )
if __name__ == "__main__":
def main():
global context
error_codes = {"UnknownColor":1, "DuplicatedPalette":2, "MixedModes":3}
usage = "A regular expression based formatter that color up an arbitrary text stream."
@ -1108,3 +1108,6 @@ if __name__ == "__main__":
+ " Check the following 'color:mode' pairs: %s." % e )
sys.exit( error_codes["MixedModes"] )
if __name__ == "__main__":
main()

View file

@ -36,6 +36,9 @@ setup(
use_scm_version=True,
classifiers=classifiers,
description='Color Up Arbitrary Command Output.',
entry_points={
'console_scripts': ['colout=colout.colout:main'],
},
long_description=open('README.md').read(),
author='nojhan',
author_email='nojhan@nojhan.net',
@ -43,7 +46,6 @@ setup(
packages=packages,
package_data={'': ['LICENSE', 'README.md']},
package_dir={'colout': 'colout'},
scripts=['bin/colout'],
setup_requires=setup_requires,
include_package_data=True,
install_requires=requires,