tts_manager/tts.py
def download_file(filesystem, ident, save_type):
    """Attempt to download all files for a given savefile"""
    log = logger()
    log.info("Downloading %s file %s (from %s)" %
             (save_type.name, ident, filesystem))
    filename = filesystem.get_json_filename_for_type(ident, save_type)
    if not filename:
        log.error("Unable to find data file.")
        return False
    try:
        data = load_json_file(filename)
    except IOError as e:
        log.error("Unable to read data file %s (%s)" % (filename, e))
        return False
    if not data:
        log.error("Unable to read data file %s" % filename)
        return False

    save = Save(savedata=data,
                filename=filename,
                ident=ident,
                save_type=save_type,
                filesystem=filesystem)

    if save.isInstalled:
        log.info("All files already downloaded.")
        return True

    successful = save.download()
    if successful:
        log.info("All files downloaded.")
    else:
        log.info("Some files failed to download.")
    return successful
Attempt to download all files for a given savefile
Attempt to download all files for a given savefile
Attempt to download all files for a given savefile
def download_file(filesystem, ident, save_type):
    log = logger()
    log.info("Downloading %s file %s (from %s)" %
             (save_type.name, ident, filesystem))
    filename = filesystem.get_json_filename_for_type(ident, save_type)
    if not filename:
        log.error("Unable to find data file.")
        return False
    try:
        data = load_json_file(filename)
    except IOError as e:
        log.error("Unable to read data file %s (%s)" % (filename, e))
        return False
    if not data:
        log.error("Unable to read data file %s" % filename)
        return False
    save = Save(savedata=data,
                filename=filename,
                ident=ident,
                save_type=save_type,
                filesystem=filesystem)
    if save.isInstalled:
        log.info("All files already downloaded.")
        return True
    successful = save.download()
    if successful:
        log.info("All files downloaded.")
    else:
        log.info("Some files failed to download.")
    return successful
def download_file ( filesystem , ident , save_type ) : log = logger ( ) log . info ( "Downloading %s file %s (from %s)" % ( save_type . name , ident , filesystem ) ) filename = filesystem . get_json_filename_for_type ( ident , save_type ) if not filename : log . error ( "Unable to find data file." ) return False try : data = load_json_file ( filename ) except IOError as e : log . error ( "Unable to read data file %s (%s)" % ( filename , e ) ) return False if not data : log . error ( "Unable to read data file %s" % filename ) return False save = Save ( savedata = data , filename = filename , ident = ident , save_type = save_type , filesystem = filesystem ) if save . isInstalled : log . info ( "All files already downloaded." ) return True successful = save . download ( ) if successful : log . info ( "All files downloaded." ) else : log . info ( "Some files failed to download." ) return successful
Attempt to download all files for a given savefile
Attempt to download all files for a given savefile
"""Attempt to download all files for a given savefile"""
filesystem
ident
save_type