drop incremental json object display; clean up code
This gets rid of quite a lot of ugly hacks around json generation. I doubt that any real-world json parsers can parse incomplete objects, so while it's not as nice to need to wait for the complete object, especially for commands like `git annex info` that take a while, it doesn't seem worth the added complexity. This also causes the order of fields within the json objects to be reordered. Since any real json parser shouldn't care, the only possible problem would be with ad-hoc parsers of the old json output.
This commit is contained in:
parent
61faf240d5
commit
d7ea6a5684
6 changed files with 70 additions and 141 deletions
|
@ -10,7 +10,7 @@
|
|||
module Types.Messages where
|
||||
|
||||
import Data.Default
|
||||
import qualified Data.ByteString.Lazy as B
|
||||
import qualified Data.Aeson as Aeson
|
||||
|
||||
#ifdef WITH_CONCURRENTOUTPUT
|
||||
import System.Console.Regions (ConsoleRegion)
|
||||
|
@ -31,7 +31,7 @@ data MessageState = MessageState
|
|||
, consoleRegion :: Maybe ConsoleRegion
|
||||
, consoleRegionErrFlag :: Bool
|
||||
#endif
|
||||
, jsonBuffer :: B.ByteString
|
||||
, jsonBuffer :: Maybe Aeson.Object
|
||||
}
|
||||
|
||||
instance Default MessageState
|
||||
|
@ -45,5 +45,5 @@ instance Default MessageState
|
|||
, consoleRegion = Nothing
|
||||
, consoleRegionErrFlag = False
|
||||
#endif
|
||||
, jsonBuffer = B.empty
|
||||
, jsonBuffer = Nothing
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue