Replace shell script with console scripts
This commit is contained in:
parent
a7a5f6adb8
commit
f9ec8cba39
3 changed files with 8 additions and 14 deletions
11
bin/colout
11
bin/colout
|
|
@ -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 "$@"
|
|
||||||
|
|
@ -927,8 +927,8 @@ def write_all( as_all, stream_in, stream_out, function, *args ):
|
||||||
map_write( 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}
|
error_codes = {"UnknownColor":1, "DuplicatedPalette":2, "MixedModes":3}
|
||||||
|
|
||||||
usage = "A regular expression based formatter that color up an arbitrary text stream."
|
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 )
|
+ " Check the following 'color:mode' pairs: %s." % e )
|
||||||
sys.exit( error_codes["MixedModes"] )
|
sys.exit( error_codes["MixedModes"] )
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
|
||||||
4
setup.py
4
setup.py
|
|
@ -36,6 +36,9 @@ setup(
|
||||||
use_scm_version=True,
|
use_scm_version=True,
|
||||||
classifiers=classifiers,
|
classifiers=classifiers,
|
||||||
description='Color Up Arbitrary Command Output.',
|
description='Color Up Arbitrary Command Output.',
|
||||||
|
entry_points={
|
||||||
|
'console_scripts': ['colout=colout.colout:main'],
|
||||||
|
},
|
||||||
long_description=open('README.md').read(),
|
long_description=open('README.md').read(),
|
||||||
author='nojhan',
|
author='nojhan',
|
||||||
author_email='nojhan@nojhan.net',
|
author_email='nojhan@nojhan.net',
|
||||||
|
|
@ -43,7 +46,6 @@ setup(
|
||||||
packages=packages,
|
packages=packages,
|
||||||
package_data={'': ['LICENSE', 'README.md']},
|
package_data={'': ['LICENSE', 'README.md']},
|
||||||
package_dir={'colout': 'colout'},
|
package_dir={'colout': 'colout'},
|
||||||
scripts=['bin/colout'],
|
|
||||||
setup_requires=setup_requires,
|
setup_requires=setup_requires,
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=requires,
|
install_requires=requires,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue