All Downloads are FREE. Search and download functionalities are using the official Maven repository.

change-sysadmin-scala_3.0.0.6.source-code.task-result-html-untemplate.scala Maven / Gradle / Ivy

// DO NOT HAND EDIT -- Autogenerated from 'task-result.html.untemplate' at 2023-09-06T16:17:18.636358Z
package com.mchange.sysadmin

import java.io.{Writer,StringWriter}
import scala.collection.*

import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME

val Untemplate_task_result_html = new untemplate.Untemplate[TaskRunner.AbstractTask.Run,Nothing]:
  val UntemplateFunction                    : untemplate.Untemplate[TaskRunner.AbstractTask.Run,Nothing] = this
  val UntemplateName                        : String = "task_result_html"
  val UntemplatePackage                     : String = "com.mchange.sysadmin"
  val UntemplateInputName                   : String = "run"
  val UntemplateInputTypeDeclared           : String = "TaskRunner.AbstractTask.Run"
  val UntemplateInputTypeCanonical          : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[TaskRunner.AbstractTask.Run] )
  val UntemplateInputDefaultArgument        : Option[TaskRunner.AbstractTask.Run] = (None : Option[TaskRunner.AbstractTask.Run])
  val UntemplateOutputMetadataTypeDeclared  : String = "Nothing"
  val UntemplateOutputMetadataTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[Nothing] )
  val UntemplateHeaderNote                  : String = ""

  val UntemplateAttributes : immutable.Map[String,Any] = immutable.Map.empty


  def apply(run : TaskRunner.AbstractTask.Run) : untemplate.Result[Nothing] =
    val writer             : StringWriter = new StringWriter(29950)
    val attrs              : immutable.Map[String,Any] = UntemplateAttributes
    var mbMetadata         : Option[Nothing] = None
    var outputTransformer  : Function1[untemplate.Result[Nothing],untemplate.Result[Nothing]] = identity


    val now = ZonedDateTime.now()
    val timestamp = RFC_1123_DATE_TIME.format(now)

    val title = TaskRunner.Reporting.defaultTitle(run)



      val block0 = new Function0[String]:
        def apply() : String =
          "\n\n\n  \n    \n    " + ( title ) +
          "\n  \n  \n    

" + ( title ) + "

\n
Succeeded overall?: " + ( yn(run.success) ) + "
\n
Timestamp: " + ( timestamp ) + "
\n

Sequential steps:

\n
\n" writer.write(block0()) val indexedSequentials = LazyList.from(1).zip(run.sequential).map( (i,r) => StepRunMaybeIndexed(r, Some(i)) ) indexedSequentials.foreach { case srmi => val block1 = new Function0[String]: def apply() : String = " " + ( stepRun( srmi ) ) + "\n" writer.write(block1()) } // indexedSequentials.foreach val block2 = new Function0[String]: def apply() : String = "
\n

Best-effort cleanups:

\n
\n" writer.write(block2()) run.bestEffortCleanups.map(sr => StepRunMaybeIndexed(sr, None) ).foreach { srmi => val block3 = new Function0[String]: def apply() : String = " " + ( stepRun( srmi ) ) + "\n" writer.write(block3()) } val block4 = new Function0[String]: def apply() : String = "
\n \n\n\n" writer.write(block4()) outputTransformer( untemplate.Result( mbMetadata, writer.toString ) ) end apply end Untemplate_task_result_html def task_result_html(run : TaskRunner.AbstractTask.Run) : untemplate.Result[Nothing] = Untemplate_task_result_html( run )




© 2015 - 2025 Weber Informatics LLC | Privacy Policy