(args)
Configure Blocksat Receiver setup
Configure Blocksat Receiver setup
Configure Blocksat Receiver setup
def configure(args):
    """Configure Blocksat Receiver setup

    """
    cfg_file = _cfg_file_name(args.cfg, args.cfg_dir)
    rst_ok = _rst_cfg_file(cfg_file)
    if (not rst_ok):
        return

    try:
        user_sat = _cfg_satellite()
        user_setup = _cfg_rx_setup()
        user_lnb = _cfg_lnb(user_sat, user_setup)
        user_freqs = _cfg_frequencies(user_sat, user_lnb, user_setup)
    except KeyboardInterrupt:
        print("\nAbort")
        sys.exit(1)

    user_info = {
        'sat': user_sat,
        'setup': user_setup,
        'lnb': user_lnb,
        'freqs': user_freqs
    }

    logging.debug(pformat(user_info))

    if not os.path.exists(args.cfg_dir):
        os.makedirs(args.cfg_dir)

    # Channel configuration file
    if (user_setup['type'] == defs.linux_usb_setup_type):
        chan_file = os.path.join(args.cfg_dir, args.cfg + "-channel.conf")
        _cfg_chan_conf(user_info, chan_file)
        user_info['setup']['channel'] = chan_file

    # Create the JSON configuration file
    _write_cfg_file(cfg_file, user_info)

    os.system('clear')
    util.print_header("JSON configuration file")
    print("Saved configurations on %s" % (cfg_file))

    util.print_header("Next Steps")

    print(textwrap.fill("Please check setup instructions by running:"))
    print("""
    blocksat-cli instructions
    """)
def configure ( args ) : cfg_file = _cfg_file_name ( args . cfg , args . cfg_dir ) rst_ok = _rst_cfg_file ( cfg_file ) if ( not rst_ok ) : return try : user_sat = _cfg_satellite ( ) user_setup = _cfg_rx_setup ( ) user_lnb = _cfg_lnb ( user_sat , user_setup ) user_freqs = _cfg_frequencies ( user_sat , user_lnb , user_setup ) except KeyboardInterrupt : print ( "\nAbort" ) sys . exit ( 1 ) user_info = { 'sat' : user_sat , 'setup' : user_setup , 'lnb' : user_lnb , 'freqs' : user_freqs } logging . debug ( pformat ( user_info ) ) if not os . path . exists ( args . cfg_dir ) : os . makedirs ( args . cfg_dir ) # Channel configuration file if ( user_setup [ 'type' ] == defs . linux_usb_setup_type ) : chan_file = os . path . join ( args . cfg_dir , args . cfg + "-channel.conf" ) _cfg_chan_conf ( user_info , chan_file ) user_info [ 'setup' ] [ 'channel' ] = chan_file # Create the JSON configuration file _write_cfg_file ( cfg_file , user_info ) os . system ( 'clear' ) util . print_header ( "JSON configuration file" ) print ( "Saved configurations on %s" % ( cfg_file ) ) util . print_header ( "Next Steps" ) print ( textwrap . fill ( "Please check setup instructions by running:" ) ) print ( """
    blocksat-cli instructions
    """ )