Browse Source

support telling us that you want debug information on why calling

your function failed...  Default to off.. makes debugging a lot
easier when testing the auto detect feature..

[git-p4: depot-paths = "//depot/": change = 1378]
main
John-Mark Gurney 15 years ago
parent
commit
055ceab9be
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      FSStorage.py

+ 6
- 6
FSStorage.py View File

@@ -27,8 +27,8 @@ mimedict = static.loadMimeTypes()

_klassfuns = []

def registerklassfun(fun):
_klassfuns.append(fun)
def registerklassfun(fun, debug=False):
_klassfuns.append((fun, debug))

_filestoignore = {
'.DS_Store': None
@@ -237,7 +237,7 @@ def dofileadd(path, name):
fobj = open(fsname)
except:
fobj = None
for i in itertools.chain(( ignoreFiles, ), _klassfuns, ( defFS, )):
for i, debug in itertools.chain(( (ignoreFiles, False), ), _klassfuns, ( (defFS, False), )):
try:
try:
# incase the call expects a clean file
@@ -250,9 +250,9 @@ def dofileadd(path, name):
if klass is not None:
break
except:
#import traceback
#traceback.print_exc(file=log.logfile)
pass
if debug:
import traceback
traceback.print_exc(file=log.logfile)

if klass is None or klass is IgnoreFile:
return None, None, None, None


Loading…
Cancel
Save