Skip to content

Commit

Permalink
Merge branch 'volhovm/bump-versions'
Browse files Browse the repository at this point in the history
  • Loading branch information
volhovm committed Nov 27, 2017
2 parents 11c70fd + 1bea04a commit d0a960b
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 176 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ some.svg
.hpc/
*.tix
dist/
TAGS
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.1.3
=====

* Updated universum to 1.7.1, universum to 0.8.0. Switched to nightly/ghc-8.2.1.


0.1.2
=====

Expand Down
14 changes: 8 additions & 6 deletions orgstat.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: orgstat
version: 0.1.2
version: 0.1.3
synopsis: Statistics visualizer for org-mode
license: GPL-3
license-file: LICENSE
Expand Down Expand Up @@ -27,9 +27,10 @@ library
, OrgStat.Outputs.Types
, OrgStat.Util
, OrgStat.WorkMonad
, Paths_orgstat
build-depends: aeson >= 0.11.2.0
, attoparsec
, base >=4.9 && <4.10
, base >=4.9 && <4.11
, boxes >= 0.1.4
, bytestring
, colour >= 2.3.3
Expand All @@ -44,14 +45,14 @@ library
, hashable >= 1.2.4.0
, lens >= 4.14
, linear
, log-warper >= 1.3.1
, log-warper >= 1.7.1
, mtl >= 2.2.1
, optparse-simple
, orgmode-parse >= 0.2.0
, text >= 1.2.2.1
, time >= 1.6.0.1
, turtle >= 1.2.8
, universum >= 0.6.1
, universum >= 0.8.0
, yaml >= 0.8.21.1
hs-source-dirs: src
default-language: Haskell2010
Expand All @@ -74,7 +75,8 @@ library

executable orgstat
main-is: Main.hs
build-depends: base >=4.9 && <4.10
other-modules: Paths_orgstat
build-depends: base >=4.9 && <4.11
, bytestring
, directory
, exceptions
Expand All @@ -99,7 +101,7 @@ test-suite orgstat-test
, GlobalSpec
build-depends: HUnit >= 1.3.1.2
, QuickCheck
, base >=4.9 && <4.10
, base >=4.9 && <4.11
, colour >= 2.3.3
, hspec
, orgstat
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with import <nixpkgs> { };
haskell.lib.buildStackProject {
ghc = haskell.packages.ghc802.ghc;
ghc = haskell.packages.ghc822.ghc;
name = "orgstat";
buildInputs = [ zlib git openssh gnupg gnupg1compat xdg_utils firefox ];
LANG = "en_US.UTF-8";
Expand Down
7 changes: 3 additions & 4 deletions src/OrgStat/Ast.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ module OrgStat.Ast
, mergeClocks
) where

import Control.Lens (ASetter', makeLenses)
import Data.Time (LocalTime, NominalDiffTime, diffUTCTime, localTimeToUTC,
localTimeToUTC, utc)
import Control.Lens (ASetter', makeLenses)
import Data.Time (LocalTime, NominalDiffTime, diffUTCTime, localTimeToUTC, localTimeToUTC, utc)

import Universum
import Universum

----------------------------------------------------------------------------
-- Types
Expand Down
5 changes: 2 additions & 3 deletions src/OrgStat/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ module OrgStat.CLI
, parseCommonArgs
) where

import Universum
import Universum

import Options.Applicative.Simple (Parser, help, long, metavar, strOption,
switch)
import Options.Applicative.Simple (Parser, help, long, metavar, strOption, switch)

-- | Read-only arguments that inner application needs (in contrast to,
-- say, logging severity).
Expand Down
29 changes: 14 additions & 15 deletions src/OrgStat/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ module OrgStat.Config
, OrgStatConfig (..)
) where

import Data.Aeson (FromJSON (..), Value (Object, String), withObject,
withText, (.!=), (.:), (.:?))
import Data.Aeson.Types (typeMismatch)
import Data.Default (def)
import Data.List.NonEmpty (NonEmpty)
import qualified Data.Text as T
import Data.Time (LocalTime)
import Data.Time.Format (defaultTimeLocale, parseTimeM)
import Universum

import OrgStat.Outputs.Types (BlockParams, SummaryParams (..), TimelineParams,
bpMaxLength, bpUnicode, tpBackground,
tpColumnHeight, tpColumnWidth, tpLegend, tpTopDay)
import OrgStat.Scope (AstPath (..), ScopeModifier (..))
import OrgStat.Util (parseColour, (??~))
import Data.Aeson (FromJSON (..), Value (Object, String), withObject, withText, (.!=), (.:), (.:?))
import Data.Aeson.Types (typeMismatch)
import Data.Default (def)
import Data.List.NonEmpty (NonEmpty)
import qualified Data.Text as T
import Data.Time (LocalTime)
import Data.Time.Format (defaultTimeLocale, parseTimeM)
import Universum

import OrgStat.Outputs.Types (BlockParams, SummaryParams (..), TimelineParams, bpMaxLength,
bpUnicode, tpBackground, tpColumnHeight, tpColumnWidth, tpLegend,
tpTopDay)
import OrgStat.Scope (AstPath (..), ScopeModifier (..))
import OrgStat.Util (parseColour, (??~))

-- | Exception type for everything bad that happens with config,
-- starting from parsing to logic errors.
Expand Down
30 changes: 13 additions & 17 deletions src/OrgStat/Helpers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@ module OrgStat.Helpers
, resolveOutput
) where

import Universum
import Universum

import Control.Lens (at, views, (.=))
import qualified Data.List.NonEmpty as NE
import Data.Time (LocalTime (..), TimeOfDay (..), addDays,
getZonedTime, toGregorian,
zonedTimeToLocalTime)
import Data.Time.Calendar (addGregorianMonthsRollOver)
import Data.Time.Calendar.WeekDate (toWeekDate)
import Control.Lens (at, views, (.=))
import qualified Data.List.NonEmpty as NE
import Data.Time (LocalTime (..), TimeOfDay (..), addDays, getZonedTime, toGregorian,
zonedTimeToLocalTime)
import Data.Time.Calendar (addGregorianMonthsRollOver)
import Data.Time.Calendar.WeekDate (toWeekDate)

import OrgStat.Ast (Org (..), cutFromTo, mergeClocks, orgTitle)
import OrgStat.Config (ConfDate (..), ConfOutput (..),
ConfRange (..), ConfReport (..),
ConfScope (..), ConfigException (..),
OrgStatConfig (..))
import OrgStat.IO (readOrgFile)
import OrgStat.Scope (applyModifiers)
import OrgStat.WorkMonad (WorkM, wcConfig, wdReadFiles,
wdResolvedReports, wdResolvedScopes)
import OrgStat.Ast (Org (..), cutFromTo, mergeClocks, orgTitle)
import OrgStat.Config (ConfDate (..), ConfOutput (..), ConfRange (..), ConfReport (..),
ConfScope (..), ConfigException (..), OrgStatConfig (..))
import OrgStat.IO (readOrgFile)
import OrgStat.Scope (applyModifiers)
import OrgStat.WorkMonad (WorkM, wcConfig, wdReadFiles, wdResolvedReports, wdResolvedScopes)


-- | Converts config range to a pair of 'UTCTime', right bound not inclusive.
Expand Down
28 changes: 14 additions & 14 deletions src/OrgStat/IO.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ module OrgStat.IO
, readConfig
) where

import qualified Base as Base
import qualified Data.ByteString as BS
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import Data.Yaml (decodeEither)
import System.Directory (doesFileExist)
import System.FilePath (takeBaseName, takeExtension)
import System.Wlog (WithLogger, logDebug)
import Turtle (ExitCode (..), procStrict)
import Universum
import qualified Base as Base
import qualified Data.ByteString as BS
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import Data.Yaml (decodeEither)
import System.Directory (doesFileExist)
import System.FilePath (takeBaseName, takeExtension)
import System.Wlog (WithLogger, logDebug)
import Turtle (ExitCode (..), procStrict)
import Universum

import OrgStat.Ast (Org)
import OrgStat.Config (ConfigException (ConfigParseException), OrgStatConfig)
import OrgStat.Parser (runParser)
import OrgStat.Util (dropEnd)
import OrgStat.Ast (Org)
import OrgStat.Config (ConfigException (ConfigParseException), OrgStatConfig)
import OrgStat.Parser (runParser)
import OrgStat.Util (dropEnd)

data OrgIOException
= OrgIOException Text
Expand Down
28 changes: 13 additions & 15 deletions src/OrgStat/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ module OrgStat.Logic
( runOrgStat
) where

import Universum
import Universum

import Control.Lens (views)
import qualified Data.Text as T
import Data.Time (defaultTimeLocale, formatTime, getZonedTime)
import System.Directory (createDirectoryIfMissing)
import System.FilePath ((</>))
import System.Wlog (logDebug, logInfo)
import Turtle (shell)
import Control.Lens (views)
import qualified Data.Text as T
import Data.Time (defaultTimeLocale, formatTime, getZonedTime)
import System.Directory (createDirectoryIfMissing)
import System.FilePath ((</>))
import System.Wlog (logDebug, logInfo)
import Turtle (shell)

import OrgStat.CLI (CommonArgs (..))
import OrgStat.Config (ConfOutput (..), ConfOutputType (..),
OrgStatConfig (..))
import OrgStat.Helpers (resolveOutput, resolveReport)
import OrgStat.Outputs (genBlockOutput, genSummaryOutput, processTimeline,
tpColorSalt, writeReport)
import OrgStat.WorkMonad (WorkM, wcCommonArgs, wcConfig)
import OrgStat.CLI (CommonArgs (..))
import OrgStat.Config (ConfOutput (..), ConfOutputType (..), OrgStatConfig (..))
import OrgStat.Helpers (resolveOutput, resolveReport)
import OrgStat.Outputs (genBlockOutput, genSummaryOutput, processTimeline, tpColorSalt, writeReport)
import OrgStat.WorkMonad (WorkM, wcCommonArgs, wcConfig)

-- | Main application logic.
runOrgStat :: WorkM ()
Expand Down
10 changes: 5 additions & 5 deletions src/OrgStat/Outputs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module OrgStat.Outputs
( module Exports
) where

import OrgStat.Outputs.Block as Exports
import OrgStat.Outputs.Class as Exports
import OrgStat.Outputs.Summary as Exports
import OrgStat.Outputs.Timeline as Exports
import OrgStat.Outputs.Types as Exports
import OrgStat.Outputs.Block as Exports
import OrgStat.Outputs.Class as Exports
import OrgStat.Outputs.Summary as Exports
import OrgStat.Outputs.Timeline as Exports
import OrgStat.Outputs.Types as Exports
15 changes: 7 additions & 8 deletions src/OrgStat/Outputs/Block.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ module OrgStat.Outputs.Block
( genBlockOutput
) where

import Universum
import Unsafe (unsafeLast)
import Universum
import Unsafe (unsafeLast)

import qualified Data.Text as T
import Text.PrettyPrint.Boxes (center1, hsep, left, render, right, text, vcat)
import qualified Data.Text as T
import Text.PrettyPrint.Boxes (center1, hsep, left, render, right, text, vcat)

import OrgStat.Ast (Org, filterHasClock, orgSubtrees, orgTitle,
orgTotalDuration)
import OrgStat.Outputs.Types (BlockOutput (..), BlockParams (..))
import OrgStat.Util (dropEnd, timeF)
import OrgStat.Ast (Org, filterHasClock, orgSubtrees, orgTitle, orgTotalDuration)
import OrgStat.Outputs.Types (BlockOutput (..), BlockParams (..))
import OrgStat.Util (dropEnd, timeF)

data BlockFrames = BlockFrames
{ bfAngle1 :: Text
Expand Down
13 changes: 6 additions & 7 deletions src/OrgStat/Outputs/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ module OrgStat.Outputs.Class
( ReportOutput (..)
) where

import Universum
import Universum

import qualified Data.Text.IO as T
import qualified Diagrams.Backend.SVG as DB
import qualified Diagrams.Prelude as D
import System.FilePath (replaceExtension)
import qualified Data.Text.IO as T
import qualified Diagrams.Backend.SVG as DB
import qualified Diagrams.Prelude as D
import System.FilePath (replaceExtension)

import OrgStat.Outputs.Types (BlockOutput (..), SummaryOutput (..),
TimelineOutput (..))
import OrgStat.Outputs.Types (BlockOutput (..), SummaryOutput (..), TimelineOutput (..))

-- | Things that reporters output an what we can do with them.
class ReportOutput a where
Expand Down
16 changes: 8 additions & 8 deletions src/OrgStat/Outputs/Summary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ module OrgStat.Outputs.Summary
( genSummaryOutput
) where

import Universum
import Universum

import Control.Lens (views)
import Control.Lens (views)
import qualified Data.Attoparsec.ByteString.Char8 as A

import OrgStat.Ast (filterHasClock, orgTotalDuration)
import OrgStat.Config (confReports, crName)
import OrgStat.Helpers (resolveReport)
import OrgStat.Outputs.Types (SummaryOutput (..), SummaryParams (..))
import OrgStat.Util (timeF)
import OrgStat.WorkMonad (WorkM, wcConfig)
import OrgStat.Ast (filterHasClock, orgTotalDuration)
import OrgStat.Config (confReports, crName)
import OrgStat.Helpers (resolveReport)
import OrgStat.Outputs.Types (SummaryOutput (..), SummaryParams (..))
import OrgStat.Util (timeF)
import OrgStat.WorkMonad (WorkM, wcConfig)


-- | Tokenizes summary template string.
Expand Down
28 changes: 13 additions & 15 deletions src/OrgStat/Outputs/Timeline.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ module OrgStat.Outputs.Timeline
( processTimeline
) where

import Data.Colour.CIE (luminance)
import Data.List (lookup, nub)
import qualified Data.Text as T
import Data.Time (Day, DiffTime, LocalTime (..), defaultTimeLocale,
formatTime, timeOfDayToTime)
import Diagrams.Backend.SVG (B)
import qualified Diagrams.Prelude as D
import Data.Colour.CIE (luminance)
import Data.List (lookup, nub)
import qualified Data.Text as T
import Data.Time (Day, DiffTime, LocalTime (..), defaultTimeLocale, formatTime, timeOfDayToTime)
import Diagrams.Backend.SVG (B)
import qualified Diagrams.Prelude as D
import qualified Prelude
import Text.Printf (printf)
import Universum

import OrgStat.Ast (Clock (..), Org (..), orgClocks, traverseTree)
import OrgStat.Outputs.Types (TimelineOutput (..), TimelineParams, tpBackground,
tpColorSalt, tpColumnHeight, tpColumnWidth,
tpLegend, tpTopDay)
import OrgStat.Util (addLocalTime, hashColour)
import Text.Printf (printf)
import Universum

import OrgStat.Ast (Clock (..), Org (..), orgClocks, traverseTree)
import OrgStat.Outputs.Types (TimelineOutput (..), TimelineParams, tpBackground, tpColorSalt,
tpColumnHeight, tpColumnWidth, tpLegend, tpTopDay)
import OrgStat.Util (addLocalTime, hashColour)



Expand Down
10 changes: 5 additions & 5 deletions src/OrgStat/Outputs/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ module OrgStat.Outputs.Types
, BlockOutput (..)
) where

import Universum
import Universum

import Control.Lens (makeLenses)
import Control.Lens (makeLenses)

import Data.Default (Default (..))
import Diagrams.Backend.SVG (B)
import qualified Diagrams.Prelude as D
import Data.Default (Default (..))
import Diagrams.Backend.SVG (B)
import qualified Diagrams.Prelude as D

----------------------------------------------------------------------------
-- Timeline
Expand Down
Loading

0 comments on commit d0a960b

Please sign in to comment.