Example #1
0
def generate_target_documentation(outdir):
    targets_to_generate = [
        'generic_android', 'generic_linux', 'generic_chromeos',
        'generic_local', 'juno_linux', 'juno_android'
    ]

    intro = (
        '\nThis is a list of commonly used targets and their device '
        'parameters, to see a complete for a complete reference please use the'
        ' WA :ref:`list command <list-command>`.\n\n\n')

    pluginloader.clear()
    pluginloader.update(packages=['wa.framework.target.descriptor'])

    target_descriptors = list_target_descriptions(pluginloader)
    outfile = os.path.join(outdir, 'targets.rst')
    with open(outfile, 'w') as wfh:
        wfh.write(underline('Common Targets'))
        wfh.write(intro)
        for td in sorted(target_descriptors, key=lambda t: t.name):
            if td.name not in targets_to_generate:
                continue
            text = underline(td.name, '~')
            if hasattr(td, 'description'):
                desc = strip_inlined_text(td.description or '')
                text += desc
            text += underline('Device Parameters:', '-')
            text += get_params_rst(td.conn_params)
            text += get_params_rst(td.platform_params)
            text += get_params_rst(td.target_params)
            text += get_params_rst(td.assistant_params)
            wfh.write(text)
def generate_target_documentation(outdir):
    targets_to_generate = ['generic_android',
                           'generic_linux',
                           'generic_chromeos',
                           'generic_local',
                           'juno_linux',
                           'juno_android']

    intro = '\nThis is a list of commonly used targets and their device '\
    'parameters, to see a complete for a complete reference please use the '\
    'WA :ref:`list command <list-command>`.\n\n\n'

    pluginloader.clear()
    pluginloader.update(packages=['wa.framework.target.descriptor'])

    target_descriptors = list_target_descriptions(pluginloader)
    outfile = os.path.join(outdir, 'targets.rst')
    with open(outfile, 'w') as wfh:
        wfh.write(underline('Common Targets'))
        wfh.write(intro)
        for td in sorted(target_descriptors, key=lambda t: t.name):
            if td.name not in targets_to_generate:
                continue
            text = underline(td.name, '~')
            if hasattr(td, 'description'):
                desc = strip_inlined_text(td.description or '')
                text += desc
            text += underline('Device Parameters:', '-')
            text += get_params_rst(td.conn_params)
            text += get_params_rst(td.platform_params)
            text += get_params_rst(td.target_params)
            text += get_params_rst(td.assistant_params)
            wfh.write(text)
Example #3
0
def get_rst_from_target(target):
    text = underline(target.name, '~')
    if hasattr(target, 'description'):
        desc = strip_inlined_text(target.description or '')
        text += desc
    text += underline('Device Parameters:', '-')
    text += get_params_rst(target.conn_params)
    text += get_params_rst(target.platform_params)
    text += get_params_rst(target.target_params)
    text += get_params_rst(target.assistant_params)
    text += '.. Note: For available runtime parameters please see the documentation'
    return text + '\n'
Example #4
0
def get_rst_from_target(target):
    text = underline(target.name, '~')
    if hasattr(target, 'description'):
        desc = strip_inlined_text(target.description or '')
        text += desc
    text += underline('Device Parameters:', '-')
    text += get_params_rst(target.conn_params)
    text += get_params_rst(target.platform_params)
    text += get_params_rst(target.target_params)
    text += get_params_rst(target.assistant_params)
    text += '.. Note: For available runtime parameters please see the documentation'
    return text + '\n'
Example #5
0
def generate_config_documentation(config, outdir):
    if not os.path.exists(outdir):
        os.mkdir(outdir)

    outfile = os.path.join(outdir, '{}.rst'.format('_'.join(config.name.split())))
    with open(outfile, 'w') as wfh:
        wfh.write(get_params_rst(config.config_points))
Example #6
0
def get_rst_for_global_config():
    text = underline('Global Configuration')
    text += 'These parameters control the behaviour of WA/run as a whole, they ' \
            'should be set inside a config file (either located in ' \
            '$WA_USER_DIRECTORY/config.yaml or one which is specified with -c), ' \
            'or into config/global section of the agenda.\n\n'

    cfg_points = MetaConfiguration.config_points + RunConfiguration.config_points
    text += get_params_rst(cfg_points)
    return text
Example #7
0
def get_rst_for_global_config():
    text = underline('Global Configuration')
    text += 'These parameters control the behaviour of WA/run as a whole, they ' \
            'should be set inside a config file (either located in ' \
            '$WA_USER_DIRECTORY/config.yaml or one which is specified with -c), ' \
            'or into config/global section of the agenda.\n\n'

    cfg_points = MetaConfiguration.config_points + RunConfiguration.config_points
    text += get_params_rst(cfg_points)
    return text