]> arthur.barton.de Git - bup.git/commitdiff
bup-fuse: friendliness when python-fuse not found
authorGabriel Filion <lelutin@gmail.com>
Sat, 24 Apr 2010 20:33:31 +0000 (16:33 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sat, 24 Apr 2010 21:20:12 +0000 (17:20 -0400)
When used with the Python "fuse" module not installed on the system, the
bup-fuse command exits with an error.

To avoid confusing (or frustrating?) users, print a friendlier error
message that better describes what happens.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
cmd/fuse-cmd.py

index 64880975d861eb71be80ce34e15a6ea8b853a718..64655d472c4d08233aa0437da5e28c28fdeb8715 100755 (executable)
@@ -1,7 +1,13 @@
 #!/usr/bin/env python
-import sys, os, stat, errno, fuse, re, time, tempfile
+import sys, os, stat, errno, re, time, tempfile
 from bup import options, git, vfs
 from bup.helpers import *
+try:
+    import fuse
+except ImportError:
+    log('bup: error: The python "fuse" module is missing.\n' +
+        'To use bup fuse, first install the python-fuse package.\n')
+    sys.exit(1)
 
 
 class Stat(fuse.Stat):