def __init__(self): Gtk.Plug.__init__(self, 0L) self.topview = TopView() scroll = Gtk.ScrolledWindow() scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll.add_with_viewport(self.topview) self.add(scroll) self.show_all() self.actualizador = False self.__new_handle(True)
class JAMediaTop(Gtk.Plug): def __init__(self): Gtk.Plug.__init__(self, 0L) self.topview = TopView() scroll = Gtk.ScrolledWindow() scroll.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll.add_with_viewport(self.topview) self.add(scroll) self.show_all() self.actualizador = False self.__new_handle(True) def __new_handle(self, reset): """ Elimina o reinicia el actualizador. """ if self.actualizador: GLib.source_remove(self.actualizador) self.actualizador = False if reset: self.actualizador = GLib.timeout_add(1000, self.__update_topview) def __update_topview(self): pids_procesos = JAMSS.get_pids() lista = [] for pid in pids_procesos: nombre = JAMSS.get_process_name(pid) com = JAMSS.get_process_cmdline(pid) comandos = '' for c in com: comandos += "%s " % c comandos = comandos.strip() #hijos = JAMSS.get_process_threads(pid) lista.append([pid, nombre, comandos]) #JAMSS.get_archivos_abiertos_por_proceso(pid) self.topview.set_tree(lista) return True
class JAMediaTop(Gtk.Plug): def __init__(self): Gtk.Plug.__init__(self, 0L) self.topview = TopView() scroll = Gtk.ScrolledWindow() scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll.add_with_viewport(self.topview) self.add(scroll) self.show_all() self.actualizador = False self.__new_handle(True) def __new_handle(self, reset): """ Elimina o reinicia el actualizador. """ if self.actualizador: GLib.source_remove(self.actualizador) self.actualizador = False if reset: self.actualizador = GLib.timeout_add(1000, self.__update_topview) def __update_topview(self): pids_procesos = JAMSS.get_pids() lista = [] for pid in pids_procesos: nombre = JAMSS.get_process_name(pid) com = JAMSS.get_process_cmdline(pid) comandos = '' for c in com: comandos += "%s " % c comandos = comandos.strip() #hijos = JAMSS.get_process_threads(pid) lista.append([pid, nombre, comandos]) #JAMSS.get_archivos_abiertos_por_proceso(pid) self.topview.set_tree(lista) return True
def __init__(self): gtk.Plug.__init__(self, 0L) self.control = Control() self.topview = TopView() scroll = gtk.ScrolledWindow() scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scroll.add_with_viewport(self.topview) self.add(scroll) self.show_all() _thread = threading.Thread(target=self.control.run) _thread.start()
def __init__(self): Gtk.Plug.__init__(self, 0L) self.topview = TopView() scroll = Gtk.ScrolledWindow() scroll.set_policy( Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scroll.add_with_viewport(self.topview) self.add(scroll) self.show_all() self.actualizador = False self.__new_handle(True)