uniquify reader module names
This commit is contained in:
		
							parent
							
								
									bf1fe0a282
								
							
						
					
					
						commit
						a3a7a346ac
					
				@ -21,8 +21,8 @@ import Hledger.Data.Types (Journal(..))
 | 
			
		||||
import Hledger.Data.Journal (nullctx)
 | 
			
		||||
import Hledger.Data.Utils
 | 
			
		||||
import Hledger.Read.Common
 | 
			
		||||
import Hledger.Read.Journal as Journal
 | 
			
		||||
import Hledger.Read.Timelog as Timelog
 | 
			
		||||
import Hledger.Read.JournalReader as JournalReader
 | 
			
		||||
import Hledger.Read.TimelogReader as TimelogReader
 | 
			
		||||
 | 
			
		||||
import Control.Monad.Error
 | 
			
		||||
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.
 | 
			
		||||
readers :: [Reader]
 | 
			
		||||
readers = [
 | 
			
		||||
  Journal.reader
 | 
			
		||||
 ,Timelog.reader
 | 
			
		||||
  JournalReader.reader
 | 
			
		||||
 ,TimelogReader.reader
 | 
			
		||||
 ]
 | 
			
		||||
 | 
			
		||||
formats   = map rFormat readers
 | 
			
		||||
@ -140,10 +140,10 @@ tests_Hledger_Read = TestList
 | 
			
		||||
  [
 | 
			
		||||
 | 
			
		||||
   "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
 | 
			
		||||
    either error' (assertBool "journalFile parsing an empty file should give an empty journal" . null . jtxns) jE
 | 
			
		||||
 | 
			
		||||
  ,Journal.tests_Journal
 | 
			
		||||
  ,Timelog.tests_Timelog
 | 
			
		||||
  ,JournalReader.tests_JournalReader
 | 
			
		||||
  ,TimelogReader.tests_TimelogReader
 | 
			
		||||
  ]
 | 
			
		||||
 | 
			
		||||
@ -103,8 +103,8 @@ i, o, b, h
 | 
			
		||||
 | 
			
		||||
-}
 | 
			
		||||
 | 
			
		||||
module Hledger.Read.Journal (
 | 
			
		||||
       tests_Journal,
 | 
			
		||||
module Hledger.Read.JournalReader (
 | 
			
		||||
       tests_JournalReader,
 | 
			
		||||
       reader,
 | 
			
		||||
       journalFile,
 | 
			
		||||
       journalAddFile,
 | 
			
		||||
@ -560,7 +560,7 @@ numberpartsstartingwithpoint = do
 | 
			
		||||
  return ("",frac)
 | 
			
		||||
                     
 | 
			
		||||
 | 
			
		||||
tests_Journal = TestList [
 | 
			
		||||
tests_JournalReader = TestList [
 | 
			
		||||
 | 
			
		||||
   "ledgerTransaction" ~: do
 | 
			
		||||
    assertParseEqual (parseWithCtx nullctx ledgerTransaction entry1_str) entry1
 | 
			
		||||
@ -42,8 +42,8 @@ o 2007/03/10 17:26:02
 | 
			
		||||
 | 
			
		||||
-}
 | 
			
		||||
 | 
			
		||||
module Hledger.Read.Timelog (
 | 
			
		||||
       tests_Timelog,
 | 
			
		||||
module Hledger.Read.TimelogReader (
 | 
			
		||||
       tests_TimelogReader,
 | 
			
		||||
       reader,
 | 
			
		||||
)
 | 
			
		||||
where
 | 
			
		||||
@ -51,7 +51,7 @@ import Control.Monad.Error (ErrorT(..))
 | 
			
		||||
import Text.ParserCombinators.Parsec hiding (parse)
 | 
			
		||||
import Hledger.Data
 | 
			
		||||
import Hledger.Read.Common
 | 
			
		||||
import Hledger.Read.Journal (ledgerExclamationDirective, ledgerHistoricalPrice,
 | 
			
		||||
import Hledger.Read.JournalReader (ledgerExclamationDirective, ledgerHistoricalPrice,
 | 
			
		||||
                             ledgerDefaultYear, emptyLine, ledgerdatetime)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -96,6 +96,6 @@ timelogentry = do
 | 
			
		||||
  comment <- optionMaybe (many1 spacenonewline >> liftM2 (++) getParentAccount restofline)
 | 
			
		||||
  return $ TimeLogEntry (read [code]) datetime (maybe "" rstrip comment)
 | 
			
		||||
 | 
			
		||||
tests_Timelog = TestList [
 | 
			
		||||
tests_TimelogReader = TestList [
 | 
			
		||||
 ]
 | 
			
		||||
 | 
			
		||||
@ -43,8 +43,8 @@ library
 | 
			
		||||
                  Hledger.Data.Utils
 | 
			
		||||
                  Hledger.Read
 | 
			
		||||
                  Hledger.Read.Utils
 | 
			
		||||
                  Hledger.Read.Journal
 | 
			
		||||
                  Hledger.Read.Timelog
 | 
			
		||||
                  Hledger.Read.JournalReader
 | 
			
		||||
                  Hledger.Read.TimelogReader
 | 
			
		||||
  Build-Depends:
 | 
			
		||||
                  base >= 3 && < 5
 | 
			
		||||
                 ,containers
 | 
			
		||||
 | 
			
		||||
@ -36,7 +36,7 @@ import Hledger.Cli.Utils
 | 
			
		||||
import Hledger.Cli.Version (version)
 | 
			
		||||
import Hledger.Data hiding (insert, today)
 | 
			
		||||
import Hledger.Read (journalFromPathAndString)
 | 
			
		||||
import Hledger.Read.Journal (someamount)
 | 
			
		||||
import Hledger.Read.JournalReader (someamount)
 | 
			
		||||
import Hledger.Web.Settings (
 | 
			
		||||
    --   withConnectionPool
 | 
			
		||||
    -- , runConnectionPool
 | 
			
		||||
 | 
			
		||||
@ -8,7 +8,7 @@ A history-aware add command to help with data entry.
 | 
			
		||||
module Hledger.Cli.Add
 | 
			
		||||
where
 | 
			
		||||
import Hledger.Data
 | 
			
		||||
import Hledger.Read.Journal (someamount)
 | 
			
		||||
import Hledger.Read.JournalReader (someamount)
 | 
			
		||||
import Hledger.Cli.Options
 | 
			
		||||
import Hledger.Cli.Register (registerReport, registerReportAsText)
 | 
			
		||||
#if __GLASGOW_HASKELL__ <= 610
 | 
			
		||||
 | 
			
		||||
@ -8,7 +8,7 @@ import Hledger.Cli.Options (Opt(Debug), progname_cli)
 | 
			
		||||
import Hledger.Cli.Version (progversionstr)
 | 
			
		||||
import Hledger.Data.Types (Journal,AccountName,Transaction(..),Posting(..),PostingType(..))
 | 
			
		||||
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.Amount (nullmixedamt)
 | 
			
		||||
import Safe (atDef, maximumDef)
 | 
			
		||||
 | 
			
		||||
@ -34,7 +34,7 @@ import System.Time (ClockTime(TOD))
 | 
			
		||||
 | 
			
		||||
import Hledger.Data  -- including testing utils in Hledger.Data.Utils
 | 
			
		||||
import Hledger.Read (readJournal)
 | 
			
		||||
import Hledger.Read.Journal (someamount)
 | 
			
		||||
import Hledger.Read.JournalReader (someamount)
 | 
			
		||||
import Hledger.Cli.Commands
 | 
			
		||||
import Hledger.Cli.Options
 | 
			
		||||
import Hledger.Cli.Utils
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user