rename modules for data types into Types/ directory
This commit is contained in:
parent
971ab27e78
commit
703c437bd9
32 changed files with 61 additions and 59 deletions
|
@ -22,7 +22,7 @@ import qualified Command.Move
|
|||
import qualified Remote
|
||||
import qualified GitRepo as Git
|
||||
import Backend
|
||||
import Key
|
||||
import Types.Key
|
||||
import Utility
|
||||
|
||||
type UnusedMap = M.Map String Key
|
||||
|
|
|
@ -18,7 +18,7 @@ import Utility
|
|||
import qualified Backend
|
||||
import Content
|
||||
import Messages
|
||||
import Key
|
||||
import Types.Key
|
||||
|
||||
command :: [Command]
|
||||
command = [repoCommand "fromkey" paramPath seek
|
||||
|
|
|
@ -16,7 +16,7 @@ import Data.String.Utils
|
|||
import Command
|
||||
import qualified Annex
|
||||
import qualified Remote
|
||||
import qualified RemoteClass
|
||||
import qualified Types.Remote as R
|
||||
import qualified GitRepo as Git
|
||||
import Utility
|
||||
import Types
|
||||
|
@ -54,12 +54,12 @@ start ws = notBareRepo $ do
|
|||
else err $ "Either a new name, or one of these existing special remotes: " ++ join " " names
|
||||
|
||||
|
||||
perform :: RemoteClass.RemoteType Annex -> UUID -> RemoteClass.RemoteConfig -> CommandPerform
|
||||
perform :: R.RemoteType Annex -> UUID -> R.RemoteConfig -> CommandPerform
|
||||
perform t u c = do
|
||||
c' <- RemoteClass.setup t u c
|
||||
c' <- R.setup t u c
|
||||
next $ cleanup u c'
|
||||
|
||||
cleanup :: UUID -> RemoteClass.RemoteConfig -> CommandCleanup
|
||||
cleanup :: UUID -> R.RemoteConfig -> CommandCleanup
|
||||
cleanup u c = do
|
||||
Remote.configSet u c
|
||||
g <- Annex.gitRepo
|
||||
|
@ -73,7 +73,7 @@ cleanup u c = do
|
|||
return True
|
||||
|
||||
{- Look up existing remote's UUID and config by name, or generate a new one -}
|
||||
findByName :: String -> Annex (UUID, RemoteClass.RemoteConfig)
|
||||
findByName :: String -> Annex (UUID, R.RemoteConfig)
|
||||
findByName name = do
|
||||
m <- Remote.readRemoteLog
|
||||
maybe generate return $ findByName' name m
|
||||
|
@ -82,7 +82,7 @@ findByName name = do
|
|||
uuid <- liftIO $ genUUID
|
||||
return (uuid, M.insert nameKey name M.empty)
|
||||
|
||||
findByName' :: String -> M.Map UUID RemoteClass.RemoteConfig -> Maybe (UUID, RemoteClass.RemoteConfig)
|
||||
findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
|
||||
findByName' n m = if null matches then Nothing else Just $ head matches
|
||||
where
|
||||
matches = filter (matching . snd) $ M.toList m
|
||||
|
@ -98,14 +98,14 @@ remoteNames = do
|
|||
return $ catMaybes $ map ((M.lookup nameKey) . snd) $ M.toList m
|
||||
|
||||
{- find the specified remote type -}
|
||||
findType :: RemoteClass.RemoteConfig -> Annex (RemoteClass.RemoteType Annex)
|
||||
findType :: R.RemoteConfig -> Annex (R.RemoteType Annex)
|
||||
findType config = maybe unspecified specified $ M.lookup typeKey config
|
||||
where
|
||||
unspecified = error "Specify the type of remote with type="
|
||||
specified s = case filter (findtype s) Remote.remoteTypes of
|
||||
[] -> error $ "Unknown remote type " ++ s
|
||||
(t:_) -> return t
|
||||
findtype s i = RemoteClass.typename i == s
|
||||
findtype s i = R.typename i == s
|
||||
|
||||
{- The name of a configured remote is stored in its config using this key. -}
|
||||
nameKey :: String
|
||||
|
|
|
@ -14,8 +14,8 @@ import Data.List
|
|||
import qualified Data.Map as M
|
||||
|
||||
import qualified Annex
|
||||
import qualified BackendClass
|
||||
import qualified RemoteClass
|
||||
import qualified Types.Backend as B
|
||||
import qualified Types.Remote as R
|
||||
import qualified Remote
|
||||
import qualified Command.Unused
|
||||
import qualified GitRepo as Git
|
||||
|
@ -23,7 +23,7 @@ import Command
|
|||
import Types
|
||||
import DataUnits
|
||||
import Content
|
||||
import Key
|
||||
import Types.Key
|
||||
import Locations
|
||||
|
||||
-- a named computation that produces a statistic
|
||||
|
@ -97,11 +97,11 @@ showStat s = calc =<< s
|
|||
supported_backends :: Stat
|
||||
supported_backends = stat "supported backends" $
|
||||
lift (Annex.getState Annex.supportedBackends) >>=
|
||||
return . unwords . (map BackendClass.name)
|
||||
return . unwords . (map B.name)
|
||||
|
||||
supported_remote_types :: Stat
|
||||
supported_remote_types = stat "supported remote types" $
|
||||
return $ unwords $ map RemoteClass.typename Remote.remoteTypes
|
||||
return $ unwords $ map R.typename Remote.remoteTypes
|
||||
|
||||
local_annex_size :: Stat
|
||||
local_annex_size = stat "local annex size" $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue