src/server/server.py
def emit_imdtabler_rating():
    '''Emits IMDTabler rating for current profile frequencies.'''
    try:
        profile_freqs = json.loads(getCurrentProfile().frequencies)
        imd_val = None
        fi_list = list(OrderedDict.fromkeys(profile_freqs['f'][:RACE.num_nodes]))  # remove duplicates
        fs_list = []
        for val in fi_list:  # convert list of integers to list of strings
            if val > 0:      # drop any zero entries
                fs_list.append(str(val))
        if len(fs_list) > 2:
            imd_val = subprocess.check_output(  # invoke jar; get response
                        'java -jar ' + IMDTABLER_JAR_NAME + ' -r ' + ' '.join(fs_list), shell=True).rstrip()
    except Exception:
        imd_val = None
        logger.exception('emit_imdtabler_rating exception')
    emit_payload = {
            'imd_rating': imd_val
        }
    SOCKET_IO.emit('imdtabler_rating', emit_payload)
Emits IMDTabler rating for current profile frequencies.
Emits IMDTabler rating for current profile frequencies.
Emits IMDTabler rating for current profile frequencies .
def emit_imdtabler_rating():
    try:
        profile_freqs = json.loads(getCurrentProfile().frequencies)
        imd_val = None
        fi_list = list(OrderedDict.fromkeys(profile_freqs['f'][:RACE.num_nodes]))  
        fs_list = []
        for val in fi_list:  
            if val > 0:      
                fs_list.append(str(val))
        if len(fs_list) > 2:
            imd_val = subprocess.check_output(  
                        'java -jar ' + IMDTABLER_JAR_NAME + ' -r ' + ' '.join(fs_list), shell=True).rstrip()
    except Exception:
        imd_val = None
        logger.exception('emit_imdtabler_rating exception')
    emit_payload = {
            'imd_rating': imd_val
        }
    SOCKET_IO.emit('imdtabler_rating', emit_payload)
def emit_imdtabler_rating ( ) : try : profile_freqs = json . loads ( getCurrentProfile ( ) . frequencies ) imd_val = None fi_list = list ( OrderedDict . fromkeys ( profile_freqs [ 'f' ] [ : RACE . num_nodes ] ) ) fs_list = [ ] for val in fi_list : if val > 0 : fs_list . append ( str ( val ) ) if len ( fs_list ) > 2 : imd_val = subprocess . check_output ( 'java -jar ' + IMDTABLER_JAR_NAME + ' -r ' + ' ' . join ( fs_list ) , shell = True ) . rstrip ( ) except Exception : imd_val = None logger . exception ( 'emit_imdtabler_rating exception' ) emit_payload = { 'imd_rating' : imd_val } SOCKET_IO . emit ( 'imdtabler_rating' , emit_payload )
Emits IMDTabler rating for current profile frequencies.
Emits IMDTabler rating for current profile frequencies .
'''Emits IMDTabler rating for current profile frequencies.''' # remove duplicates # convert list of integers to list of strings # drop any zero entries # invoke jar; get response