def parse_scripts(args):
    scripts = []
    warnings = []
    for p2s in (args.pay_to_script or []):
        try:
            scripts.append(h2b(p2s))
        except Exception:
            warnings.append(('warning: error parsing pay-to-script value %s' % p2s))
    hex_re = re.compile('[0-9a-fA-F]+')
    for f in (args.pay_to_script_file or []):
        count = 0
        for l in f:
            try:
                m = hex_re.search(l)
                if m:
                    p2s = m.group(0)
                    scripts.append(h2b(p2s))
                    count += 1
            except Exception:
                warnings.append(('warning: error parsing pay-to-script file %s' % f.name))
        if (count == 0):
            warnings.append(('warning: no scripts found in %s' % f.name))
    return (scripts, warnings)
def parse_scripts(args):
    scripts = []
    warnings = []
    for p2s in (args.pay_to_script or []):
        try:
            scripts.append(h2b(p2s))
        except Exception:
            warnings.append(('warning: error parsing pay-to-script value %s' % p2s))
    hex_re = re.compile('[0-9a-fA-F]+')
    for f in (args.pay_to_script_file or []):
        count = 0
        for l in f:
            try:
                m = hex_re.search(l)
                if m:
                    p2s = m.group(0)
                    scripts.append(h2b(p2s))
                    count += 1
            except Exception:
                warnings.append(('warning: error parsing pay-to-script file %s' % f.name))
        if (count == 0):
            warnings.append(('warning: no scripts found in %s' % f.name))
    return (scripts, warnings)