renamed STT_SERVICES to SERVIES

This commit is contained in:
2019-02-20 11:21:33 -05:00
parent af63c053a6
commit 2a3b85a8b5
4 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ with open('README.md') as file:
setup( setup(
name="tatt", name="tatt",
version="0.941", version="0.942",
py_modules=['tatt'], py_modules=['tatt'],
url='https://github.com/zevaverbach/tatt', url='https://github.com/zevaverbach/tatt',
install_requires=[ install_requires=[

View File

@@ -15,7 +15,7 @@ def make_string_all_services(free_only=False):
format_fill = "free " format_fill = "free "
all_services_string = all_services_string_formatter.format(format_fill) all_services_string = all_services_string_formatter.format(format_fill)
for service_name, module in vendors.STT_SERVICES.items(): for service_name, module in vendors.SERVICES.items():
if free_only and module.cost_per_15_seconds > 0: if free_only and module.cost_per_15_seconds > 0:
continue continue
all_services_string += ( all_services_string += (
@@ -26,7 +26,7 @@ def make_string_all_services(free_only=False):
def get_service(service_name): def get_service(service_name):
module = vendors.STT_SERVICES[service_name] module = vendors.SERVICES[service_name]
return getattr(module, config.SERVICE_CLASS_NAME) return getattr(module, config.SERVICE_CLASS_NAME)
@@ -55,7 +55,7 @@ def print_transcription_jobs(jobs):
def get_transcription_jobs(service_name=None, name=None, status=None): def get_transcription_jobs(service_name=None, name=None, status=None):
all_jobs = {} all_jobs = {}
for stt_name in vendors.STT_SERVICES: for stt_name in vendors.SERVICES:
if service_name is None or service_name == stt_name: if service_name is None or service_name == stt_name:
service = get_service(stt_name) service = get_service(stt_name)
service._setup() # check for AWS credentials and create buckets service._setup() # check for AWS credentials and create buckets

View File

@@ -39,7 +39,7 @@ def get(name, file):
@click.option('--status', type=str, help="completed | failed | in_progress") @click.option('--status', type=str, help="completed | failed | in_progress")
def list(name, service, status): def list(name, service, status):
"""Lists available STT services.""" """Lists available STT services."""
if service is not None and service not in vendors.STT_SERVICES: if service is not None and service not in vendors.SERVICES:
raise click.ClickException(f'no such service: {service}') raise click.ClickException(f'no such service: {service}')
try: try:
@@ -67,7 +67,7 @@ def services(free_only):
@click.argument('service_name', type=str) @click.argument('service_name', type=str)
def this(dry_run, media_filepath, service_name): def this(dry_run, media_filepath, service_name):
"""Sends a media file to be transcribed.""" """Sends a media file to be transcribed."""
if service_name not in vendors.STT_SERVICES: if service_name not in vendors.SERVICES:
print() print()
raise click.ClickException( raise click.ClickException(
f'No such service! {print_all_services(print_=False)}') f'No such service! {print_all_services(print_=False)}')

View File

@@ -1,5 +1,5 @@
from tatt.vendors import amazon from tatt.vendors import amazon
STT_SERVICES = { SERVICES = {
'amazon': amazon, 'amazon': amazon,
} }