Example #1
0
def macro_PackageMetrics(macro, arg1, arg2='ja'):
    stack_name = get_unicode(macro.request, arg1)
    lang = get_unicode(macro.request, arg2)
    if ' ' in stack_name:
        #something changed in the API such that the above arg1, arg2 passing no longer works
        splits = stack_name.split(' ')
        if len(splits) > 2:
            return "ERROR in StackCodeQuality. Usage: [[StackHeader(stack_name opt_lang)]]"
        stack_name, lang = splits
    if not stack_name:
        return "ERROR in StackCodeQuality. Usage: [[StackCodeQuality(stack_name opt_lang)]]"
    

    f = macro.formatter
    p, div, li, ul = f.paragraph, f.div, f.listitem, f.bullet_list
    h, text, rawHTML = f.heading, f.text, f.rawHTML
    desc = ''


    # Common Information
    try:
        data = load_stack_code_quality(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return e
Example #2
0
def macro_StackMetrics(macro, arg1, arg2='groovy', arg3='ja'):
    stack_name = get_unicode(macro.request, arg1)
    rosdistro = get_unicode(macro.request, arg2)
    lang = get_unicode(macro.request, arg3)
    if ' ' in stack_name:
        #something changed in the API such that the above arg1, arg2 passing no longer works
        splits = stack_name.split(' ')
        if len(splits) > 3:
            return "ERROR in StackCodeQuality. Usage: [[StackHeader(stack_name opt_rosdistro opt_lang)]]"
        elif len(splits) == 3:
            stack_name, rosdistro, lang = splits
        elif len(splits) == 2:
            stack_name, rosdistro = splits
    if not stack_name:
        return "ERROR in StackCodeQuality. Usage: [[StackCodeQuality(stack_name opt_rosdistro opt_lang)]]"

    f = macro.formatter
    p, div, li, ul = f.paragraph, f.div, f.listitem, f.bullet_list
    h, text, rawHTML = f.heading, f.text, f.rawHTML
    desc = ''

    # Common Information
    try:
        data = load_stack_code_quality(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
Example #3
0
    # Common Information
    try:
        data = load_stack_code_quality(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return e
    desc += get_common_information_html(macro, data)
    

    # Lines of Code
    try:
        data = load_stack_loc(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return e
    desc += get_loc_html(macro,data)


    # Code Quality
    try:
        data = load_stack_code_quality(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return e
        #return CONTRIBUTE_TMPL%locals() 
    desc += get_code_quality_html(macro,data,'Package')


    return desc
  
Example #4
0
    p, div, li, ul = f.paragraph, f.div, f.listitem, f.bullet_list
    h, text, rawHTML = f.heading, f.text, f.rawHTML
    desc = ''

    # Common Information
    try:
        data = load_stack_code_quality(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
    desc += get_common_information_html(macro, data)

    # Lines of Code
    try:
        data = load_stack_loc(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
    desc += get_loc_html(macro, data)

    # Code Quality
    try:
        data = load_stack_code_quality(stack_name, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
        #return CONTRIBUTE_TMPL%locals()
    desc += get_code_quality_html(macro, data, 'Package')

    return desc
Example #5
0
    p, div, li, ul = f.paragraph, f.div, f.listitem, f.bullet_list
    h, text, rawHTML = f.heading, f.text, f.rawHTML
    desc = ''

    # Common Information
    try:
        data = load_stack_code_quality(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
    desc += get_common_information_html(macro, data)

    # Lines of Code
    try:
        data = load_stack_loc(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
    desc += get_loc_html(macro, data)

    # Code Quality
    try:
        data = load_stack_code_quality(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
        #return CONTRIBUTE_TMPL%locals()
    desc += get_code_quality_html(macro, data, 'Stack')

    return desc
Example #6
0
    # Common Information
    try:
        data = load_stack_code_quality(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
    desc += get_common_information_html(macro, data)
    

    # Lines of Code
    try:
        data = load_stack_loc(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
    desc += get_loc_html(macro,data)


    # Code Quality
    try:
        data = load_stack_code_quality(stack_name, rosdistro, lang)
    except UtilException, e:
        name = stack_name
        return str(e)
        #return CONTRIBUTE_TMPL%locals() 
    desc += get_code_quality_html(macro,data,'Stack')


    return desc