aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-08-07 16:36:07 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-08-07 16:36:07 (GMT)
commit5883164f22e8b092effaa9185dd5b8379d01e8da (patch)
tree00e07a2cd076ed05b41d8486eec52c6d4186c0c9
parent8abf1640d87984df0b1718adc2a6b36f63a0950f (diff)
downloadfusearchive-5883164f22e8b092effaa9185dd5b8379d01e8da.zip
fusearchive-5883164f22e8b092effaa9185dd5b8379d01e8da.tar.gz
fusearchive-5883164f22e8b092effaa9185dd5b8379d01e8da.tar.bz2
Turn on debugging with -d instead of having to edit the script
-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: