Commit 9389c458 by willmcgugan

Fix for fsmount issue

parent acd246f1
...@@ -46,7 +46,7 @@ Mounts a file system on a system path""" ...@@ -46,7 +46,7 @@ Mounts a file system on a system path"""
try: try:
mount_path = args[0][:1] mount_path = args[0][:1]
except IndexError: except IndexError:
self.error('Driver letter\n') self.error('Driver letter required\n')
return 1 return 1
from fs.expose import dokan from fs.expose import dokan
...@@ -59,7 +59,7 @@ Mounts a file system on a system path""" ...@@ -59,7 +59,7 @@ Mounts a file system on a system path"""
try: try:
mount_path = args[0] mount_path = args[0]
except IndexError: except IndexError:
self.error('Mount path required\n') self.error(self.usage + '\n')
return 1 return 1
from fs.expose import fuse from fs.expose import fuse
...@@ -70,7 +70,7 @@ Mounts a file system on a system path""" ...@@ -70,7 +70,7 @@ Mounts a file system on a system path"""
try: try:
fs_url = args[0] fs_url = args[0]
except IndexError: except IndexError:
self.error('FS path required\n') self.error(self.usage + '\n')
return 1 return 1
try: try:
...@@ -78,9 +78,9 @@ Mounts a file system on a system path""" ...@@ -78,9 +78,9 @@ Mounts a file system on a system path"""
except IndexError: except IndexError:
if windows: if windows:
mount_path = mount_path[:1].upper() mount_path = mount_path[:1].upper()
self.error('Drive letter required') self.error(self.usage + '\n')
else: else:
self.error('Mount path required\n') self.error(self.usage + '\n')
return 1 return 1
fs, path = self.open_fs(fs_url, create_dir=True) fs, path = self.open_fs(fs_url, create_dir=True)
...@@ -113,9 +113,11 @@ Mounts a file system on a system path""" ...@@ -113,9 +113,11 @@ Mounts a file system on a system path"""
volname=str(fs)) volname=str(fs))
else: else:
if not os.path.exists(mount_path): if not os.path.exists(mount_path):
try:
os.makedirs(mount_path) os.makedirs(mount_path)
except:
pass
from fs.expose import fuse from fs.expose import fuse
self.output("Mounting %s on %s\n" % (fs, mount_path), True) self.output("Mounting %s on %s\n" % (fs, mount_path), True)
...@@ -129,8 +131,8 @@ Mounts a file system on a system path""" ...@@ -129,8 +131,8 @@ Mounts a file system on a system path"""
mp = fuse.mount(fs, mp = fuse.mount(fs,
mount_path, mount_path,
foreground=True) foreground=True)
else:
fs.close = lambda:None
def run(): def run():
return FSMount().run() return FSMount().run()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment