Fixes
This commit is contained in:
18
.gitignore
vendored
18
.gitignore
vendored
@@ -1,12 +1,14 @@
|
|||||||
**
|
**
|
||||||
!edge-playback.sh
|
# Directories
|
||||||
!edge-tts.py
|
!bin
|
||||||
!example
|
!bin/**
|
||||||
!example/**
|
!examples
|
||||||
!LICENSE
|
!examples/**
|
||||||
!README.md
|
|
||||||
!setup.py
|
|
||||||
!src
|
!src
|
||||||
!src/edgeTTS
|
!src/edgeTTS
|
||||||
!src/edgeTTS/**
|
!src/edgeTTS/**
|
||||||
!requirements.txt
|
# Files
|
||||||
|
!LICENSE
|
||||||
|
!README.md
|
||||||
|
!setup.cfg
|
||||||
|
!setup.py
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
src/edgeTTS/__init__.py
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
requests
|
|
||||||
websockets
|
|
||||||
32
setup.cfg
Normal file
32
setup.cfg
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
[metadata]
|
||||||
|
name = edge-tts
|
||||||
|
version = 0.0.4
|
||||||
|
author = rany
|
||||||
|
author_email = ranygh@riseup.net
|
||||||
|
description = Microsoft Edge's TTS
|
||||||
|
long_description = file: README.md
|
||||||
|
long_description_content_type = text/markdown
|
||||||
|
url = https://github.com/rany2/edge-tts
|
||||||
|
project_urls =
|
||||||
|
Bug Tracker=https://github.com/rany2/edge-tts/issues
|
||||||
|
classifiers =
|
||||||
|
Programming Language :: Python :: 3
|
||||||
|
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
||||||
|
Operating System :: OS Independent
|
||||||
|
|
||||||
|
[options]
|
||||||
|
package_dir=
|
||||||
|
= src
|
||||||
|
packages = find:
|
||||||
|
scripts = bin/edge-playback
|
||||||
|
python_requires = >=3.6
|
||||||
|
install_requires =
|
||||||
|
requests
|
||||||
|
websockets>=9.1
|
||||||
|
|
||||||
|
[options.packages.find]
|
||||||
|
where=src
|
||||||
|
|
||||||
|
[options.entry_points]
|
||||||
|
console_scripts =
|
||||||
|
edge-tts = edgeTTS.__init__:main
|
||||||
42
setup.py
42
setup.py
@@ -1,42 +1,2 @@
|
|||||||
import os
|
|
||||||
import shutil
|
|
||||||
import setuptools
|
import setuptools
|
||||||
|
setuptools.setup()
|
||||||
# make edge-tts script
|
|
||||||
scripts=['build/edge-tts']
|
|
||||||
if not os.path.exists('build'):
|
|
||||||
os.makedirs('build')
|
|
||||||
shutil.copyfile('src/edgeTTS/__init__.py', 'build/edge-tts')
|
|
||||||
if os.name == 'posix':
|
|
||||||
shutil.copyfile('edge-playback.sh', 'build/edge-playback')
|
|
||||||
scripts+=['build/edge-playback']
|
|
||||||
|
|
||||||
with open("README.md", "r", encoding="utf-8") as fh:
|
|
||||||
long_description = fh.read()
|
|
||||||
|
|
||||||
with open('requirements.txt') as f:
|
|
||||||
required = f.read().splitlines()
|
|
||||||
|
|
||||||
setuptools.setup(
|
|
||||||
name="edge-tts",
|
|
||||||
version="0.0.3",
|
|
||||||
author="rany",
|
|
||||||
author_email="ranygh@riseup.net",
|
|
||||||
description="Microsoft Edge's TTS",
|
|
||||||
long_description=long_description,
|
|
||||||
long_description_content_type="text/markdown",
|
|
||||||
url="https://github.com/rany2/edge-tts",
|
|
||||||
project_urls={
|
|
||||||
"Bug Tracker": "https://github.com/rany2/edge-tts/issues",
|
|
||||||
},
|
|
||||||
classifiers=[
|
|
||||||
"Programming Language :: Python :: 3",
|
|
||||||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
|
||||||
"Operating System :: OS Independent",
|
|
||||||
],
|
|
||||||
package_dir={"": "src"},
|
|
||||||
packages=setuptools.find_packages(where="src"),
|
|
||||||
scripts=scripts,
|
|
||||||
python_requires=">=3.6",
|
|
||||||
install_requires=required,
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ def _minimize(the_string, delim, max_size):
|
|||||||
else:
|
else:
|
||||||
return [the_string]
|
return [the_string]
|
||||||
|
|
||||||
async def main():
|
async def _main():
|
||||||
parser = argparse.ArgumentParser(description="Microsoft Edge's Online TTS Reader")
|
parser = argparse.ArgumentParser(description="Microsoft Edge's Online TTS Reader")
|
||||||
group = parser.add_mutually_exclusive_group(required=True)
|
group = parser.add_mutually_exclusive_group(required=True)
|
||||||
group.add_argument('-t', '--text', help='what TTS will say')
|
group.add_argument('-t', '--text', help='what TTS will say')
|
||||||
@@ -147,8 +147,11 @@ async def main():
|
|||||||
print("%s: %s" % ("Name" if key == "ShortName" else key, voice[key]))
|
print("%s: %s" % ("Name" if key == "ShortName" else key, voice[key]))
|
||||||
seperator = True
|
seperator = True
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def terminator(signo, stack_frame): sys.exit()
|
||||||
def terminator(signo, stack_frame): sys.exit()
|
def main():
|
||||||
signal.signal(signal.SIGINT, terminator)
|
signal.signal(signal.SIGINT, terminator)
|
||||||
signal.signal(signal.SIGTERM, terminator)
|
signal.signal(signal.SIGTERM, terminator)
|
||||||
asyncio.get_event_loop().run_until_complete(main())
|
asyncio.get_event_loop().run_until_complete(_main())
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|||||||
BIN
src/edgeTTS/__pycache__/__init__.cpython-39.pyc
Normal file
BIN
src/edgeTTS/__pycache__/__init__.cpython-39.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user