Exemplo n.º 1
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

import argparse
import psutil
from datetime import datetime
import time

from wowapi.wow import WorldOfWarcraft
from wowapi.wow import ChatType
from wowapi.wow import ChannelName


PIDS = WorldOfWarcraft.getAllPIDs()

def getDescription():
    description = "World of Warcraft Chat Log:\n\n"
    if len(PIDS) > 0:
        key = 0
        now = datetime.now()
        for pid in PIDS:
            p = psutil.Process(pid)
            created = datetime.fromtimestamp(p.create_time)
            ageInMinutes = (now-created).seconds % 60
            description += ("%d (PID:%d) - Age: %d Minutes\n" % (key, pid,ageInMinutes))
            key = key + 1
    else:
        description += "NO ACTIVE WOW INSTANCES FOUND!"
    return description

def validateID(key):