]> arthur.barton.de Git - bup.git/blobdiff - cmd/on-cmd.py
Update HACKING, README, and note/ for 0.29.2
[bup.git] / cmd / on-cmd.py
index 9d6f683f357c869597bdb45f3ab1d735fb2e1e1b..e4f660c10bf15b4ba901ea2a9acc44004cb711bd 100755 (executable)
@@ -1,8 +1,17 @@
-#!/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 ...
@@ -58,11 +67,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)