File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ def infer_filetype(path: str) -> str:
100
100
for k , v in inference_rules .items ():
101
101
for vv in inference_rules [k ]:
102
102
if vv .search (path ):
103
+ logger .debug (f"Regex infered that path '{ path } ' is of filetype '{ k } '" )
103
104
return k
104
105
fp = Path (path )
105
106
if not fp .exists ():
@@ -121,10 +122,13 @@ def infer_filetype(path: str) -> str:
121
122
f"Failed to detect 'auto' filetype for '{ fp } ' with regex and even python-magic. Error: '{ err } '"
122
123
) from err
123
124
if "pdf" in info :
125
+ logger .debug (f"Magic infered that path '{ path } ' is of filetype 'pdf'" )
124
126
return "pdf"
125
127
elif "mpeg" in info or "mp3" in info :
128
+ logger .debug (f"Magic infered that path '{ path } ' is of filetype 'local_audio'" )
126
129
return "local_audio"
127
130
elif "epub" in info :
131
+ logger .debug (f"Magic infered that path '{ path } ' is of filetype 'epub'" )
128
132
return "epub"
129
133
else :
130
134
raise NoInferrableFiletype (
You can’t perform that action at this time.
0 commit comments