コード例 #1
0
ファイル: dashboard.py プロジェクト: alex-silva/pootle
def optional_depcheck():
    optional = []

    if not depcheck.test_unzip():
        optional.append({
            'dependency': 'unzip',
            'text': _('Can\'t find the unzip command. Uploading archives is '
                      'faster if "unzip" is available.')
        })
    if not depcheck.test_iso_codes():
        optional.append({
            'dependency': 'iso-codes',
            'text': _("Can't find the ISO codes package. Pootle uses ISO codes"
                      " to translate language names.")
        })
    if not depcheck.test_gaupol():
        optional.append({
            'dependency': 'gaupol',
            'text': _("Can't find the aeidon package. Pootle requires Gaupol "
                      "or aeidon to support subtitle formats.")
        })
    if not depcheck.test_levenshtein():
        optional.append({
            'dependency': 'levenshtein',
            'text': _("Can't find python-levenshtein package. Updating against"
                      " templates is faster with python-levenshtein.")
        })
    if not depcheck.test_indexer():
        optional.append({
            'dependency': 'indexer',
            'text': _("No text indexing engine found. Searching is faster if "
                      "an indexing engine like Xapian or Lucene is installed.")
        })

    filter_name, filter_args = get_markup_filter()
    if filter_name is None:
        text = None
        if filter_args == 'missing':
            text = _("MARKUP_FILTER is missing. Falling back to HTML.")
        elif filter_args == 'misconfigured':
            text = _("MARKUP_FILTER is misconfigured. Falling back to HTML.")
        elif filter_args == 'uninstalled':
            text = _("Can't find the package which provides '%s' markup "
                     "support. Falling back to HTML.",
                     settings.MARKUP_FILTER[0])
        elif filter_args == 'invalid':
            text = _("Invalid value '%s' in MARKUP_FILTER. Falling back to "
                     "HTML.", settings.MARKUP_FILTER[0])

        if text is not None:
            optional.append({
                'dependency': filter_args + '-markup',
                'text': text
            })

    return optional
コード例 #2
0
def optional_depcheck():
    optional = []

    if not depcheck.test_unzip():
        optional.append({
            'dependency': 'unzip',
            'text': _('Can\'t find the unzip command. Uploading archives is '
                      'faster if "unzip" is available.')
        })
    if not depcheck.test_iso_codes():
        optional.append({
            'dependency': 'iso-codes',
            'text': _("Can't find the ISO codes package. Pootle uses ISO codes"
                      " to translate language names.")
        })
    if not depcheck.test_gaupol():
        optional.append({
            'dependency': 'gaupol',
            'text': _("Can't find the aeidon package. Pootle requires Gaupol "
                      "or aeidon to support subtitle formats.")
        })
    if not depcheck.test_levenshtein():
        optional.append({
            'dependency': 'levenshtein',
            'text': _("Can't find python-levenshtein package. Updating against"
                      " templates is faster with python-levenshtein.")
        })
    if not depcheck.test_indexer():
        optional.append({
            'dependency': 'indexer',
            'text': _("No text indexing engine found. Searching is faster if "
                      "an indexing engine like Xapian or Lucene is installed.")
        })

    filter_name, filter_args = get_markup_filter()
    if filter_name is None:
        text = None
        if filter_args == 'missing':
            text = _("MARKUP_FILTER is missing. Falling back to HTML.")
        elif filter_args == 'misconfigured':
            text = _("MARKUP_FILTER is misconfigured. Falling back to HTML.")
        elif filter_args == 'uninstalled':
            text = _("Can't find the package which provides '%s' markup "
                     "support. Falling back to HTML.",
                     settings.MARKUP_FILTER[0])
        elif filter_args == 'invalid':
            text = _("Invalid value '%s' in MARKUP_FILTER. Falling back to "
                     "HTML.", settings.MARKUP_FILTER[0])

        if text is not None:
            optional.append({
                'dependency': filter_args + '-markup',
                'text': text
            })

    return optional
コード例 #3
0
def optional_depcheck():
    optional = []

    if not depcheck.test_iso_codes():
        optional.append({
            'dependency':
            'iso-codes',
            'text':
            _("Can't find the ISO codes package. Pootle uses ISO codes"
              " to translate language names.")
        })
    if not depcheck.test_levenshtein():
        optional.append({
            'dependency':
            'levenshtein',
            'text':
            _("Can't find python-levenshtein package. Updating against"
              " templates is faster with python-levenshtein.")
        })

    filter_name, filter_args = get_markup_filter()
    if filter_name is None:
        text = None
        if filter_args == 'missing':
            text = _("MARKUP_FILTER is missing. Falling back to HTML.")
        elif filter_args == 'misconfigured':
            text = _("MARKUP_FILTER is misconfigured. Falling back to HTML.")
        elif filter_args == 'uninstalled':
            text = _(
                "Can't find the package which provides '%s' markup "
                "support. Falling back to HTML.", settings.MARKUP_FILTER[0])
        elif filter_args == 'invalid':
            text = _(
                "Invalid value '%s' in MARKUP_FILTER. Falling back to "
                "HTML.", settings.MARKUP_FILTER[0])

        if text is not None:
            optional.append({
                'dependency': filter_args + '-markup',
                'text': text
            })

    return optional
コード例 #4
0
ファイル: dashboard.py プロジェクト: bluemutedwisdom/pootle
def optional_depcheck():
    optional = []

    if not depcheck.test_iso_codes():
        optional.append({
            'dependency': 'iso-codes',
            'text': _("Can't find the ISO codes package. Pootle uses ISO codes"
                      " to translate language names.")
        })
    if not depcheck.test_levenshtein():
        optional.append({
            'dependency': 'levenshtein',
            'text': _("Can't find python-levenshtein package. Updating against"
                      " templates is faster with python-levenshtein.")
        })

    filter_name, filter_args = get_markup_filter()
    if filter_name is None:
        text = None
        if filter_args == 'missing':
            text = _("MARKUP_FILTER is missing. Falling back to HTML.")
        elif filter_args == 'misconfigured':
            text = _("MARKUP_FILTER is misconfigured. Falling back to HTML.")
        elif filter_args == 'uninstalled':
            text = _("Can't find the package which provides '%s' markup "
                     "support. Falling back to HTML.",
                     settings.MARKUP_FILTER[0])
        elif filter_args == 'invalid':
            text = _("Invalid value '%s' in MARKUP_FILTER. Falling back to "
                     "HTML.", settings.MARKUP_FILTER[0])

        if text is not None:
            optional.append({
                'dependency': filter_args + '-markup',
                'text': text
            })

    return optional