def version(): """Return version information for front and backends""" # version of the phonemizer version = ('phonemizer-' + pkg_resources.get_distribution('phonemizer').version) # for each backend, check if it is available or not. If so get its version available = [] unavailable = [] if EspeakBackend.is_available(): available.append('espeak-' + ('ng-' if EspeakBackend.is_espeak_ng() else '') + EspeakBackend.version()) else: # pragma: nocover unavailable.append('espeak') if FestivalBackend.is_available(): available.append('festival-' + FestivalBackend.version()) else: # pragma: nocover unavailable.append('festival') if SegmentsBackend.is_available(): available.append('segments-' + SegmentsBackend.version()) else: # pragma: nocover unavailable.append('segments') # resumes the backends status in the final version string if available: version += '\navailable backends: ' + ', '.join(available) if unavailable: # pragma: nocover version += '\nuninstalled backends: ' + ', '.join(unavailable) return version
def version(): """Return version information for front and backends""" version = ('phonemizer-' + pkg_resources.get_distribution('phonemizer').version) return version + '\navailable backends: ' + ', '.join( ('festival-' + FestivalBackend.version(), ('espeak-' + ('ng-' if EspeakBackend.is_espeak_ng() else '') + EspeakBackend.version()), 'segments-' + SegmentsBackend.version()))