Example #1
0
def _format_op(op, model):
    description, details = util.split_description(op.description)
    return {
        "fullname":
        format_op_fullname(op.name, model.fullname),
        "description":
        description,
        "details":
        details,
        "model":
        model.fullname,
        "model_name":
        model.name,
        "name":
        op.name,
        "main":
        op.main,
        "flags": [
            "%s:%s%s" %
            (flag.name, _format_flag_desc(flag), _format_flag_default(flag))
            for flag in op.flags
        ],
        "_model":
        model,
    }
Example #2
0
def _format_model(model):
    modeldef = model.modeldef
    description, details = util.split_description(modeldef.description)
    return {
        "fullname": model.fullname,
        "name": modeldef.name,
        "source": modeldef.guildfile.src,
        "description": description,
        "details": details,
        "operations": ", ".join([op.name for op in modeldef.operations]),
    }
Example #3
0
def _format_op(op, model):
    description, details = util.split_description(op.description)
    return {
        "fullname":
        "%s:%s" % (model.fullname, op.name),
        "description":
        description,
        "details":
        details,
        "model":
        model.fullname,
        "name":
        op.name,
        "cmd":
        op.cmd,
        "flags": [
            "%s:%s%s" %
            (flag.name, _format_flag_desc(flag), _format_flag_value(flag))
            for flag in op.flags
        ]
    }