#2020 move needed functions
Merged 4 years ago by tkopecek. Opened 4 years ago by tkopecek.
tkopecek/koji issue1484-fix  into  master

@@ -3,39 +3,6 @@ 

  #from six.moves.urllib.parse import quote

  #import datetime

  

- #def printValue($key, $value, $sep=', ')

-   #if $key in ('brootid', 'buildroot_id')

- <a href="buildrootinfo?buildrootID=$value">$value</a>

-   #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&nbsp;=&nbsp;$printProperties($value)<br/>

-   #elif $key != '__starstar'

-   $prefix$key&nbsp;=&nbsp;$printValue($key, $value)<br/>

-   #end if

-   #end for

- #end def

- 

- #def printOpts($opts)

-   #if $opts

-   <strong>Options:</strong><br/>

-   $printMap($opts, '&nbsp;&nbsp;')

-   #end if

- #end def

- 

  #def printChildren($taskID, $childMap)

    #set $iter = 0

    #set $children = $childMap[$str($taskID)]

@@ -1,6 +1,39 @@ 

  #import koji

  #from kojiweb import util

  

+ #def printValue($key, $value, $sep=', ')

+   #if $key in ('brootid', 'buildroot_id')

+ <a href="buildrootinfo?buildrootID=$value">$value</a>

+   #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&nbsp;=&nbsp;$printProperties($value)<br/>

+   #elif $key != '__starstar'

+   $prefix$key&nbsp;=&nbsp;$printValue($key, $value)<br/>

+   #end if

+   #end for

+ #end def

+ 

+ #def printOpts($opts)

+   #if $opts

+   <strong>Options:</strong><br/>

+   $printMap($opts, '&nbsp;&nbsp;')

+   #end if

+ #end def

+ 

  #if $task.method == 'buildSRPMFromSCM'

  <strong>SCM URL:</strong> $params[0]<br/>

  #if $len($params) > 1

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

4 years ago

Commit fa55182 fixes this pull-request

Pull-Request has been merged by tkopecek

4 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

4 years ago