1 module Config ( Config(..)
6 import Data.Either.Utils
9 data Config = Config { rpcuser :: String
10 , rpcpassword :: String
15 readConfig :: String -> IO Config
17 cp <- return . forceEither =<< readfile emptyCP f
18 return (Config { rpcuser = getSetting cp "rpcuser" ""
19 , rpcpassword = getSetting cp "rpcpassword" ""
20 , rpchost = getSetting cp "rpchost" "localhost"
21 , rpcport = getSetting cp "rpcport" 8336
24 getSetting cp x dfl = case get cp "DEFAULT" x of