uniquify reader module names

This commit is contained in:
Simon Michael 2010-11-15 07:01:46 +00:00
parent bf1fe0a282
commit a3a7a346ac
8 changed files with 20 additions and 20 deletions

View File

@ -21,8 +21,8 @@ import Hledger.Data.Types (Journal(..))
import Hledger.Data.Journal (nullctx) import Hledger.Data.Journal (nullctx)
import Hledger.Data.Utils import Hledger.Data.Utils
import Hledger.Read.Common import Hledger.Read.Common
import Hledger.Read.Journal as Journal import Hledger.Read.JournalReader as JournalReader
import Hledger.Read.Timelog as Timelog import Hledger.Read.TimelogReader as TimelogReader
import Control.Monad.Error import Control.Monad.Error
import Data.Either (partitionEithers) import Data.Either (partitionEithers)
@ -47,8 +47,8 @@ timelogdefaultfilename = ".timelog"
-- Here are the available readers. The first is the default, used for unknown data formats. -- Here are the available readers. The first is the default, used for unknown data formats.
readers :: [Reader] readers :: [Reader]
readers = [ readers = [
Journal.reader JournalReader.reader
,Timelog.reader ,TimelogReader.reader
] ]
formats = map rFormat readers formats = map rFormat readers
@ -140,10 +140,10 @@ tests_Hledger_Read = TestList
[ [
"journalFile" ~: do "journalFile" ~: do
assertBool "journalFile should parse an empty file" (isRight $ parseWithCtx nullctx Journal.journalFile "") assertBool "journalFile should parse an empty file" (isRight $ parseWithCtx nullctx JournalReader.journalFile "")
jE <- readJournal Nothing "" -- don't know how to get it from journalFile jE <- readJournal Nothing "" -- don't know how to get it from journalFile
either error' (assertBool "journalFile parsing an empty file should give an empty journal" . null . jtxns) jE either error' (assertBool "journalFile parsing an empty file should give an empty journal" . null . jtxns) jE
,Journal.tests_Journal ,JournalReader.tests_JournalReader
,Timelog.tests_Timelog ,TimelogReader.tests_TimelogReader
] ]

View File

@ -103,8 +103,8 @@ i, o, b, h
-} -}
module Hledger.Read.Journal ( module Hledger.Read.JournalReader (
tests_Journal, tests_JournalReader,
reader, reader,
journalFile, journalFile,
journalAddFile, journalAddFile,
@ -560,7 +560,7 @@ numberpartsstartingwithpoint = do
return ("",frac) return ("",frac)
tests_Journal = TestList [ tests_JournalReader = TestList [
"ledgerTransaction" ~: do "ledgerTransaction" ~: do
assertParseEqual (parseWithCtx nullctx ledgerTransaction entry1_str) entry1 assertParseEqual (parseWithCtx nullctx ledgerTransaction entry1_str) entry1

View File

@ -42,8 +42,8 @@ o 2007/03/10 17:26:02
-} -}
module Hledger.Read.Timelog ( module Hledger.Read.TimelogReader (
tests_Timelog, tests_TimelogReader,
reader, reader,
) )
where where
@ -51,7 +51,7 @@ import Control.Monad.Error (ErrorT(..))
import Text.ParserCombinators.Parsec hiding (parse) import Text.ParserCombinators.Parsec hiding (parse)
import Hledger.Data import Hledger.Data
import Hledger.Read.Common import Hledger.Read.Common
import Hledger.Read.Journal (ledgerExclamationDirective, ledgerHistoricalPrice, import Hledger.Read.JournalReader (ledgerExclamationDirective, ledgerHistoricalPrice,
ledgerDefaultYear, emptyLine, ledgerdatetime) ledgerDefaultYear, emptyLine, ledgerdatetime)
@ -96,6 +96,6 @@ timelogentry = do
comment <- optionMaybe (many1 spacenonewline >> liftM2 (++) getParentAccount restofline) comment <- optionMaybe (many1 spacenonewline >> liftM2 (++) getParentAccount restofline)
return $ TimeLogEntry (read [code]) datetime (maybe "" rstrip comment) return $ TimeLogEntry (read [code]) datetime (maybe "" rstrip comment)
tests_Timelog = TestList [ tests_TimelogReader = TestList [
] ]

View File

@ -43,8 +43,8 @@ library
Hledger.Data.Utils Hledger.Data.Utils
Hledger.Read Hledger.Read
Hledger.Read.Utils Hledger.Read.Utils
Hledger.Read.Journal Hledger.Read.JournalReader
Hledger.Read.Timelog Hledger.Read.TimelogReader
Build-Depends: Build-Depends:
base >= 3 && < 5 base >= 3 && < 5
,containers ,containers

View File

@ -36,7 +36,7 @@ import Hledger.Cli.Utils
import Hledger.Cli.Version (version) import Hledger.Cli.Version (version)
import Hledger.Data hiding (insert, today) import Hledger.Data hiding (insert, today)
import Hledger.Read (journalFromPathAndString) import Hledger.Read (journalFromPathAndString)
import Hledger.Read.Journal (someamount) import Hledger.Read.JournalReader (someamount)
import Hledger.Web.Settings ( import Hledger.Web.Settings (
-- withConnectionPool -- withConnectionPool
-- , runConnectionPool -- , runConnectionPool

View File

@ -8,7 +8,7 @@ A history-aware add command to help with data entry.
module Hledger.Cli.Add module Hledger.Cli.Add
where where
import Hledger.Data import Hledger.Data
import Hledger.Read.Journal (someamount) import Hledger.Read.JournalReader (someamount)
import Hledger.Cli.Options import Hledger.Cli.Options
import Hledger.Cli.Register (registerReport, registerReportAsText) import Hledger.Cli.Register (registerReport, registerReportAsText)
#if __GLASGOW_HASKELL__ <= 610 #if __GLASGOW_HASKELL__ <= 610

View File

@ -8,7 +8,7 @@ import Hledger.Cli.Options (Opt(Debug), progname_cli)
import Hledger.Cli.Version (progversionstr) import Hledger.Cli.Version (progversionstr)
import Hledger.Data.Types (Journal,AccountName,Transaction(..),Posting(..),PostingType(..)) import Hledger.Data.Types (Journal,AccountName,Transaction(..),Posting(..),PostingType(..))
import Hledger.Data.Utils (strip, spacenonewline, restofline, parseWithCtx, assertParse, assertParseEqual, error') import Hledger.Data.Utils (strip, spacenonewline, restofline, parseWithCtx, assertParse, assertParseEqual, error')
import Hledger.Read.Journal (someamount,ledgeraccountname) import Hledger.Read.JournalReader (someamount,ledgeraccountname)
import Hledger.Data.Journal (nullctx) import Hledger.Data.Journal (nullctx)
import Hledger.Data.Amount (nullmixedamt) import Hledger.Data.Amount (nullmixedamt)
import Safe (atDef, maximumDef) import Safe (atDef, maximumDef)

View File

@ -34,7 +34,7 @@ import System.Time (ClockTime(TOD))
import Hledger.Data -- including testing utils in Hledger.Data.Utils import Hledger.Data -- including testing utils in Hledger.Data.Utils
import Hledger.Read (readJournal) import Hledger.Read (readJournal)
import Hledger.Read.Journal (someamount) import Hledger.Read.JournalReader (someamount)
import Hledger.Cli.Commands import Hledger.Cli.Commands
import Hledger.Cli.Options import Hledger.Cli.Options
import Hledger.Cli.Utils import Hledger.Cli.Utils