Пример #1
0
def s_show_zproto_mc(fp, klass_l, dct, comments):
    """Show method or callback_type - they're mostly the same except tag name"""
    typ = dct["type"]
    singleton=''
    if typ == "singleton":
        typ = "method"
        singleton=""" singleton = "1" """
    print("""    <%s name = "%s"%s>""" % (typ, dct["name"][klass_l:], singleton), file=fp)

    for i in range(3):
        if dct["coord"].line -i in comments:
            print(s_xml_escape(comments[dct["coord"].line-i]), file=fp)

    s_show_zproto_model_arguments(fp, dct)
    if dct["return_type"].type != "void":
        print("""        <return type = "%s" />""" % (s_decl_to_zproto_type(dct["return_type"])), file=fp)
    print("""    </%s>\n""" % (typ, ), file=fp)
Пример #2
0
def s_show_zproto_mc(fp, klass_l, dct, comments):
    """Show method or callback_type - they're mostly the same except tag name"""
    typ = dct["type"]
    singleton = ''
    if typ == "singleton":
        typ = "method"
        singleton = """ singleton = "1" """
    print("""    <%s name = "%s"%s>""" %
          (typ, dct["name"][klass_l:], singleton),
          file=fp)

    for i in range(3):
        if dct["coord"].line - i in comments:
            print(s_xml_escape(comments[dct["coord"].line - i]), file=fp)

    s_show_zproto_model_arguments(fp, dct)
    if dct["return_type"].type != "void":
        print("""        <return type = "%s" />""" %
              (s_decl_to_zproto_type(dct["return_type"])),
              file=fp)
    print("""    </%s>\n""" % (typ, ), file=fp)
Пример #3
0
def s_comment_fill(comment):
    comment = re.sub(r' +(?=\n|$)', '', comment)
    return s_xml_escape(comment)
Пример #4
0
def s_comment_fill(comment):
    return s_xml_escape(comment)