mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 17:13:59 +00:00
update verbosity
This commit is contained in:
@@ -79,7 +79,7 @@ class Updater:
|
|||||||
dtpath = os.path.expanduser(dtpath)
|
dtpath = os.path.expanduser(dtpath)
|
||||||
|
|
||||||
if self._ignore([path, dtpath]):
|
if self._ignore([path, dtpath]):
|
||||||
self.log.sub('{} ignored'.format(dotfile.key))
|
self.log.sub('\"{}\" ignored'.format(dotfile.key))
|
||||||
return True
|
return True
|
||||||
if dotfile.trans_w:
|
if dotfile.trans_w:
|
||||||
# apply write transformation if any
|
# apply write transformation if any
|
||||||
@@ -174,7 +174,7 @@ class Updater:
|
|||||||
def _handle_file(self, path, dtpath, compare=True):
|
def _handle_file(self, path, dtpath, compare=True):
|
||||||
"""sync path (deployed file) and dtpath (dotdrop dotfile path)"""
|
"""sync path (deployed file) and dtpath (dotdrop dotfile path)"""
|
||||||
if self._ignore([path, dtpath]):
|
if self._ignore([path, dtpath]):
|
||||||
self.log.sub('{} ignored'.format(dtpath))
|
self.log.sub('\"{}\" ignored'.format(dtpath))
|
||||||
return True
|
return True
|
||||||
if self.debug:
|
if self.debug:
|
||||||
self.log.dbg('update for file {} and {}'.format(path, dtpath))
|
self.log.dbg('update for file {} and {}'.format(path, dtpath))
|
||||||
@@ -199,7 +199,7 @@ class Updater:
|
|||||||
if self.debug:
|
if self.debug:
|
||||||
self.log.dbg('cp {} {}'.format(path, dtpath))
|
self.log.dbg('cp {} {}'.format(path, dtpath))
|
||||||
shutil.copyfile(path, dtpath)
|
shutil.copyfile(path, dtpath)
|
||||||
self.log.sub('{} updated'.format(dtpath))
|
self.log.sub('\"{}\" updated'.format(dtpath))
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
self.log.warn('{} update failed, do manually: {}'.format(path, e))
|
self.log.warn('{} update failed, do manually: {}'.format(path, e))
|
||||||
return False
|
return False
|
||||||
@@ -213,7 +213,7 @@ class Updater:
|
|||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
dtpath = os.path.expanduser(dtpath)
|
dtpath = os.path.expanduser(dtpath)
|
||||||
if self._ignore([path, dtpath]):
|
if self._ignore([path, dtpath]):
|
||||||
self.log.sub('{} ignored'.format(dtpath))
|
self.log.sub('\"{}\" ignored'.format(dtpath))
|
||||||
return True
|
return True
|
||||||
# find the differences
|
# find the differences
|
||||||
diff = filecmp.dircmp(path, dtpath, ignore=None)
|
diff = filecmp.dircmp(path, dtpath, ignore=None)
|
||||||
@@ -237,7 +237,7 @@ class Updater:
|
|||||||
# match to dotdrop dotpath
|
# match to dotdrop dotpath
|
||||||
new = os.path.join(right, toadd)
|
new = os.path.join(right, toadd)
|
||||||
if self._ignore([exist, new]):
|
if self._ignore([exist, new]):
|
||||||
self.log.sub('{} ignored'.format(exist))
|
self.log.sub('\"{}\" ignored'.format(exist))
|
||||||
continue
|
continue
|
||||||
if self.dry:
|
if self.dry:
|
||||||
self.log.dry('would cp -r {} {}'.format(exist, new))
|
self.log.dry('would cp -r {} {}'.format(exist, new))
|
||||||
@@ -246,7 +246,7 @@ class Updater:
|
|||||||
self.log.dbg('cp -r {} {}'.format(exist, new))
|
self.log.dbg('cp -r {} {}'.format(exist, new))
|
||||||
# Newly created directory should be copied as is (for efficiency).
|
# Newly created directory should be copied as is (for efficiency).
|
||||||
shutil.copytree(exist, new)
|
shutil.copytree(exist, new)
|
||||||
self.log.sub('{} updated'.format(exist))
|
self.log.sub('\"{}\" dir added'.format(new))
|
||||||
|
|
||||||
# remove dirs that don't exist in deployed version
|
# remove dirs that don't exist in deployed version
|
||||||
for toremove in diff.right_only:
|
for toremove in diff.right_only:
|
||||||
@@ -264,7 +264,7 @@ class Updater:
|
|||||||
if not self._confirm_rm_r(old):
|
if not self._confirm_rm_r(old):
|
||||||
continue
|
continue
|
||||||
utils.remove(old)
|
utils.remove(old)
|
||||||
self.log.sub('{} removed'.format(old))
|
self.log.sub('\"{}\" dir removed'.format(old))
|
||||||
|
|
||||||
# handle files diff
|
# handle files diff
|
||||||
# sync files that exist in both but are different
|
# sync files that exist in both but are different
|
||||||
@@ -298,7 +298,7 @@ class Updater:
|
|||||||
if self.debug:
|
if self.debug:
|
||||||
self.log.dbg('cp {} {}'.format(exist, new))
|
self.log.dbg('cp {} {}'.format(exist, new))
|
||||||
shutil.copyfile(exist, new)
|
shutil.copyfile(exist, new)
|
||||||
self.log.sub('{} added'.format(exist))
|
self.log.sub('\"{}\" added'.format(new))
|
||||||
|
|
||||||
# remove files that don't exist in deployed version
|
# remove files that don't exist in deployed version
|
||||||
for toremove in diff.right_only:
|
for toremove in diff.right_only:
|
||||||
@@ -316,7 +316,7 @@ class Updater:
|
|||||||
if self.debug:
|
if self.debug:
|
||||||
self.log.dbg('rm {}'.format(new))
|
self.log.dbg('rm {}'.format(new))
|
||||||
utils.remove(new)
|
utils.remove(new)
|
||||||
self.log.sub('{} removed'.format(new))
|
self.log.sub('\"{}\" removed'.format(new))
|
||||||
|
|
||||||
# Recursively decent into common subdirectories.
|
# Recursively decent into common subdirectories.
|
||||||
for subdir in diff.subdirs.values():
|
for subdir in diff.subdirs.values():
|
||||||
|
|||||||
Reference in New Issue
Block a user