ENH don't use putstrln for printing packages

This commit is contained in:
Nathan Dwarshuis 2023-01-01 11:14:58 -05:00
parent f875b7c71d
commit 91ff25a8d2
3 changed files with 8 additions and 7 deletions

View File

@ -66,10 +66,10 @@ evalConfig db = do
printDeps :: FIO () printDeps :: FIO ()
printDeps = withDBus_ $ \db -> printDeps = withDBus_ $ \db ->
mapM_ (liftIO . putStrLn . T.unpack) $ mapM_ logInfo $
fmap showFulfillment $
sort $ sort $
nub $ nub $
fmap showFulfillment $
concatMap dumpFeature $ concatMap dumpFeature $
allFeatures db allFeatures db

View File

@ -217,7 +217,7 @@ withXmobar = bracket startXmobar cleanup
printDeps :: FIO () printDeps :: FIO ()
printDeps = withDBus_ $ \db -> do printDeps = withDBus_ $ \db -> do
(i, f, d) <- allFeatures db (i, f, d) <- allFeatures db
mapM_ (liftIO . putStrLn . T.unpack) $ mapM_ logInfo $
fmap showFulfillment $ fmap showFulfillment $
sort $ sort $
nub $ nub $

View File

@ -186,8 +186,9 @@ logMsg (FMsg fn n (Msg ll m)) = do
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Package status -- Package status
showFulfillment :: Fulfillment -> T.Text showFulfillment :: Fulfillment -> Utf8Builder
showFulfillment (Package t n) = T.concat [T.pack $ show t, "\t", n] showFulfillment (Package t n) =
displayShow t <> "\t" <> Utf8Builder (encodeUtf8Builder n)
dumpFeature :: Feature a -> [Fulfillment] dumpFeature :: Feature a -> [Fulfillment]
dumpFeature = either dumpSometimes dumpAlways dumpFeature = either dumpSometimes dumpAlways