swm.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:genivi_swm 作者: GENIVI 项目源码 文件源码
def result(operation_id, code, text):
    """Encode a result

    This method encodes operation id, result code and result text into
    a dictionary of dbus types.

    @param operation_id Id of the operation for which the result is reported
    @param code Result code of the operation (one of SWMResult)
    @param text Text message

    @return Result dictionary using dbus types.
    """
    if not SWMResult.isValid(code):
        code = SWMResult.SWM_GENERAL_ERROR

    return {
        'id': dbus.String(operation_id, variant_level=1),
        'result_code': dbus.Int32(code, variant_level=1),
        'result_text': dbus.String(text, variant_level=1)
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号