From 81a2809683ceda6475d6d42df644dce102dd290b Mon Sep 17 00:00:00 2001 From: Juraj Hercek Date: Sun, 23 Dec 2007 00:14:19 +0100 Subject: Added documentation. - added Thermal, CoreTemp, CpuFreq documentation to README file - added haddock documentation darcs-hash:20071222231419-f49a6-beadaa214bd80a9eb12f568dbff8dcf0d88ecfe7.gz --- Plugins/Monitors/CoreCommon.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Plugins/Monitors/CoreCommon.hs') diff --git a/Plugins/Monitors/CoreCommon.hs b/Plugins/Monitors/CoreCommon.hs index de737d4..9a19cd5 100644 --- a/Plugins/Monitors/CoreCommon.hs +++ b/Plugins/Monitors/CoreCommon.hs @@ -18,6 +18,10 @@ import Plugins.Monitors.Common import System.Posix.Files (fileExist) import System.Directory +-- | +-- Function checks the existence of first file specified by pattern and if the +-- file doesn't exists failure message is shown, otherwise the data retrieval +-- is performed. checkedDataRetrieval :: String -> String -> String -> String -> Double -> Monitor String checkedDataRetrieval failureMessage dir file pattern divisor = do exists <- io $ fileExist $ foldl (++) dir ["/", pattern, "0/", file] @@ -25,6 +29,10 @@ checkedDataRetrieval failureMessage dir file pattern divisor = do False -> return failureMessage True -> retrieveData dir file pattern divisor +-- | +-- Function retrieves data from files in directory dir specified by pattern. +-- String values are converted to double and adjusted with divisor. Final array +-- is processed by template parser function and returned as monitor string. retrieveData :: String -> String -> String -> Double -> Monitor String retrieveData dir file pattern divisor = do count <- io $ dirCount dir pattern -- cgit v1.2.3