diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-11-15 14:49:05 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-11-15 14:49:05 +0100 |
commit | fe41ed561aff6cdaf2c624a5a3f1bccd82458585 (patch) | |
tree | d7ff3139b5ee5d8754cdad4e1aac38fa74f13c76 | |
parent | 23932ae4b94c420982677b970df7a9163a21ca2b (diff) | |
download | xmobar-fe41ed561aff6cdaf2c624a5a3f1bccd82458585.tar.gz xmobar-fe41ed561aff6cdaf2c624a5a3f1bccd82458585.tar.bz2 |
Now that a cold winter is approaching I added a new feature to Weather: the capacity of reading negative temperature.
This feature is generally not needed in Summertime.
darcs-hash:20071115134905-d6583-a785fbbf0fa9aa49fbf0ba4e230e93ce013748ad.gz
-rw-r--r-- | Plugins/Monitors/Weather.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Plugins/Monitors/Weather.hs b/Plugins/Monitors/Weather.hs index 38577bc..e166b74 100644 --- a/Plugins/Monitors/Weather.hs +++ b/Plugins/Monitors/Weather.hs @@ -71,9 +71,10 @@ pTime = do y <- getNumbersAsString return (y, m, d ,([h]++[hh]++":"++[mi]++mimi)) pTemp :: Parser (Int, Int) -pTemp = do f <- manyTill (digit <|> char '.') $ char ' ' +pTemp = do let num = digit <|> char '-' <|> char '.' + f <- manyTill num $ char ' ' manyTill anyChar $ char '(' - c <- manyTill digit $ (char ' ' <|> char '.') + c <- manyTill num $ char ' ' skipRestOfLine return $ (floor (read c :: Double), floor (read f :: Double)) |