--- a/src/Pure/System/progress.scala Fri Apr 01 11:51:42 2022 +0200
+++ b/src/Pure/System/progress.scala Fri Apr 01 17:06:10 2022 +0200
@@ -11,10 +11,8 @@
import java.io.{File => JFile}
-object Progress
-{
- sealed case class Theory(theory: String, session: String = "", percentage: Option[Int] = None)
- {
+object Progress {
+ sealed case class Theory(theory: String, session: String = "", percentage: Option[Int] = None) {
def message: String = print_session + print_theory + print_percentage
def print_session: String = if (session == "") "" else session + ": "
@@ -24,8 +22,7 @@
}
}
-class Progress
-{
+class Progress {
def echo(msg: String): Unit = {}
def echo_if(cond: Boolean, msg: String): Unit = { if (cond) echo(msg) }
def theory(theory: Progress.Theory): Unit = {}
@@ -39,8 +36,7 @@
@volatile protected var is_stopped = false
def stop(): Unit = { is_stopped = true }
- def stopped: Boolean =
- {
+ def stopped: Boolean = {
if (Thread.interrupted()) is_stopped = true
is_stopped
}
@@ -55,8 +51,8 @@
redirect: Boolean = false,
echo: Boolean = false,
watchdog: Time = Time.zero,
- strict: Boolean = true): Process_Result =
- {
+ strict: Boolean = true
+ ): Process_Result = {
val result =
Isabelle_System.bash(script, cwd = cwd, env = env, redirect = redirect,
progress_stdout = echo_if(echo, _),
@@ -67,8 +63,7 @@
}
}
-class Console_Progress(verbose: Boolean = false, stderr: Boolean = false) extends Progress
-{
+class Console_Progress(verbose: Boolean = false, stderr: Boolean = false) extends Progress {
override def echo(msg: String): Unit =
Output.writeln(msg, stdout = !stderr, include_empty = true)
@@ -76,8 +71,7 @@
if (verbose) echo(theory.message)
}
-class File_Progress(path: Path, verbose: Boolean = false) extends Progress
-{
+class File_Progress(path: Path, verbose: Boolean = false) extends Progress {
override def echo(msg: String): Unit =
File.append(path, msg + "\n")