better progress output

This commit is contained in:
Nick Sweeting 2019-02-06 22:06:21 -08:00
parent 33ba29ea90
commit 56d382235f
5 changed files with 28 additions and 29 deletions

View file

@ -18,6 +18,7 @@ Parsed link schema: {
"""
import re
import sys
import json
import urllib
from collections import OrderedDict
@ -25,7 +26,7 @@ import xml.etree.ElementTree as etree
from datetime import datetime
from config import ANSI
from config import ANSI, SHOW_PROGRESS
from util import (
domain,
base_url,
@ -60,6 +61,8 @@ def parse_links(path):
path.rsplit('/', 1)[-1],
**ANSI,
))
if SHOW_PROGRESS:
sys.stdout.write(' ')
for parser_name, parser_func in get_parsers(file).items():
# otherwise try all parsers until one works
@ -72,8 +75,6 @@ def parse_links(path):
# print('[!] Parser {} failed: {} {}'.format(parser_name, err.__class__.__name__, err))
pass
print()
return links, parser_name