Worflow: Fixed rules counts

This commit is contained in:
Geoffrey Frogeye 2019-12-13 18:36:08 +01:00
parent ab7ef609dd
commit 269b8278b5
Signed by: geoffrey
GPG key ID: D8A7ECA00A8CD3DD
5 changed files with 53 additions and 16 deletions

View file

@ -22,15 +22,28 @@ if __name__ == '__main__':
parser.add_argument(
'-x', '--explain', action='store_true',
help="TODO")
parser.add_argument(
'-r', '--rules', action='store_true',
help="TODO")
parser.add_argument(
'-c', '--count', action='store_true',
help="TODO")
args = parser.parse_args()
DB = database.Database()
for domain in DB.export(
first_party_only=args.first_party,
end_chain_only=args.end_chain,
explain=args.explain,
):
print(domain, file=args.output)
if args.rules:
if not args.count:
raise NotImplementedError
print(DB.count_rules(first_party_only=args.first_party))
else:
if args.count:
raise NotImplementedError
for domain in DB.export(
first_party_only=args.first_party,
end_chain_only=args.end_chain,
explain=args.explain,
):
print(domain, file=args.output)
DB.close()