[scripts/generate_result] use string names for native exceptions
make use of 8a481a5126
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2025 Mike Fährmann
|
# Copyright 2025-2026 Mike Fährmann
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -14,7 +14,7 @@ import argparse
|
|||||||
import json
|
import json
|
||||||
import util
|
import util
|
||||||
from pyprint import pyprint
|
from pyprint import pyprint
|
||||||
from gallery_dl import extractor, job, config
|
from gallery_dl import extractor, job, config, exception
|
||||||
|
|
||||||
LOG = logging.getLogger("gen-test")
|
LOG = logging.getLogger("gen-test")
|
||||||
|
|
||||||
@@ -122,7 +122,10 @@ def generate_opts(args, urls, meta=(), exc=None, log=None):
|
|||||||
opts["#range"] = args.range
|
opts["#range"] = args.range
|
||||||
|
|
||||||
if exc:
|
if exc:
|
||||||
opts["#exception"] = exc.__class__
|
if isinstance(exc, exception.GalleryDLException):
|
||||||
|
opts["#exception"] = exc.__class__.__name__
|
||||||
|
else:
|
||||||
|
opts["#exception"] = exc.__class__
|
||||||
elif not urls:
|
elif not urls:
|
||||||
opts["#count"] = 0
|
opts["#count"] = 0
|
||||||
elif len(urls) == 1:
|
elif len(urls) == 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user