Ejemplo n.º 1
0
def optional_prepare_template ( req ):

    return # forget it for now

    logging.info ( "dkong does attempt to modify template prior to sending to client..." )

    # fetch tally
    tally = singlescore_handler._read_tally ( req )

    if tally [ 'scoreboard' ][ 0 ][ 'prid' ] != '_default_':
        # theres a real score here
        pridfile = profile.fetch_pridfile_as_dict ( tally [ 'scoreboard' ][ 0 ][ 'prid' ] )

        if not pridfile:
            return

        if not pridfile [ 'shortname' ].isdigit():
            return

        # imprint top initials
        req [ '_bindata' ][ 7 +  8 ] = encode_char ( pridfile [ 'shortname' ][ 0 ] )
        req [ '_bindata' ][ 7 +  9 ] = encode_char ( pridfile [ 'shortname' ][ 1 ] )
        req [ '_bindata' ][ 7 + 10 ] = encode_char ( pridfile [ 'shortname' ][ 2 ] )
Ejemplo n.º 2
0
def _read_tally ( req ):
    return singlescore_handler._read_tally ( req )