1
from renamer import logging, util
2
from renamer.plugin import RenamingAction
6
class MoveAction(RenamingAction):
10
If the source and destination are on different logical devices a
11
copy-delete will be used, unless the C{'one-file-system'} option is
17
def _move(self, src, dst, options):
18
self.prepare(dst, options)
19
logging.msg('Move: %s => %s' % (src.path, dst.path))
20
util.rename(src, dst, oneFileSystem=options['one-file-system'])
25
def do(self, options):
26
self._move(self.src, self.dst, options)
29
def undo(self, options):
30
self._move(self.dst, self.src, options)
34
class SymlinkAction(RenamingAction):
43
def do(self, options):
44
self.prepare(self.dst, options)
45
logging.msg('Symlink: %s => %s' % (self.src.path, self.dst.path))
46
self.src.linkTo(self.dst)
49
def undo(self, options):
51
logging.msg('Symlink: Removing %s' % (self.dst.path,))