Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def get_language_converter(name):
    """Get a registered :class:`~babelfish.converters.LanguageConverter` by `name`

    If the converter was already loaded, it is returned from :data:`LANGUAGE_CONVERTERS` otherwise the
    entry point is searched for a matching converter.
    If a matching converter is found, it is registered and then returned.
    If no matching converter could be found, a ``KeyError`` is raised.

    :param string name: name of the language converter to get
    :return: the language converter
    :rtype: :class:`~babelfish.converters.LanguageConverter`
    :raise: KeyError if no matching converter could be found

    """
    if name in LANGUAGE_CONVERTERS:
        return LANGUAGE_CONVERTERS[name]
    for ep in iter_entry_points('babelfish.language_converters'):
        if ep.name == name:
            register_language_converter(name, ep.load())
            return LANGUAGE_CONVERTERS[name]
    raise KeyError(name)
        


src/s/u/subliminal-0.7.4/subliminal/converters/tvsubtitles.py   subliminal(Download)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from babelfish import LanguageReverseConverter, get_language_converter
 
 
class TVsubtitlesConverter(LanguageReverseConverter):
    def __init__(self):
        self.alpha2_converter = get_language_converter('alpha2')

src/s/u/subliminal-0.7.4/subliminal/converters/addic7ed.py   subliminal(Download)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from babelfish import LanguageReverseConverter, get_language_converter
 
 
class Addic7edConverter(LanguageReverseConverter):
    def __init__(self):
        self.name_converter = get_language_converter('name')