1
0
mirror of https://github.com/google/adb-sync.git synced 2026-01-04 02:18:01 +00:00

More py2/3 fixes.

This commit is contained in:
Rudolf Polzer
2015-12-20 19:39:56 +01:00
parent d21617f70b
commit 012b326252

View File

@@ -468,8 +468,8 @@ class FileSyncer(object):
def __exit__(self, exc_type, exc_value, traceback): def __exit__(self, exc_type, exc_value, traceback):
if exc_type is not None: if exc_type is not None:
_print(b'Interrupted-%s-Delete: %s' % _print(b'Interrupted-%s-Delete: %s',
(b'Pull' if fs == os else b'Push', name)) b'Pull' if fs == os else b'Push', name)
if not dry_run: if not dry_run:
fs.unlink(name) fs.unlink(name)
return False return False
@@ -487,8 +487,7 @@ class FileSyncer(object):
else: else:
for name, s in reversed(self.dst_only[i]): for name, s in reversed(self.dst_only[i]):
dst_name = self.dst[i] + name dst_name = self.dst[i] + name
_print(b'%s-Delete: %s' % _print(b'%s-Delete: %s', self.push[i], dst_name)
(self.push[i], dst_name))
if stat.S_ISDIR(s.st_mode): if stat.S_ISDIR(s.st_mode):
if not self.dry_run: if not self.dry_run:
self.dst_fs[i].rmdir(dst_name) self.dst_fs[i].rmdir(dst_name)
@@ -586,10 +585,10 @@ class FileSyncer(object):
self.num_bytes += s.st_size self.num_bytes += s.st_size
if not self.dry_run: if not self.dry_run:
if self.preserve_times: if self.preserve_times:
_print(b'%s-Times: accessed %s, modified %s' % _print(b'%s-Times: accessed %s, modified %s',
(self.push[i], self.push[i],
time.asctime(time.localtime(s.st_atime)).encode('utf-8'), time.asctime(time.localtime(s.st_atime)).encode('utf-8'),
time.asctime(time.localtime(s.st_mtime)).encode('utf-8'))) time.asctime(time.localtime(s.st_mtime)).encode('utf-8'))
self.dst_fs[i].utime(dst_name, (s.st_atime, s.st_mtime)) self.dst_fs[i].utime(dst_name, (s.st_atime, s.st_mtime))
def TimeReport(self): def TimeReport(self):