Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9697212
D3069.id10975.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3069.id10975.diff
View Options
diff --git a/swh/scanner/model.py b/swh/scanner/model.py
--- a/swh/scanner/model.py
+++ b/swh/scanner/model.py
@@ -58,7 +58,7 @@
def show(self, format) -> None:
"""Show tree in different formats"""
if format == "json":
- print(json.dumps(self.getTree(), indent=4, sort_keys=True))
+ print(json.dumps(self.toDict(), indent=4, sort_keys=True))
elif format == "text":
isatty = sys.stdout.isatty()
@@ -157,27 +157,6 @@
if child_node.otype == DIRECTORY:
yield from child_node.iterate()
- def getTree(self):
- """Walk through the tree to discover content or directory that have
- a persistent identifier. If a persistent identifier is found it saves
- the path with the relative PID.
-
- Returns:
- child_tree: the tree with the content/directory found
-
- """
- child_tree = {}
- for path, child_node in self.children.items():
- rel_path = str(child_node.path.relative_to(self.path))
- if child_node.swhid:
- child_tree[rel_path] = child_node.swhid
- else:
- next_tree = child_node.getTree()
- if next_tree:
- child_tree[rel_path] = next_tree
-
- return child_tree
-
def __getSubDirsInfo(self, root, directories):
"""Fills the directories given in input with the contents information
stored inside the directory child, only if they have contents.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 17, 11:08 PM (6 d, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221728
Attached To
D3069: scanner: json output format
Event Timeline
Log In to Comment