summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChrisReuter <>2018-06-22 22:05:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-06-22 22:05:00 (GMT)
commit2bdf12d929351b0b5d42e5f6fb148eb1e7357497 (patch)
treee5e37e1b4adbe1cfe1a97b251c2208e7b3429e50
parent5f89e2ab49b35ac41c6ded441740c15887619eac (diff)
version 0.1.2.120.1.2.12
-rw-r--r--README.md16
-rw-r--r--Villefort.cabal12
-rw-r--r--src/Villefort.hs2
-rw-r--r--src/Villefort/Config.hs11
-rw-r--r--src/Villefort/Daily.hs26
5 files changed, 23 insertions, 44 deletions
diff --git a/README.md b/README.md
index 52dae3b..905e7a5 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,24 @@
# Villefort
-Villefort is a time managment system written in Haskell.
+Villefort is a time management system written in Haskell.
-## Version 1.2.11
+## Version 1.2.12
- Integrated date and day tracking into database to stop file corruption.
-[default config](https://github.com/Chrisr850/Villefort/blob/master/src/Villefort/Config.hs)
+[default config](https://github.com/alicereuter/Villefort/blob/master/src/Villefort/Config.hs)
# Home screen
-![alt text](https://raw.githubusercontent.com/Chrisr850/Villefort/master/data/screen.png)
+![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen.png)
# Add new todos
-![alt text](https://raw.githubusercontent.com/Chrisr850/Villefort/master/data/screen01.png)
+![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen01.png)
# Stats page
-![alt text](https://raw.githubusercontent.com/Chrisr850/Villefort/master/data/screen02.png)
+![alt text](https://raw.githubusercontent.com/alicereuter/Villefort/master/data/screen02.png)
# To install
1. Install cabal (https://www.haskell.org/platform/)
2. In terminal or command prompt run `cabal install Villefort`.
3. and then `cabal run Villefort`.
-4. You will be able to see the homescreen by typing localhost:3002 into your favorite browser.
+4. You will be able to see the home screen by typing localhost:3002 into your favorite browser.
## Configure your villefort
create a custom main method in ~.villefort/villefort.hs. Below is an example.
@@ -48,7 +48,7 @@ main = villefort def {
calendar = pure ["","check calendar","admin"]
scan = pure ["scan class notes","scan","admin"]
-path = "/home/chris/.villefort/push"
+-- | functionally generate increasing sets of push ups
more = do
z <- S.readFile path -- readfile to get # push ups
let num = read z :: Double
diff --git a/Villefort.cabal b/Villefort.cabal
index 87072cf..cdebed9 100644
--- a/Villefort.cabal
+++ b/Villefort.cabal
@@ -1,13 +1,13 @@
name: Villefort
-version: 0.1.2.11
+version: 0.1.2.12
synopsis: Villefort is a task manager and time tracker
description: Villefort is a browser based time tracker built around a sqlite3 database.
-homepage: https://github.com/Chrisr850/Villefort#readme
+homepage: https://github.com/alicereuter/Villefort#readme
license: BSD3
license-file: LICENSE
-author: Chris Reuter
-maintainer: creuter@lsoc.org
-copyright: 2017 Chris Reuter
+author: Alice Reuter
+maintainer: alicereuterdev@gmail.com
+copyright: 2017 Alice Reuter
category: Web
build-type: Simple
extra-source-files: README.md
@@ -93,4 +93,4 @@ test-suite Villefort-test
source-repository head
type: git
- location: https://github.com/Chrisr850/Villefort
+ location: https://github.com/alicereuter/Villefort
diff --git a/src/Villefort.hs b/src/Villefort.hs
index 9fc28c4..e0d874c 100644
--- a/src/Villefort.hs
+++ b/src/Villefort.hs
@@ -1,3 +1 @@
module Villefort where
-
-import Villefort.Config
diff --git a/src/Villefort/Config.hs b/src/Villefort/Config.hs
index 7fe71f8..4b8f7e2 100644
--- a/src/Villefort/Config.hs
+++ b/src/Villefort/Config.hs
@@ -1,9 +1,9 @@
module Villefort.Config where
-import System.Process
import Villefort.Definitions
-import Villefort.Database
+-- | Default configuration of VConfig
+def :: VConfig
def = VConfig {
daily = [return []], --daily tasks
monthly =[[]], -- not implemented
@@ -15,7 +15,8 @@ def = VConfig {
colors = defColors, -- Colors to use first is closest task
database = [] -- flag for debugging sets database path
}
-
+-- | Default weekly schedule by default is empty
+defWeekly :: Weekly
defWeekly = Weekly {
monday = [return []],
tuesday =[return[]],
@@ -25,6 +26,6 @@ defWeekly = Weekly {
saturday = [return[]],
sunday = [return []]
}
-
+-- | Default colors for Villefort
+defColors :: [String]
defColors = ["#0d47a1","#1565c0","#1976d2","#1e88e5","#2196f3","#42a5f5","#64b5f6","#90caf9"]
--- ghc -o /home/chris/.villefort/villefort /home/chris/.villefort/villefort.\
diff --git a/src/Villefort/Daily.hs b/src/Villefort/Daily.hs
index 571108c..162652d 100644
--- a/src/Villefort/Daily.hs
+++ b/src/Villefort/Daily.hs
@@ -1,18 +1,14 @@
{-# LANGUAGE FlexibleContexts #-}
module Villefort.Daily where
---import Villefort.Time
import Villefort.Definitions
import Villefort.Database
-
import Control.Monad.Reader
import Data.Time
import Data.Time.Calendar.OrdinalDate
import Data.List.Split as S
-import System.IO.Strict as S
-import Paths_Villefort
import Control.Concurrent (threadDelay)
-
+-- | Date representation
data D = D { year :: Integer,
month :: Int,
day :: Int} deriving (Show)
@@ -47,22 +43,6 @@ readDate = do
rawDate <- makeQuery "select date from dates where type = 'date';"
return $ unpackStringToDate $ head $ head $ rawDate
-{-
-writeDate :: IO ()
-writeDate = do
- date <- show <$> getDate
- datePath <- getDataFileName "data/date"
- writeFile datePath date
-
-
-readDate :: IO D
-readDate = do
- datePath <- getDataFileName "data/date"
- rawDate <- S.readFile datePath
- let date = unpackStringToDate rawDate
- return date
--}
-
writeDay :: (MonadReader VConfig m, MonadIO m) => m ()
writeDay = do
newDay <- liftIO $ show <$> getDay
@@ -129,7 +109,6 @@ selector conf x
---man :: IO ()
man :: VConfig -> IO ()
man conf = do
oldDate <- runReaderT readDate conf
@@ -141,6 +120,7 @@ man conf = do
runReaderT writeDate conf
runReaderT writeDay conf
threadDelay 18000000
-
+
+-- | Run daily check for updates
dailyCheck :: VConfig -> IO b
dailyCheck conf = forever$ man conf