def get_dispatch(distro, arg):
"""
Dispatch to the appropriate scraping function for the given distro.
"""
defin = DISTROS[distro]
try:
if isinstance(defin, type(lambda:None)):
return defin(arg)
elif isinstance(defin, type("")):
return get_dispatch(defin, arg)
else:
return get_scrape(distro, defin, arg)
except:
ex_ty, ex_ob, ex_tb = sys.exc_info()
trace('get_dispatch(%r, %r) failed:' % (distro, arg))
if VERBOSE:
import traceback
traceback.print_tb(ex_tb)
trace(' %s: %s' % (ex_ty.__name__, ex_ob))
return parse_semver('0.0.0')
评论列表
文章目录