[Python-modules-commits] [gtts] 05/07: Remove CLI binary
Ethan Ward
ethanward-guest at moszumanska.debian.org
Tue Jul 25 17:07:38 UTC 2017
This is an automated email from the git hooks/post-receive script.
ethanward-guest pushed a commit to branch master
in repository gtts.
commit 3f1d694863933d1be25ab47809cbc5aae7ba60ab
Author: Ethan Ward <ethan.ward at mycroft.ai>
Date: Tue Jul 25 12:05:13 2017 -0500
Remove CLI binary
---
bin/gtts-cli | 4 ----
bin/gtts-cli.py | 52 ----------------------------------------------------
setup.py | 2 +-
3 files changed, 1 insertion(+), 57 deletions(-)
diff --git a/bin/gtts-cli b/bin/gtts-cli
deleted file mode 100755
index dc25393..0000000
--- a/bin/gtts-cli
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-DIR="$( cd "$( dirname "$0" )" && pwd )"
-PYTHON=$(which python)
-exec $PYTHON $DIR/gtts-cli.py "$@"
diff --git a/bin/gtts-cli.py b/bin/gtts-cli.py
deleted file mode 100755
index f3657d0..0000000
--- a/bin/gtts-cli.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#! /usr/bin/python
-
-from __future__ import print_function
-from gtts import gTTS
-from gtts import __version__
-import sys
-import argparse
-import os
-import codecs
-
-def languages():
- """Sorted pretty printed string of supported languages"""
- return ", ".join(sorted("{}: '{}'".format(gTTS.LANGUAGES[k], k) for k in gTTS.LANGUAGES))
-
-# Args
-desc = "Creates an mp3 file from spoken text via the Google Text-to-Speech API ({v})".format(v=__version__)
-parser = argparse.ArgumentParser(description=desc, formatter_class=argparse.RawTextHelpFormatter)
-
-text_group = parser.add_mutually_exclusive_group(required=True)
-text_group.add_argument('text', nargs='?', help="text to speak")
-text_group.add_argument('-f', '--file', help="file to speak")
-
-parser.add_argument("-o", '--destination', help="destination mp3 file", action='store')
-parser.add_argument('-l', '--lang', default='en', help="ISO 639-1/IETF language tag to speak in:\n" + languages())
-parser.add_argument('--slow', action="store_true", help="slower read speed")
-parser.add_argument('--debug', action="store_true")
-
-args = parser.parse_args()
-
-try:
- if args.text:
- if args.text == "-":
- text = sys.stdin.read()
- else:
- text = args.text
- else:
- with codecs.open(args.file, "r", "utf-8") as f:
- text = f.read()
-
- # TTSTF (Text to Speech to File)
- tts = gTTS(text=text, lang=args.lang, slow=args.slow, debug=args.debug)
-
- if args.destination:
- tts.save(args.destination)
- else:
- tts.write_to_fp(os.fdopen(sys.stdout.fileno(), "wb"))
-except Exception as e:
- if args.destination:
- print(str(e))
- else:
- print("ERROR: ", e, file=sys.stderr)
-
diff --git a/setup.py b/setup.py
index 533fdbb..da41d5b 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ setup(
author_email='pndurette at gmail.com',
url='https://github.com/pndurette/gTTS',
packages=['gtts'],
- scripts=['bin/gtts-cli', 'bin/gtts-cli.py'],
+ #scripts=['bin/gtts-cli', 'bin/gtts-cli.py'],
license='MIT',
description='Create an mp3 file from spoken text via the Google TTS (Text-to-Speech) API',
long_description=open('README.md').read(),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/gtts.git
More information about the Python-modules-commits
mailing list