Skip to content

Commit cad3882

Browse files
committed
Add comments #919
Signed-off-by: Jono Yang <[email protected]>
1 parent 5165e70 commit cad3882

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/scancode/resource.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def __init__(self, location, resource_class=None,
173173
# True if this codebase root is a file or an empty directory.
174174
self.has_single_resource = bool(self.is_file or not os.listdir(location))
175175

176+
# Set up caching, summary, timing, and error info
176177
self._setup_essentials(temp_dir, max_in_memory)
177178

178179
# finally walk the location and populate
@@ -1068,6 +1069,14 @@ def __init__(self, json_scan_location, plugin_attributes, temp_dir=scancode_temp
10681069
self._populate(plugin_attributes)
10691070

10701071
def _populate(self, plugin_attributes):
1072+
"""
1073+
Populate this codebase with Resource objects.
1074+
1075+
Population is done by loading JSON scan results and creating new
1076+
Resources for each result.
1077+
1078+
We assume that the input JSON scan results are in top-down order.
1079+
"""
10711080
# Load scan data
10721081
with open(self.json_scan_location, 'rb') as f:
10731082
scan_data = json.load(f, object_pairs_hook=OrderedDict)

0 commit comments

Comments
 (0)