1. John Lenz
  2. notmuch-web

Commits

John Lenz  committed 135c5de

Cleanup handler imports

  • Participants
  • Parent commits 3d6bd64
  • Branches default

Comments (0)

Files changed (8)

File src/Application.hs

View file
  • Ignore whitespace
     , makeFoundation
     ) where
 
-import Import hiding (loadConfig)
-import Settings
+import Import
 import StaticFiles (staticSite)
 import Yesod.Auth (getAuth)
 import Yesod.Default.Config

File src/Handler/Compose.hs

View file
  • Ignore whitespace
 module Handler.Compose (getComposeR, postComposeR, getReplyR, getReplyAllR) where
 
 import Import
-import Settings
-import Network.Mail.Mime
+
+import Data.Attoparsec.Text
+import Data.String (fromString)
 import Data.Time
+import Network.Mail.Mime hiding (partContent)
+import System.FilePath ((</>))
 import System.Locale
 import System.Random (randomIO)
-import System.FilePath ((</>))
+
 import qualified Data.ByteString as B
 import qualified Data.ByteString.Lazy as BL
+import qualified Data.CaseInsensitive as CI
 import qualified Data.Conduit.List as CL
+import qualified Data.Map as M
 import qualified Data.Text as T
 import qualified Data.Text.Encoding as T
 import qualified Data.Text.Lazy as TL
 import qualified Data.Text.Lazy.Encoding as TL
 import qualified Data.Text.Lazy.IO as TL
 import qualified Text.Email.Validate as E
-import qualified Data.Map as M
-import qualified Data.CaseInsensitive as CI
-import Data.Attoparsec.Text
-import Data.String (fromString)
-import NotmuchCmd
 
 instance Eq Address where
     (Address a1 a2) == (Address b1 b2) = a1 == b1 && a2 == b2
 
 findBodyText :: [MessagePart] -> Maybe T.Text
 findBodyText [] = Nothing
-findBodyText ((MessagePart {NotmuchCmd.partContent = ContentText t}):_) = Just t
-findBodyText ((MessagePart {NotmuchCmd.partContent = ContentMsgRFC822 _}):_) = Nothing
-findBodyText ((MessagePart {NotmuchCmd.partContent = ContentMultipart sub}):ms) =
+findBodyText ((MessagePart {partContent = ContentText t}):_) = Just t
+findBodyText ((MessagePart {partContent = ContentMsgRFC822 _}):_) = Nothing
+findBodyText ((MessagePart {partContent = ContentMultipart sub}):ms) =
     case findBodyText sub of
         Nothing -> findBodyText ms
         Just x -> Just x

File src/Handler/Home.hs

View file
  • Ignore whitespace
   ) where
 
 import Import
-import Settings
+import Handler.Tags
+
 import Text.Hamlet (hamletFile)
 import qualified Data.Text as T
 
-import Handler.Tags
-import NotmuchCmd
-
 searchTable :: String -> Widget
 searchTable s = do
     tagHeader

File src/Handler/Pager.hs

View file
  • Ignore whitespace
 module Handler.Pager (getThreadPagerR) where
 
 import Import
-import Prelude (tail)
-import Settings
 import StaticFiles
-import NotmuchCmd
-import Data.Maybe (listToMaybe)
 import Handler.View
+
+import Data.Aeson (encode)
+import Text.Blaze (unsafeLazyByteString)
 import qualified Data.Text as T
 import qualified Data.HashMap.Strict as H
-import Text.Blaze (unsafeLazyByteString)
-import Data.Aeson (encode)
 
 encodeSearch :: (Route App -> T.Text) -> [SearchResult] -> Html
 encodeSearch ur search = unsafeLazyByteString $ encode $ map enc search

File src/Handler/Raw.hs

View file
  • Ignore whitespace
 module Handler.Raw (getRawCommandR, postRawCommandR) where
 
 import Import
-import NotmuchCmd
 import qualified Data.Text as T
 
 rawForm :: AForm (HandlerT App IO) String

File src/Handler/Tags.hs

View file
  • Ignore whitespace
 ) where
 
 import Import
-import Settings
 import qualified Data.Text as T
 
-import NotmuchCmd
-
 displayTag :: T.Text -> WidgetT App IO ()
 displayTag "unread" = [whamlet|<span .label .label-important .label-tag>unread|]
 displayTag t = [whamlet|<span .label .label-info .label-tag>#{t}|]

File src/Handler/View.hs

View file
  • Ignore whitespace
 ) where
 
 import Import
+import FilterHtml
+import StaticFiles
+import Handler.Tags
+
 import Blaze.ByteString.Builder (fromByteString)
-import Control.Monad (replicateM, unless)
-import Data.List (find)
-import FilterHtml
-import Handler.Tags
 import Network.HTTP.Types (status200)
 import Network.Wai (Response(..))
-import NotmuchCmd
-import Settings
-import StaticFiles
 import Text.Blaze.Html5 (preEscapedToHtml)
 import Text.Pandoc
 import qualified Data.ByteString as B
-import qualified Data.Conduit as C
+import qualified Data.CaseInsensitive as CI
 import qualified Data.Conduit.List as C
 import qualified Data.Conduit.Text as C
+import qualified Data.Map as M
+import qualified Data.Set as S
 import qualified Data.Text as T
 import qualified Data.Text.Encoding as T
 import qualified Data.Text.Lazy as TL
-import qualified Data.Map as M
-import qualified Data.Set as S
 import qualified Data.Tree as TR
-import qualified Data.CaseInsensitive as CI
 
 #ifdef USE_ICU
 import qualified Data.Text.ICU.Convert as ICU
 #endif
 
 decodePart :: (MonadLogger m, MonadHandler m) 
-           => Maybe T.Text -> C.Source (C.ResourceT IO) B.ByteString -> m TL.Text
+           => Maybe T.Text -> Source (ResourceT IO) B.ByteString -> m TL.Text
 decodePart charset src = case charset of
                             Just "ISO-8859-1" -> decodeConduit C.iso8859_1
                             Just "UTF-8"      -> decodeConduit C.utf8

File src/Import.hs

View file
  • Ignore whitespace
 -}
 module Import
     ( module Prelude
-    , module Foundation
-    , module Settings
-    , module Data.Conduit
-    , module Data.Monoid
     , module Control.Applicative
     , module Control.Exception.Lifted
     , module Control.Monad
+    , module Data.Conduit
+    , module Data.List
+    , module Data.Maybe
+    , module Data.Monoid
+    , module Foundation
+    , module NotmuchCmd
+    , module Settings
     , module Yesod
     ) where
 
 #if __GLASGOW_HASKELL__ >= 706
-import Prelude hiding (writeFile, readFile, head, tail, init, last)
+import Prelude hiding (writeFile, readFile, head, init, last)
 #else
-import Prelude hiding (writeFile, readFile, head, tail, init, last, catch)
+import Prelude hiding (writeFile, readFile, head, init, last, catch)
 #endif
 
 import Foundation
-import Settings (development, production)
+import Settings
+import NotmuchCmd
 
-import Data.Conduit
-import Data.Monoid (Monoid (mappend, mempty, mconcat), (<>))
 import Control.Applicative ((<$>), (<*>), pure, (<|>))
 import Control.Exception.Lifted (catch)
-import Control.Monad (void, when, forM)
-
-import Yesod
+import Control.Monad (void, when, forM, replicateM, unless)
+import Data.Conduit
+import Data.List (find)
+import Data.Monoid (Monoid (mappend, mempty, mconcat), (<>))
+import Data.Maybe (listToMaybe)
+import Yesod hiding (loadConfig)