summaryrefslogtreecommitdiffhomepage
path: root/Plugins
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-11-15 14:49:05 +0100
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-11-15 14:49:05 +0100
commitfe41ed561aff6cdaf2c624a5a3f1bccd82458585 (patch)
treed7ff3139b5ee5d8754cdad4e1aac38fa74f13c76 /Plugins
parent23932ae4b94c420982677b970df7a9163a21ca2b (diff)
downloadxmobar-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
Diffstat (limited to 'Plugins')
-rw-r--r--Plugins/Monitors/Weather.hs5
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))