mirror of
https://gitlab.com/gnuwget/wget2.git
synced 2026-01-14 02:01:39 +00:00
18 lines
486 B
Python
Executable File
18 lines
486 B
Python
Executable File
#!/usr/bin/env python
|
|
#
|
|
# Small example tree output of CSV file generated by
|
|
# wget2 --stats-site=csv:out.csv --recursive example.com
|
|
|
|
import sys
|
|
import csv
|
|
|
|
def out(reader, parentid = '0', level = 0):
|
|
list = [row for row in reader if row['ParentID'] == parentid]
|
|
for row in list:
|
|
print((level * 4)*' ' + "%s %s" % (row['Status'], row['URL']))
|
|
out(reader, row['ID'], level + 1)
|
|
|
|
if __name__=="__main__":
|
|
reader = [row for row in csv.DictReader(sys.stdin)]
|
|
out(reader)
|