def print_log(self, verbose=False):
local_tz = get_localzone()
for vault in self.vaults:
try:
yield from vault.backend.open()
except VaultNotInitialized:
logger.error('%s has not been initialized. Use "syncrypt init" to register the folder as vault.' % vault)
continue
queue = yield from vault.backend.changes(None, None, verbose=verbose)
while True:
item = yield from queue.get()
if item is None:
break
store_hash, metadata, server_info = item
bundle = VirtualBundle(None, vault, store_hash=store_hash)
yield from bundle.write_encrypted_metadata(Once(metadata))
rev_id = server_info['id'].decode(vault.config.encoding)
created_at = iso8601.parse_date(server_info['created_at'].decode())\
.astimezone(local_tz)\
.strftime('%x %X')
operation = server_info['operation'].decode(vault.config.encoding)
if verbose:
user_email = server_info['email'].decode(vault.config.encoding)
print("%s | %s | %s | %-9s %s" % (created_at, rev_id, user_email,
operation, bundle.relpath))
else:
print("%s | %-9s %s" % (created_at, operation, bundle.relpath))
yield from self.wait()
评论列表
文章目录