Beispiel #1
0
try:
    m = Match(int(match))
    if m.match_json()['match_status'] == 'forthcoming':
        continue
    if m.result() == '':
        continue
    if m.rain_rule() == 'D/L method':
        duckworth_lewis = 1
    else:
        duckworth_lewis = 0
    try:
        m.team_2()['team_name']
    except KeyError:
        continue
    try:
        m.team_1()['team_name']
    except KeyError:
        continue
    if m.match_json()['international_class_card'] != "":
        match_type_id = m.match_json()['international_class_id']
    else:
        match_type_id = m.match_json()['general_class_id']
    try:
        if len(m.officials()) > 0:
            umpires = [o for o in m.officials() if o['player_type_name'] == 'umpire']
            tv_ump = [o for o in m.officials() if o['player_type_name'] == 'tv umpire']
            match_ref = [o for o in m.officials() if o['player_type_name'] == 'referee']
            if len(umpires) == 2:
                ump_1 = umpires[0]
                ump_2 = umpires[1]
            elif len(umpires) == 0:
Beispiel #2
0
try:
    m = Match(int(match))
    if m.match_json()['match_status'] == 'forthcoming':
        continue
    if m.result() == '':
        continue
    if m.rain_rule() == 'D/L method':
        duckworth_lewis = 1
    else:
        duckworth_lewis = 0
    try:
        m.team_2()['team_name']
    except KeyError:
        continue
    try:
        m.team_1()['team_name']
    except KeyError:
        continue
    if m.match_json()['international_class_card'] != "":
        match_type_id = m.match_json()['international_class_id']
    else:
        match_type_id = m.match_json()['general_class_id']
    try:
        if len(m.officials()) > 0:
            umpires = [
                o for o in m.officials()
                if o['player_type_name'] == 'umpire'
            ]
            tv_ump = [
                o for o in m.officials()
                if o['player_type_name'] == 'tv umpire'