@@ -112,21 +112,34 @@ def should_extract(location, kinds, ignore_pattern=()):
112112 Return True if this location should be extracted based on the provided kinds
113113 """
114114 location = os .path .abspath (os .path .expanduser (location ))
115- ignore_pattern = {extension : 'User ignore: Supplied by --ignore' for extension in ignore_pattern }
115+ ignore_pattern = {extension : 'User ignore: Supplied by --ignore'
116+ for extension in ignore_pattern }
116117 should_ignore = is_ignored (location , ignore_pattern )
117118 extractor = get_extractor (location , kinds = kinds )
118119
119120 if TRACE_DEEP :
120- logger .debug (f' should_extract: extractor: { extractor } , should_ignore: { should_ignore } ' )
121+ logger .debug (
122+ f' should_extract: extractor: { extractor } , '
123+ f'should_ignore: { should_ignore } '
124+ )
121125
122126 if extractor and not should_ignore :
123127 return True
124128
125129
126130def get_extractor (location , kinds = all_kinds ):
127131 """
128- Return an extraction callable that can extract the file at location or
129- an None if no extract function is found.
132+ Return an extraction callable that can extract the file at ``location`` or
133+ None if no extraction callable function is found.
134+ Limit the search for an extractor to the ``kinds`` list of archive kinds.
135+ See extractcode.all_kinds for details.
136+
137+ An extraction callable should accept these arguments:
138+ - location of the file to extract
139+ - target_dir where to extract
140+ It should extract files from the `location` in the `target_dir` directory.
141+ It must return a list of warning messages if any or an empty list.
142+ It must raise Exceptions on errors.
130143 """
131144 assert location
132145 location = os .path .abspath (os .path .expanduser (location ))
0 commit comments