aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfusearchive.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/fusearchive.py b/fusearchive.py
index d599370..ab13f0d 100755
--- a/fusearchive.py
+++ b/fusearchive.py
@@ -10,14 +10,6 @@
import logging, sys, os, fuse
import FuseArchive
-log_level = logging.DEBUG
-#log_level = logging.WARNING
-
-logging.basicConfig( level = log_level,
- format = '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(module)s:%(funcName)s() %(message)s',
- stream = sys.stderr,
- filemode = 'w' )
-
enable_stats = False
enable_psyco = False
@@ -49,10 +41,22 @@ server.multithreaded = False
server.parse(values=server, errex=1)
-if len(server.parser.largs) != 2:
+if server.parser.largs == None or len(server.parser.largs) != 2:
print "Usage: " + sys.argv[0] + " storageDirectory mountDirectory"
sys.exit(1)
+log_level = logging.WARNING
+# If debug is in the assembed opts then enable our debug too
+print server.fuse_args.assemble()
+if ' '.join( server.fuse_args.assemble() ).find( 'debug' ):
+ log_level = logging.DEBUG
+
+logging.basicConfig( level = log_level,
+ format = '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(module)s:%(funcName)s() %(message)s',
+ stream = sys.stderr,
+ filemode = 'w' )
+
+# Get backing store directory
server.root = server.parser.largs[0]
try: