#coding=utf-8

import commands

from PyQt4.QtCore import QThread, SIGNAL


class MyThread(QThread):
    def __init__(self,parent = None):
        super(MyThread,self).__init__(parent)
        
        

                
    def run(self):
        """Create on 2015.7.28  by pbc changed (对top功能做了修改 )"""
        
        statusOutput = commands.getstatusoutput("top -b -n 1")
        output = ""
        if statusOutput[0] == 0:
            output = statusOutput[1]            
            self.emit(SIGNAL("getoutput"), output)
           
    
                
                
        