Logo Search packages:      
Sourcecode: kde-guidance version File versions  Download package

def fuser::FUser::refreshProcesslist (   self  ) 

Read lsof output and add the processdescriptors to the listview. 

Definition at line 169 of file fuser.py.

00169                                 :
        """ Read lsof output and add the processdescriptors to the listview. """
        kapp = self.app

        kapp.setOverrideCursor(QCursor(Qt.BusyCursor))
        
        self.processlist.clear()
        rc, output = SimpleCommandRunner().run([self.lsof_bin,'-FpcLn',self.device],True)
        procs = output.split()
        
        self.processes = []
        self.realprocesses = []
        for line in procs:
            type = line[0]
            info = line[1:]
            
            if type is "p":
                pid = info
                parentproc = FileProcess(self.processlist,pid,True)
                self.processes.append(parentproc)
                self.realprocesses.append(parentproc)
                parentproc.setPixmaps(self.pix)
                files = 0
                
            if type == "c":
                pname = info
                parentproc.setName(pname)
                
            if type == "L":
                powner = info
                parentproc.setOwner(powner)
                
            if type == "n":
                pfile = info
                childproc = FileProcess(parentproc,pid)
                self.processes.append(childproc)
                childproc.setPixmaps(self.pix)
                childproc.setFile(pfile)
                childproc.setOwner(powner)
                childproc.setName(pname)
                if files == 0:
                    parentproc.fillColumns()
                files += 1
                childproc.fillColumns()
                
        kapp.restoreOverrideCursor()
        
        # Enable / disable buttons which are (in)appropriate.
        self.killallbutton.setEnabled(len(self.realprocesses)!=0)
        self.killbutton.setEnabled(len(self.realprocesses)!=0)
        self.umountbutton.setEnabled(len(self.realprocesses)==0)
        if self.processlist.selectedItem() == None:
            self.killbutton.setEnabled(False)
        
    def isMounted(self):


Generated by  Doxygen 1.6.0   Back to index