drop TimeLog, it's no longer needed
This commit is contained in:
		
							parent
							
								
									bfed30d8d1
								
							
						
					
					
						commit
						d8fe2aabb2
					
				@ -509,7 +509,7 @@ numberpartsstartingwithpoint = do
 | 
				
			|||||||
  return ("",frac)
 | 
					  return ("",frac)
 | 
				
			||||||
                     
 | 
					                     
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{-| Parse a timelog file. Here is the timelog grammar, from timeclock.el 2.6:
 | 
					{-| Parse a timelog entry. Here is the timelog grammar from timeclock.el 2.6:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@
 | 
					@
 | 
				
			||||||
A timelog contains data in the form of a single entry per line.
 | 
					A timelog contains data in the form of a single entry per line.
 | 
				
			||||||
@ -545,12 +545,6 @@ i 2007/03/10 12:26:00 hledger
 | 
				
			|||||||
o 2007/03/10 17:26:02
 | 
					o 2007/03/10 17:26:02
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-}
 | 
					-}
 | 
				
			||||||
timelog :: GenParser Char LedgerFileCtx TimeLog
 | 
					 | 
				
			||||||
timelog = do
 | 
					 | 
				
			||||||
  entries <- many timelogentry <?> "timelog entry"
 | 
					 | 
				
			||||||
  eof
 | 
					 | 
				
			||||||
  return $ TimeLog entries
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
timelogentry :: GenParser Char LedgerFileCtx TimeLogEntry
 | 
					timelogentry :: GenParser Char LedgerFileCtx TimeLogEntry
 | 
				
			||||||
timelogentry = do
 | 
					timelogentry = do
 | 
				
			||||||
  code <- oneOf "bhioO"
 | 
					  code <- oneOf "bhioO"
 | 
				
			||||||
 | 
				
			|||||||
@ -18,9 +18,6 @@ import Ledger.LedgerTransaction
 | 
				
			|||||||
instance Show TimeLogEntry where 
 | 
					instance Show TimeLogEntry where 
 | 
				
			||||||
    show t = printf "%s %s %s" (show $ tlcode t) (show $ tldatetime t) (tlcomment t)
 | 
					    show t = printf "%s %s %s" (show $ tlcode t) (show $ tldatetime t) (tlcomment t)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
instance Show TimeLog where
 | 
					 | 
				
			||||||
    show tl = printf "TimeLog with %d entries" $ length $ timelog_entries tl
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- | Convert time log entries to ledger transactions. When there is no
 | 
					-- | Convert time log entries to ledger transactions. When there is no
 | 
				
			||||||
-- clockout, add one with the provided current time. Sessions crossing
 | 
					-- clockout, add one with the provided current time. Sessions crossing
 | 
				
			||||||
-- midnight are split into days to give accurate per-day totals.
 | 
					-- midnight are split into days to give accurate per-day totals.
 | 
				
			||||||
 | 
				
			|||||||
@ -112,10 +112,6 @@ data TimeLogEntry = TimeLogEntry {
 | 
				
			|||||||
      tlcomment :: String
 | 
					      tlcomment :: String
 | 
				
			||||||
    } deriving (Eq,Ord)
 | 
					    } deriving (Eq,Ord)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
data TimeLog = TimeLog {
 | 
					 | 
				
			||||||
      timelog_entries :: [TimeLogEntry]
 | 
					 | 
				
			||||||
    } deriving (Eq)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
data Transaction = Transaction {
 | 
					data Transaction = Transaction {
 | 
				
			||||||
      tnum :: Int,
 | 
					      tnum :: Int,
 | 
				
			||||||
      status :: Bool,
 | 
					      status :: Bool,
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								Tests.hs
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Tests.hs
									
									
									
									
									
								
							@ -734,9 +734,6 @@ tests = [
 | 
				
			|||||||
      nulltxn{date=parsedate "2008/01/01",description="- 2008/12/31",account="",amount=Mixed [dollars 15]}
 | 
					      nulltxn{date=parsedate "2008/01/01",description="- 2008/12/31",account="",amount=Mixed [dollars 15]}
 | 
				
			||||||
     ]
 | 
					     ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ,"timelog" ~: do
 | 
					 | 
				
			||||||
    parseWithCtx timelog timelog1_str `parseis` timelog1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  ,"transactionamount" ~: do
 | 
					  ,"transactionamount" ~: do
 | 
				
			||||||
    parseWithCtx transactionamount " $47.18" `parseis` Mixed [dollars 47.18]
 | 
					    parseWithCtx transactionamount " $47.18" `parseis` Mixed [dollars 47.18]
 | 
				
			||||||
    parseWithCtx transactionamount " $1." `parseis` 
 | 
					    parseWithCtx transactionamount " $1." `parseis` 
 | 
				
			||||||
@ -1135,15 +1132,6 @@ timelogentry1 = TimeLogEntry 'i' (parsedatetime "2007/03/11 16:19:00") "hledger"
 | 
				
			|||||||
timelogentry2_str  = "o 2007/03/11 16:30:00\n"
 | 
					timelogentry2_str  = "o 2007/03/11 16:30:00\n"
 | 
				
			||||||
timelogentry2 = TimeLogEntry 'o' (parsedatetime "2007/03/11 16:30:00") ""
 | 
					timelogentry2 = TimeLogEntry 'o' (parsedatetime "2007/03/11 16:30:00") ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
timelog1_str = concat [
 | 
					 | 
				
			||||||
                timelogentry1_str,
 | 
					 | 
				
			||||||
                timelogentry2_str
 | 
					 | 
				
			||||||
               ]
 | 
					 | 
				
			||||||
timelog1 = TimeLog [
 | 
					 | 
				
			||||||
            timelogentry1,
 | 
					 | 
				
			||||||
            timelogentry2
 | 
					 | 
				
			||||||
           ]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
price1_str = "P 2004/05/01 XYZ $55\n"
 | 
					price1_str = "P 2004/05/01 XYZ $55\n"
 | 
				
			||||||
price1 = HistoricalPrice (parsedate "2004/05/01") "XYZ" "$" 55
 | 
					price1 = HistoricalPrice (parsedate "2004/05/01") "XYZ" "$" 55
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user