finish message serialization of progress meters
Any given transfer can only display 1 progress meter at a time, or so this code assumes. In some cases, there are progress meters for different stages of a transfer, perhaps, and that is supported by this. This commit was sponsored by Ethan Aubin.
This commit is contained in:
parent
4efecaebd6
commit
31e417f351
7 changed files with 91 additions and 33 deletions
|
@ -96,18 +96,3 @@ flushed a = a >> hFlush stdout
|
|||
|
||||
outputSerialized :: (SerializedOutput -> IO ()) -> SerializedOutput -> IO ()
|
||||
outputSerialized = id
|
||||
|
||||
emitSerializedOutput :: SerializedOutput -> Annex ()
|
||||
emitSerializedOutput (OutputMessage msg) =
|
||||
outputMessage' nojsonoutputter nojsonbuilder msg
|
||||
where
|
||||
nojsonoutputter _ _ = return False
|
||||
nojsonbuilder = id
|
||||
emitSerializedOutput (OutputError msg) = outputError msg
|
||||
emitSerializedOutput (ProgressMeter sz old new) = undefined -- TODO
|
||||
emitSerializedOutput (JSONObject b) =
|
||||
withMessageState $ \s -> case outputType s of
|
||||
JSONOutput _ -> liftIO $ flushed $ JSON.emit' b
|
||||
SerializedOutput h -> liftIO $
|
||||
outputSerialized h $ JSONObject b
|
||||
_ -> q
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue