exec "$bup_python" "$0" ${1+"$@"}
"""
# end of bup preamble
+
# Copyright (C) 2010 Rob Browning
#
# This code is covered under the terms of the GNU Library General
# Public License as described in the bup LICENSE file.
+
+from __future__ import absolute_import, print_function
import sys, stat, errno
+
from bup import metadata, options, xstat
-from bup.helpers import handle_ctrl_c, parse_timestamp, saved_errors, \
+from bup.helpers import add_error, handle_ctrl_c, parse_timestamp, saved_errors, \
add_error, log
res = str(value) # Undo autoconversion.
try:
res = parse_timestamp(res)
- except ValueError, ex:
+ except ValueError as ex:
if ex.args:
o.fatal('unable to parse %s resolution "%s" (%s)'
% (field, value, ex))
for path in remainder:
try:
m = metadata.from_path(path, archive_path = path)
- except (OSError,IOError), e:
+ except (OSError,IOError) as e:
if e.errno == errno.ENOENT:
add_error(e)
continue
raise
if metadata.verbose >= 0:
if not first_path:
- print
+ print()
if atime_resolution != 1:
m.atime = (m.atime / atime_resolution) * atime_resolution
if mtime_resolution != 1:
m.mtime = (m.mtime / mtime_resolution) * mtime_resolution
if ctime_resolution != 1:
m.ctime = (m.ctime / ctime_resolution) * ctime_resolution
- print metadata.detailed_str(m, active_fields)
+ print(metadata.detailed_str(m, active_fields))
first_path = False
if saved_errors: