]> arthur.barton.de Git - bup.git/blobdiff - cmd/on-cmd.py
Add bup get; see the documentation for further information
[bup.git] / cmd / on-cmd.py
index 9d6f683f357c869597bdb45f3ab1d735fb2e1e1b..0643ef8002e517e3808e436d32313911868f43d7 100755 (executable)
@@ -1,13 +1,23 @@
-#!/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
 import sys, os, struct, getopt, subprocess, signal
+
 from subprocess import PIPE
 from bup import options, ssh, path
-from bup.helpers import *
+from bup.helpers import DemuxConn, log
+
 
 optspec = """
 bup on <hostname> index ...
 bup on <hostname> save ...
 bup on <hostname> split ...
+bup on <hostname> get ...
 """
 o = options.Options(optspec, optfunc=getopt.getopt)
 (opt, flags, extra) = o.parse(sys.argv[1:])
@@ -58,11 +68,11 @@ try:
                 if sp:
                     sp.wait()
                 break
-            except SigException, e:
+            except SigException as e:
                 log('\nbup on: %s\n' % e)
                 os.kill(p.pid, e.signum)
                 ret = 84
-except SigException, e:
+except SigException as e:
     if ret == 0:
         ret = 99
     log('\nbup on: %s\n' % e)