(sat)
return {
        'vendor': "",
        'model': "",
        'in_range': custom_lnb_in_range,
        'lo_freq': custom_lnb_lo_freq,
        'universal': custom_lnb_universal,
        'band': custom_lnb_band,
        'pol': pol['id']
    }
Configure custom LNB based on user-entered specs

    Args:
        sat : user's satellite info
Configure custom LNB based on user-entered specs
Configure custom LNB based on user - entered specs
def _cfg_custom_lnb(sat):
    """Configure custom LNB based on user-entered specs

    Args:
        sat : user's satellite info

    """

    print("\nPlease, inform the specifications of your LNB:")

    bands = ["C", "Ku"]
    question = "Frequency band:"
    custom_lnb_band = util.ask_multiple_choice(bands, question, "Band",
                                               lambda x: '{}'.format(x))

    if (sat['band'].lower() != custom_lnb_band.lower()):
        logging.error("You must use a %s band LNB to receive from %s" %
                      (sat['band'], sat['name']))
        sys.exit(1)

    if (custom_lnb_band == "Ku"):
        custom_lnb_universal = util.ask_yes_or_no(
            "Is it a Universal Ku band LNB?")

        if (custom_lnb_universal):
            # Input frequency range
            print()
            util.fill_print("""A Universal Ku band LNB typically covers an
            input frequency range from 10.7 to 12.75 GHz.""")
            if (util.ask_yes_or_no("Does your LNB cover this input range "
                                   "from 10.7 to 12.75 GHz?")):
                custom_lnb_in_range = [10700.0, 12750.0]
            else:
                custom_lnb_in_range = _ask_lnb_freq_range()

            # LO
            print()
            util.fill_print("""A Universal Ku band LNB has two LO (local
            oscillator) frequencies. Typically the two frequencies are 9750
            MHz and 10600 MHz.""")
            if (util.ask_yes_or_no("Does your LNB have LO frequencies 9750 "
                                   "MHz and 10600 MHz?")):
                custom_lnb_lo_freq = [9750.0, 10600.0]
            else:
                custom_lnb_lo_freq = _ask_lnb_lo(single_lo=False)
        else:
            # Non-universal Ku-band LNB
            custom_lnb_in_range = _ask_lnb_freq_range()
            custom_lnb_lo_freq = _ask_lnb_lo()
    else:
        # C-band LNB
        custom_lnb_universal = False
        custom_lnb_in_range = _ask_lnb_freq_range()
        custom_lnb_lo_freq = _ask_lnb_lo()

    # Polarization
    question = "Choose the LNB polarization:"
    options = [{
        'id': "Dual",
        'text': "Dual polarization (horizontal and vertical)"
    }, {
        'id': "H",
        'text': "Horizontal"
    }, {
        'id': "V",
        'text': "Vertical"
    }]
    pol = util.ask_multiple_choice(options, question, "Polarization",
                                   lambda x: '{}'.format(x['text']))

    return {
        'vendor': "",
        'model': "",
        'in_range': custom_lnb_in_range,
        'lo_freq': custom_lnb_lo_freq,
        'universal': custom_lnb_universal,
        'band': custom_lnb_band,
        'pol': pol['id']
    }
def _cfg_custom_lnb ( sat ) : print ( "\nPlease, inform the specifications of your LNB:" ) bands = [ "C" , "Ku" ] question = "Frequency band:" custom_lnb_band = util . ask_multiple_choice ( bands , question , "Band" , lambda x : '{}' . format ( x ) ) if ( sat [ 'band' ] . lower ( ) != custom_lnb_band . lower ( ) ) : logging . error ( "You must use a %s band LNB to receive from %s" % ( sat [ 'band' ] , sat [ 'name' ] ) ) sys . exit ( 1 ) if ( custom_lnb_band == "Ku" ) : custom_lnb_universal = util . ask_yes_or_no ( "Is it a Universal Ku band LNB?" ) if ( custom_lnb_universal ) : # Input frequency range print ( ) util . fill_print ( """A Universal Ku band LNB typically covers an
            input frequency range from 10.7 to 12.75 GHz.""" ) if ( util . ask_yes_or_no ( "Does your LNB cover this input range " "from 10.7 to 12.75 GHz?" ) ) : custom_lnb_in_range = [ 10700.0 , 12750.0 ] else : custom_lnb_in_range = _ask_lnb_freq_range ( ) # LO print ( ) util . fill_print ( """A Universal Ku band LNB has two LO (local
            oscillator) frequencies. Typically the two frequencies are 9750
            MHz and 10600 MHz.""" ) if ( util . ask_yes_or_no ( "Does your LNB have LO frequencies 9750 " "MHz and 10600 MHz?" ) ) : custom_lnb_lo_freq = [ 9750.0 , 10600.0 ] else : custom_lnb_lo_freq = _ask_lnb_lo ( single_lo = False ) else : # Non-universal Ku-band LNB custom_lnb_in_range = _ask_lnb_freq_range ( ) custom_lnb_lo_freq = _ask_lnb_lo ( ) else : # C-band LNB custom_lnb_universal = False custom_lnb_in_range = _ask_lnb_freq_range ( ) custom_lnb_lo_freq = _ask_lnb_lo ( ) # Polarization question = "Choose the LNB polarization:" options = [ { 'id' : "Dual" , 'text' : "Dual polarization (horizontal and vertical)" } , { 'id' : "H" , 'text' : "Horizontal" } , { 'id' : "V" , 'text' : "Vertical" } ] pol = util . ask_multiple_choice ( options , question , "Polarization" , lambda x : '{}' . format ( x [ 'text' ] ) ) return { 'vendor' : "" , 'model' : "" , 'in_range' : custom_lnb_in_range , 'lo_freq' : custom_lnb_lo_freq , 'universal' : custom_lnb_universal , 'band' : custom_lnb_band , 'pol' : pol [ 'id' ] }