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:
100100 for k , v in inference_rules .items ():
101101 for vv in inference_rules [k ]:
102102 if vv .search (path ):
103+ logger .debug (f"Regex infered that path '{ path } ' is of filetype '{ k } '" )
103104 return k
104105 fp = Path (path )
105106 if not fp .exists ():
@@ -121,10 +122,13 @@ def infer_filetype(path: str) -> str:
121122 f"Failed to detect 'auto' filetype for '{ fp } ' with regex and even python-magic. Error: '{ err } '"
122123 ) from err
123124 if "pdf" in info :
125+ logger .debug (f"Magic infered that path '{ path } ' is of filetype 'pdf'" )
124126 return "pdf"
125127 elif "mpeg" in info or "mp3" in info :
128+ logger .debug (f"Magic infered that path '{ path } ' is of filetype 'local_audio'" )
126129 return "local_audio"
127130 elif "epub" in info :
131+ logger .debug (f"Magic infered that path '{ path } ' is of filetype 'epub'" )
128132 return "epub"
129133 else :
130134 raise NoInferrableFiletype (
You can’t perform that action at this time.
0 commit comments