Skip to content

Commit 3c1436d

Browse files
committed
Make status.process return the harvested records
And only convert to JSON and pretty print in the main code. That way, downstream code can use status.process as a library.
1 parent 72242d9 commit 3c1436d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

status.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# ------------------------------------------------------------------------
77
# component-status.py
88
# ------------------------------------------------------------------------
9-
# Generates a JSON document with information about the components
9+
# Generates a data structure with information about the components
1010
# and repositories of the SciJava component collection.
1111

1212
import json, re, sys
@@ -78,7 +78,8 @@ def process(patterns=[]):
7878
c = maven.MavenComponent(g, a)
7979
records.append(status(c))
8080

81-
print(json.dumps(records, sort_keys=True, indent=4))
81+
return records
8282

8383
if __name__ == '__main__':
84-
process(sys.argv[1:])
84+
result = process(sys.argv[1:])
85+
print(json.dumps(result, sort_keys=True, indent=4))

0 commit comments

Comments
 (0)