-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/bup-python" || exit $?
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
+
+from __future__ import absolute_import, print_function
import sys, os
+
from bup import git, options
-from bup.helpers import *
+from bup.helpers import add_error, handle_ctrl_c, log, qprogress, saved_errors
+
optspec = """
bup list-idx [--find=<prefix>] <idxfilenames...>
for name in extra:
try:
ix = git.open_idx(name)
- except git.GitError, e:
+ except git.GitError as e:
add_error('%s: %s' % (name, e))
continue
if len(opt.find) == 40:
if ix.exists(bin):
- print name, find
+ print(name, find)
else:
# slow, exhaustive search
for _i in ix:
i = str(_i).encode('hex')
if i.startswith(find):
- print name, i
+ print(name, i)
qprogress('Searching: %d\r' % count)
count += 1