mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-20 17:52:50 +00:00
tahoe-fuse: print out helpful error messages if the caller didn't give the right context
This commit is contained in:
parent
ab03cbee25
commit
f2e9965c3c
@ -27,6 +27,9 @@ MagicDevNumber = 42
|
||||
|
||||
|
||||
def main(args = sys.argv[1:]):
|
||||
if not args:
|
||||
sys.stderr.write("%s requires one argument which is the mountpoint." % (sys.argv[0],))
|
||||
sys.exit(-1)
|
||||
fs = TahoeFS(os.path.expanduser(TahoeConfigDir))
|
||||
fs.main()
|
||||
|
||||
@ -101,10 +104,15 @@ class TahoeFS (fuse.Fuse):
|
||||
self.url = 'http://localhost:%d' % (port,)
|
||||
|
||||
def _init_bookmarks(self):
|
||||
f = open(os.path.join(self.confdir, 'fuse-bookmarks.uri'), 'r')
|
||||
uri = f.read().strip()
|
||||
f.close()
|
||||
|
||||
rootdirfn = os.path.join(self.confdir, 'private', 'root-dir.cap')
|
||||
try:
|
||||
f = open(rootdirfn, 'r')
|
||||
uri = f.read().strip()
|
||||
f.close()
|
||||
except EnvironmentError, le:
|
||||
sys.stderr("%s requires a directory capability in %s, but when it tried to read it, it got: %s" % (sys.argv[0], rootdirfn, le))
|
||||
raise le
|
||||
|
||||
self.bookmarks = TahoeDir(self.url, uri)
|
||||
|
||||
def _get_node(self, path):
|
||||
|
Loading…
x
Reference in New Issue
Block a user