#from urllib.parse import quote
#import koji
#from kojiweb import util
#def printValue($key, $value, $sep=', ')
#if $key in ('brootid', 'buildroot_id')
$value
#elif $isinstance($value, list)
$sep.join([$str($val) for $val in $value])
#elif $isinstance($value, dict)
$sep.join(['%s=%s' % (($n == '' and "''" or $n), $v) for $n, $v in $value.items()])
#else
$value
#end if
#end def
#def printProperties($props)
#echo ', '.join([$v is not None and '%s=%s' % ($n, $v) or $str($n) for $n, $v in $props.items()])
#end def
#def printMap($vals, $prefix='')
#for $key, $value in $vals.items()
#if $key == 'properties'
${prefix}properties = $printProperties($value)
#elif $key != '__starstar'
$prefix$key = $printValue($key, $value)
#end if
#end for
#end def
#def printOpts($opts)
#if $opts
Options:
$printMap($opts, ' ')
#end if
#end def
#if $task.method == 'buildSRPMFromSCM'
SCM URL: $params[0]
#if $len($params) > 1
Build Tag:
#if $buildTag.id
$buildTag.name
#else
$buildTag.name
#end if
#end if
#if $len($params) > 2
$printOpts($params[2])
#end if
#elif $task.method == 'buildSRPMFromCVS'
CVS URL: $params[0]
#elif $task.method == 'buildArch'
SRPM: $params[0]
Build Tag:
#if $buildTag.id
$buildTag.name
#else
$buildTag.name
#end if
Arch: $params[2]
Keep SRPM? #if $params[3] then 'yes' else 'no'#
#if $len($params) > 4
$printOpts($params[4])
#end if
#elif $task.method == 'tagBuild'
Destination Tag: $destTag.name
Build: $koji.buildLabel($build)
#elif $task.method == 'buildNotification'
#set $build = $params[1]
#set $buildTarget = $params[2]
Recipients: $printValue('', $params[0])
Build: $koji.buildLabel($build)
#if $buildTarget
Build Target: $buildTarget.name
#else
Build Target: (no build target)
#end if
Web URL: $params[3]
#elif $task.method == 'tagNotification'
Recipients: $printValue('', $params[0])
Successful?: #if $params[1] then 'yes' else 'no'#
#if $destTag
Tagged Into: $destTag.name
#end if
#if $srcTag
#if $destTag then 'Moved From:' else 'Untagged From:'# $srcTag.name
#end if
Build: $koji.buildLabel($build)
#if $destTag then 'Tagged By:' else 'Untagged By:'# $user.name
Ignore Success?: #if $params[6] then 'yes' else 'no'#
#if $params[7]
Failure Message: $params[7]
#end if
#elif $task.method == 'build'
Source: $params[0]
Build Target: $params[1]
$printOpts($params[2])
#elif $task.method == 'maven'
SCM URL: $params[0]
Build Target: $params[1]
$printOpts($params[2])
#elif $task.method == 'buildMaven'
SCM URL: $params[0]
Build Tag:
#if $buildTag.id
$buildTag.name
#else
$buildTag.name
#end if
#if $len($params) > 2
$printOpts($params[2])
#end if
#elif $task.method == 'wrapperRPM'
Spec File URL: $params[0]
#if 'locked' in $buildTarget
#set $buildTag = $buildTarget.name
Build Tag:
#if $buildTag.id
$buildTag.name
#else
$buildTag.name
#end if
#else
Build Target: $buildTarget.name
#end if
#if $params[2]
Build: $koji.buildLabel($params[2])
#end if
#if $params[3]
Task: $koji.taskLabel($wrapTask)
#end if
#if $len($params) > 4
$printOpts($params[4])
#end if
#elif $task.method == 'chainmaven'
Builds:
| $key: | $printMap($val) |