packages feed

photoname 3.0.0 → 3.0.1

raw patch · 20 files changed

+61/−164 lines, 20 filesdep +HUnitdep +processdep +regex-posixdep ~base

Dependencies added: HUnit, process, regex-posix

Dependency ranges changed: base

Files

LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2007-2011 Dino Morelli+Copyright (c) 2007-2012 Dino Morelli All rights reserved.  Redistribution and use in source and binary forms, with or without
− README
@@ -1,27 +0,0 @@-photoname-------------author: Dino Morelli <dino@ui3.info>---*about*--photoname is a command-line utility for renaming/moving photo image-files. The new folder location and naming are determined by the the-photo shoot date information contained within the file's EXIF tags.--This program is known to build with GHC 6.12.3---*install*--With cabal-install, get it directly from Hackage:--   $ cabal install photoname--Or manually after unpacking source:--   $ runhaskell Setup.lhs configure-   $ runhaskell Setup.lhs build-   $ runhaskell Setup.lhs test-   $ runhaskell Setup.lhs install
− TODO
@@ -1,5 +0,0 @@-- Allow user to specify permissions for newly-created dirs and files. Bonus points for parsing the octal codes everyone knows and loves.--- Add a --force switch to disregard existing links.--- Deal gracefully with unknown dates. This means not just putting pictures into the 0000/0000-00-00 directory, but making sure that the _### serial number part is incremented from the highest one in there.
− doc/dev/notes
@@ -1,41 +0,0 @@-------- To change the app version:-   - Edit photoname.cabal-   - Edit src/Photoname/Opts.hs, usageText near the bottom of footer--   I'd like to make a script in util/ to automate this.-   After such a script has been made, may want to put developer notes on using it in doc/dev/<somefile>-------------File naming format:--yyyymmdd_[oth_]nnn[-e[n]].jpg-yyyymmdd-hhmmss[_oth][_ss].jpg--date: year month day-time: hour minute second-oth: could be photographer: 2 or 3 character initials-ss: edited or sized, optional number for more than one-   _sp _ep : sized/edited for printing-   _sd1920x1080 _ed : sized/edited for desktop-   _sw _ew : sized/edited for web---These files are arranged into a dir structure--top-level/-   0000/-      0000-00-00/-         00000000_001.jpg   -- Unknown pictures-         00000000_002.jpg-   2006/-      2006-10-13/-         20061013_431.jpg-         20061013_509.jpg-   2007/-      2007-01-30/-         20070130_002.jpg-         20070130_119-ew.jpg-      2007-04-19/-         20070419_bmd_323.jpg-         20070419_bmd_325-sd.jpg
− doc/hcar-photoname.tex
@@ -1,21 +0,0 @@-\begin{hcarentry}{photoname}-\label{photoname}-\report{Dino Morelli}%11/08-\status{stable, maintained}-\makeheader--photoname is a command-line utility for renaming/moving photo image files. The new folder location and naming are determined by the EXIF photo shoot date and the usually-camera-assigned serial number, often appearing in the filename.--photoname is on Hackage and can be acquired using darcs or other methods. See the project page below for more.--\FurtherReading-\begin{compactitem}-\item Project page:--\url{http://ui3.info/d/proj/photoname.html}--\item Source repository:--\texttt{darcs get} \url{http://ui3.info/darcs/photoname}-\end{compactitem}-\end{hcarentry}
photoname.cabal view
@@ -1,10 +1,10 @@ name:                photoname-cabal-version:       >= 1.2-version:             3.0.0+cabal-version:       >= 1.8+version:             3.0.1 build-type:          Simple license:             BSD3 license-file:        LICENSE-copyright:           2007-2011 Dino Morelli +copyright:           2007-2012 Dino Morelli  author:              Dino Morelli  maintainer:          Dino Morelli <dino@ui3.info> stability:           stable@@ -14,11 +14,31 @@    Command-line utility for renaming/moving photo image files based on     EXIF tags. category:            Application, Console-tested-with:         GHC>=6.8.2+tested-with:         GHC >= 7.6.1 +extra-source-files:  testsuite/resources/*.jpg+ executable           photoname    main-is:          photoname.hs    build-depends:    base >= 3 && < 5, directory, exif, filepath, mtl,                       old-locale, parsec, time, unix-   ghc-options:      -Wall+   other-modules:    Photoname.Common+                     Photoname.DateFormat+                     Photoname.Date+                     Photoname.Exif+                     Photoname.Opts+                     Photoname.SerialFormat    hs-source-dirs:   src+   ghc-options:      -Wall++test-suite           photoname-tests+   type:             exitcode-stdio-1.0+   main-is:          runtests.hs+   build-depends:    base, directory, exif, filepath, HUnit, mtl,+                     old-locale, parsec, process, regex-posix, time,+                     unix+   other-modules:    TestHelp+                     TestLink+                     Util+   hs-source-dirs:   src testsuite+   ghc-options:      -Wall
src/Photoname/Common.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> 
src/Photoname/Date.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> 
src/Photoname/DateFormat.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> 
src/Photoname/Exif.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> @@ -7,6 +7,7 @@ module Photoname.Exif    where +import Control.Exception import Control.Monad.Error import Graphics.Exif ( fromFile, getTag, Exif ) import System.IO.Error
src/Photoname/Opts.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> @@ -149,7 +149,7 @@          , "A photo shot on 2002-May-02 01:23:07 PM:"          , "   img_1790.jpg -> <PARENTDIR>/2002/2002-05-02/20020502-132307.jpg"          , ""-         , "The EXIF date/time stamp used for naming is the first of these fields to be found: DateTimeDigitized, DateTimeOriginal, DateTime"+         , "The EXIF date/time stamp used for naming is the first of these fields to be found: Exif.Photo.DateTimeDigitized, Exif.Photo.DateTimeOriginal, Exif.Image.DateTime"          , ""          , "The <PARENTDIR> is the one given by the --parent-dir switch and represents the top-level of where you're storing photos."          , ""@@ -183,5 +183,5 @@          , "photoname invoked with --suffix=_dwm :"          , "   20020502-132307_dwm.jpg"          , ""-         , "Version 3.0.0  Dino Morelli <dino@ui3.info>"+         , "Version 3.0.1  Dino Morelli <dino@ui3.info>"          ]
src/Photoname/SerialFormat.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> 
src/photoname.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> 
testsuite/TestHelp.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> @@ -8,7 +8,7 @@    where  import qualified Util-import Test.HUnit ( Test (..), assertBool, assertEqual )+import Test.HUnit ( Test (..), assertEqual )   testHelpAll :: Test
testsuite/TestLink.hs view
@@ -1,7 +1,9 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> +{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}+ module TestLink (    testLinkAll )@@ -11,7 +13,7 @@ import System.FilePath.Posix ( (</>), (<.>) ) import System.Posix.Files ( fileExist ) import System.Process ( waitForProcess )-import Test.HUnit ( Test (..), assertBool, assertString )+import Test.HUnit ( Test (..), assertBool ) import Text.Regex.Posix ( (=~) ) import qualified Util @@ -36,6 +38,8 @@    , TestLabel "testDirForFile" testDirForFile    ] ++topDir, oldPath, newLinkPathDate, newLinkPathSerial :: FilePath  topDir = Util.resourcesPath </> "foo" oldPath = Util.resourcesPath </> "img_1220.jpg"
testsuite/Util.hs view
@@ -1,4 +1,4 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> @@ -28,8 +28,8 @@    XXX Move this somewhere logical like Photoname.Util -} getProcessOutput :: FilePath -> [String] -> IO (String, ProcessHandle)-getProcessOutput path args = do-   (_, outH, _, procH) <- runInteractiveProcess path args Nothing Nothing+getProcessOutput path' args = do+   (_, outH, _, procH) <- runInteractiveProcess path' args Nothing Nothing    output <- hGetContents outH    return (output, procH) 
testsuite/runtests.hs view
@@ -1,19 +1,29 @@--- Copyright: 2007-2011 Dino Morelli+-- Copyright: 2007-2012 Dino Morelli -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info>  module Main    where -import Test.HUnit+import System.Exit+import Test.HUnit ( Counts (..), Test (..), runTestTT ) import TestHelp import TestLink   main :: IO () main = do-   runTestTT tests-   return ()+   counts <- runTestTT tests+   exit $ testsPassed counts+++exit :: Bool -> IO ()+exit True  = exitWith ExitSuccess+exit False = exitWith $ ExitFailure 1+++testsPassed :: Counts -> Bool+testsPassed (Counts _ _ e f) = (e == 0) && (f == 0)   tests :: Test
− util/post-get
@@ -1,3 +0,0 @@-#! /bin/sh--ln -s dist/build/photoname/photoname
− util/prefs/boring
@@ -1,37 +0,0 @@-# Boring file regexps:-\.hi$-\.o$-\.o\.cmd$-# *.ko files aren't boring by default because they might-# be Korean translations rather than kernel modules.-# \.ko$-\.ko\.cmd$-\.mod\.c$-(^|/)\.tmp_versions($|/)-(^|/)CVS($|/)-(^|/)RCS($|/)-~$-#(^|/)\.[^/]-(^|/)_darcs($|/)-\.bak$-\.BAK$-\.orig$-(^|/)vssver\.scc$-\.swp$-(^|/)MT($|/)-(^|/)\{arch\}($|/)-(^|/).arch-ids($|/)-(^|/),-\.class$-\.prof$-(^|/)\.DS_Store$-(^|/)BitKeeper($|/)-(^|/)ChangeSet($|/)-(^|/)\.svn($|/)-\.py[co]$-\#-\.cvsignore$-(^|/)Thumbs\.db$-(^|/)autom4te\.cache($|/)-(^|/)dist($|/)-\.setup-config$
− util/resources/test.conf
@@ -1,4 +0,0 @@-move-old-style-parent-dir=~/mypics-suffix=_dwm