def analyze_priorities(self, start_date, end_date):
        issues = self.get_issues(self.get_issue_query(start_date, end_date))
        priority_count, priority_story_points, no_priority_stories = self.get_priority_stats(
            issues)

        logger.info('Priority counts')
        logger.info(print_dict(priority_count, '\n'))

        logger.info('Priority story points')
        logger.info(print_dict(priority_story_points, '\n'))

        logger.info('No priorities')
        for issue in no_priority_stories:
            logger.info("\t %s %s", issue, issue.fields.summary)
Пример #2
0
 def print_info(self):
     print("info")
     util.print_dict(self.info_dict)
     print("\ndoor_vel")
     util.print_dict(self.opening_vel_dict)
     print("\ndoor_temp")
     util.print_dict(self.opening_temp_dict)
     print("\nroom temp")
     util.print_dict(self.room_temp_dict)
     print("\nsetting")
     util.print_dict(self.experiment_dict)
     print("\ncoords")
     util.print_dict(self.coordinates_dict)
     print(
         "\n####### ATTENTION! #######\n In the steckler case the x axis is pointing backwards, the y axis is pointing to the left side, the z axis is pointing upward.\n##########################"
     )
Пример #3
0
def eventlines_to_particlesdict(lines, \
        particles_naming_function = particles_pdg_naming):
    """Takes event lines from LHE file and returns dictionary
        of particles {particle_name: particle}.
    """
    particles_list = parse_event(lines)
    particles_dict = particles_list_to_dictionary(particles_list,\
                         particles_naming_function)
    return particles_dict


if __name__ == "__main__":

    try:
        inpath = sys.argv[1]
    except:
        print "Input file path expected!"
        sys.exit(-1)

    lhe = LHELoader(open(inpath))
    for eventlines in lhe.yield_events():
        particles = eventlines_to_particlesdict(eventlines)
        util.print_list(eventlines, "LINES:")
        util.print_dict(particles, "PARTICLES:")
        print "--------------------------------------"
    print "header =", lhe.header
    print "footer =", lhe.footer
    print "events_counter =", lhe.events_counter
    print "len(events) =", len(events)
    print "events = ", events[:2], "...", events[-1]
Пример #4
0
def eventlines_to_particlesdict(lines, \
        particles_naming_function = particles_pdg_naming):
    """Takes event lines from LHE file and returns dictionary
        of particles {particle_name: particle}.
    """
    particles_list = parse_event(lines)    
    particles_dict = particles_list_to_dictionary(particles_list,\
                         particles_naming_function)
    return particles_dict


if __name__=="__main__":

    try: inpath = sys.argv[1]
    except: print "Input file path expected!"; sys.exit(-1)

    lhe = LHELoader(open(inpath))
    for eventlines in lhe.yield_events():
        particles = eventlines_to_particlesdict(eventlines)
        util.print_list(eventlines, "LINES:")
        util.print_dict(particles, "PARTICLES:")
        print "--------------------------------------"
    print "header =", lhe.header
    print "footer =", lhe.footer
    print "events_counter =", lhe.events_counter
    print "len(events) =", len(events)
    print "events = ", events[:2], "...", events[-1]

    
Пример #5
0
def process_command(command):
    command_split = command.replace('\n', '').split(':')

    if command_split[0] == "list_rooms":
        send_packet(ListRoomsPacket(username=username), server_socket)

    elif command_split[0] == "create_room":
        if (len(command_split) != 2):
            print(('*** Invalid command! Do you want to create a new chatroom?'
                   ' Try \"create_room:<room name>\". ***'))
        else:
            send_packet(
                CreateRoomPacket(username=username, roomname=command_split[1]),
                server_socket)

    elif command_split[0] == "join_room":
        if (len(command_split) != 2):
            print(('*** Invalid command! Do you want to join a chatroom?'
                   ' Try \"join_room:<room name>\". ***'))
        else:
            send_packet(
                JoinRoomPacket(username=username, roomname=command_split[1]),
                server_socket)

    elif command_split[0] == "leave_room":
        if (len(command_split) != 2):
            print(('*** Invalid command! Do you want to leave a chatroom?'
                   ' Try \"leave_room:<room name>\". ***'))
        else:
            send_packet(
                LeaveRoomPacket(username=username, roomname=command_split[1]),
                server_socket)

    elif command_split[0] == "list_users":
        if (len(command_split) != 2):
            print((
                '*** Invalid command! Do you want to list users in a chatroom?'
                ' Try \"list_users:<room name>\". ***'))
        else:
            send_packet(
                ListUsersPacket(username=username, roomname=command_split[1]),
                server_socket)

    elif command_split[0] == "send_msg":
        if (len(command_split) != 3):
            print(('*** Invalid command! Do you want to send a message?'
                   ' Try \"send_msg:<room name>:<some message>\". ***'))
        else:
            send_packet(
                SendMessagePacket(username=username,
                                  roomname=command_split[1],
                                  msg=command_split[2]), server_socket)

    elif command_split[0] == "send_pvt_msg":
        if (len(command_split) != 3):
            print((
                '*** Invalid command! Do you want to send a private message?'
                ' Try \"send_pvt_msg:<receiver username>:<some message>\". ***'
            ))
        else:
            send_packet(
                SendPvtMessagePacket(username=username,
                                     receiver=command_split[1],
                                     msg=command_split[2]), server_socket)

    elif command_split[0] == "exit":
        raise ExitIRCApp()

    else:
        print('*** Invalid command! Here\'s a list of available commands: ***')
        print_dict(title="User commands", dict_to_print=CLIENT_COMMANDS)