Пример #1
0
def make_bracket_dropdowns(meta, transWords, categoryName, key1, key2,
                           possibilities1, possibilities2, dict,
                           noHindi=False):
    dict1 = ryw_hindi.dict_size4_hindi_html(transWords)
    dict.update(dict1)

    val1,val2 = ['unknown', 'unknown']
    if meta.has_key(categoryName):
        try:
            val1,val2 = meta[categoryName]
        except:
            val1,val2 = ['unknown', 'unknown']

    optStr1,hindiOptStr1 = make_options_strings(possibilities1, val1,
                                                noHindi=noHindi)
    optStr2,hindiOptStr2 = make_options_strings(possibilities2, val2,
                                                noHindi=noHindi)

    #
    # replace %(age_from_options)s
    # and %(hindi_age_from_options)s
    #
    dict[key1 + '_options'] = optStr1
    dict[key2 + '_options'] = optStr2
    if not noHindi:
        dict['hindi_' + key1 + '_options'] = hindiOptStr1
        dict['hindi_' + key2 + '_options'] = hindiOptStr2
def specify_search_script(scriptName):
    dict = ryw_customize.dict
    dict['year'] = ryw.get_year()
    dict['search_script'] = scriptName
    dictTrans = ryw_hindi.dict_size4_hindi_html(['search_author',
                                                 'enter_author'])
    dictTrans2 = ryw_hindi.dict_hindi(['search'])
    dict.update(dictTrans)
    dict.update(dictTrans2)
    return pageStr % dict
Пример #3
0
def make_form_dropdown(meta, transWords, categoryName, possibilities, dict,
                       noHindi=False):
    dict1 = ryw_hindi.dict_size4_hindi_html(transWords)
    dict.update(dict1)

    value = 'unknown'
    if meta.has_key(categoryName):
        value = meta[categoryName]
    if value == '':
        value = 'unknown'

    optionString,hindiOptionString = make_options_strings(
        possibilities, value, noHindi=noHindi)

    #
    # replaces %(content_type_options)s
    # and %(hindi_content_type_options)s
    #
    dict[categoryName + '_options'] = optionString
    if not noHindi:
        dict['hindi_' + categoryName + '_options'] = hindiOptionString