[Add HaXml encode/decode, System.Unix.Process API changes David Fox **20080505191146] { hunk ./Ugly.cabal 2 -Version: 1.15 +Version: 1.16 hunk ./Ugly.cabal 6 -Homepage: http://seereason.org/ +Homepage: http://seereason.com hunk ./Ugly.cabal 27 - Ugly.Encoding, Ugly.Encoding.Octets, Ugly.Encoding.Html, + Ugly.Encoding, Ugly.Encoding.Octets, Ugly.Encoding.HaXml, Ugly.Encoding.Html, addfile ./Ugly/Encoding/HaXml.hs hunk ./Ugly/Encoding/HaXml.hs 1 +module Ugly.Encoding.HaXml where + +import Ugly.Encoding +import Text.XML.HaXml.Types +import Text.XML.HaXml.Pretty +import Text.XML.HaXml.Html.Parse + +-- |Document is the type used by HaXml to represent XML documents. +instance Encoding Document String where + encode = htmlParse "text" . addHtml + where addHtml x = "" ++ x ++ "" + decode = show . map content . dropHtml + where dropHtml (Document _ _ (Elem "html" _ content) _) = content + dropHtml x = error $ "Unexpected HTML: " ++ show (document x) hunk ./Ugly/Encoding/Html.hs 11 -import Text.XML.HaXml.Types -import Text.XML.HaXml.Pretty -import Text.XML.HaXml.Html.Parse hunk ./Ugly/Encoding/Html.hs 22 --- |Document is the type used by HaXml to represent XML documents. -instance Encoding Document String where - encode = htmlParse "text" . addHtml - where addHtml x = "" ++ x ++ "" - decode = show . map content . dropHtml - where dropHtml (Document _ _ (Elem "html" _ content) _) = content - dropHtml x = error $ "Unexpected HTML: " ++ show (document x) - hunk ./Ugly/Image.hs 47 -import qualified Data.ByteString.Char8 as B +import qualified Data.ByteString.Lazy.Char8 as B hunk ./Ugly/Image.hs 186 - lazyCommand ("file -b '" ++ path ++ "'") [] >>= - return . test . B.unpack . B.concat . stdoutOnly + lazyCommand ("file -b '" ++ path ++ "'") B.empty >>= + return . test . B.unpack . stdoutOnly hunk ./Ugly/Image.hs 300 - result <- lazyCommand command [] + result <- lazyCommand command B.empty hunk ./Ugly/Image.hs 304 - stringToHtml "Output:" +++ pre (stringToHtml (B.unpack (B.concat (out ++ err))))) + stringToHtml "Output:" +++ pre (stringToHtml (B.unpack (B.append out err)))) hunk ./Ugly/Image/File.hs 11 -import qualified Data.ByteString.Char8 as B +import qualified Data.ByteString.Lazy.Char8 as B hunk ./Ugly/Image/File.hs 75 - sum <- lazyCommand ("md5sum '" ++ path ++ "' | sed 's/ .*$//'") [] >>= return . maybe "unknown" id . line1 + sum <- lazyCommand ("md5sum '" ++ path ++ "' | sed 's/ .*$//'") B.empty >>= return . maybe "unknown" id . line1 hunk ./Ugly/Image/File.hs 91 - line1 = listToMaybe . lines . B.unpack . B.concat . stdoutOnly + line1 = listToMaybe . lines . B.unpack . stdoutOnly hunk ./debian/changelog 1 +haskell-ugly (1.16) unstable; urgency=low + + * Add a separate Ugly.Encoding.HaXml module. + + -- David Fox Thu, 13 Mar 2008 09:33:37 -0700 + hunk ./debian/control 5 -Build-Depends: debhelper (>= 4.0.0), rsync, haskell-devscripts (>=0.5.15), ghc6 (>=6.4), ghc6-prof, libghc6-xhtml-dev, libghc6-xhtml-prof, libghc6-cgi-dev, libghc6-cgi-prof, libghc6-haxml-dev, libghc6-unixutils-dev, libghc6-unixutils-prof, libghc6-hunit-dev, cpphs +Build-Depends: debhelper (>= 4.0.0), rsync, haskell-devscripts (>=0.5.15), ghc6 (>=6.4), ghc6-prof, libghc6-xhtml-dev, libghc6-xhtml-prof, libghc6-cgi-dev, libghc6-cgi-prof, libghc6-haxml-dev, libghc6-unixutils-dev (>= 1.17), libghc6-unixutils-prof (>= 1.17), libghc6-hunit-dev, cpphs }