web: clean up name clash with Yesod.Core
This commit is contained in:
		
							parent
							
								
									aa30f25887
								
							
						
					
					
						commit
						959d8a4591
					
				| @ -12,6 +12,7 @@ where | |||||||
| import Data.Dynamic (Dynamic, toDyn) | import Data.Dynamic (Dynamic, toDyn) | ||||||
| import Network.Wai (Application) | import Network.Wai (Application) | ||||||
| import Network.Wai.Middleware.Debug (debugHandle) | import Network.Wai.Middleware.Debug (debugHandle) | ||||||
|  | import Yesod.Core hiding (AppConfig,loadConfig,appPort) | ||||||
| import Yesod.Logger (makeLogger, flushLogger, Logger, logLazyText, logString) | import Yesod.Logger (makeLogger, flushLogger, Logger, logLazyText, logString) | ||||||
| import Yesod.Static | import Yesod.Static | ||||||
| 
 | 
 | ||||||
| @ -33,10 +34,10 @@ withApp :: AppConfig -> Logger -> WebOpts -> (Application -> IO a) -> IO a | |||||||
| withApp conf logger opts f = do | withApp conf logger opts f = do | ||||||
| #ifdef PRODUCTION | #ifdef PRODUCTION | ||||||
|     putStrLn $ "Production mode, using embedded web files" |     putStrLn $ "Production mode, using embedded web files" | ||||||
|     let s = $(embed Hledger.Web.Settings.staticDir) |     let s = $(embed staticDir) | ||||||
| #else | #else | ||||||
|     putStrLn $ "Not in production mode, using web files from " ++ Hledger.Web.Settings.staticDir ++ "/" |     putStrLn $ "Not in production mode, using web files from " ++ staticDir ++ "/" | ||||||
|     s <- staticDevel Hledger.Web.Settings.staticDir |     s <- staticDevel staticDir | ||||||
| #endif | #endif | ||||||
|     let a = App {settings=conf |     let a = App {settings=conf | ||||||
|                 ,getLogger=logger |                 ,getLogger=logger | ||||||
| @ -52,7 +53,7 @@ withDevelAppPort = | |||||||
|   where |   where | ||||||
|     go :: ((Int, Application) -> IO ()) -> IO () |     go :: ((Int, Application) -> IO ()) -> IO () | ||||||
|     go f = do |     go f = do | ||||||
|         conf <- Hledger.Web.Settings.loadConfig Hledger.Web.Settings.Development |         conf <- loadConfig Development | ||||||
|         let port = appPort conf |         let port = appPort conf | ||||||
|         logger <- makeLogger |         logger <- makeLogger | ||||||
|         logString logger $ "Devel application launched with default options, listening on port " ++ show port |         logString logger $ "Devel application launched with default options, listening on port " ++ show port | ||||||
|  | |||||||
| @ -6,8 +6,6 @@ module Hledger.Web.Foundation | |||||||
|     , resourcesApp |     , resourcesApp | ||||||
|     , Handler |     , Handler | ||||||
|     , Widget |     , Widget | ||||||
|     , module Yesod.Core |  | ||||||
|     -- , module Settings |  | ||||||
|     , StaticRoute (..) |     , StaticRoute (..) | ||||||
|     , lift |     , lift | ||||||
|     , liftIO |     , liftIO | ||||||
|  | |||||||
| @ -23,6 +23,7 @@ import System.Locale (defaultTimeLocale) | |||||||
| import Text.Blaze (preEscapedString, toHtml) | import Text.Blaze (preEscapedString, toHtml) | ||||||
| import Text.Hamlet hiding (hamletFile) | import Text.Hamlet hiding (hamletFile) | ||||||
| import Text.Printf | import Text.Printf | ||||||
|  | import Yesod.Core | ||||||
| import Yesod.Json | import Yesod.Json | ||||||
| 
 | 
 | ||||||
| import Hledger hiding (today) | import Hledger hiding (today) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user