Commit c239d62c authored by Nathaniel Case's avatar Nathaniel Case

TreeStore -> ListStore

parent 684c93cb
...@@ -86,11 +86,11 @@ class Process(pyrasite.PyrasiteIPC, GObject.GObject): ...@@ -86,11 +86,11 @@ class Process(pyrasite.PyrasiteIPC, GObject.GObject):
return self._title return self._title
class ProcessTreeStore(Gtk.TreeStore): class ProcessListStore(Gtk.ListStore):
"""This TreeStore finds all running python processes.""" """This TreeStore finds all running python processes."""
def __init__(self, *args): def __init__(self, *args):
Gtk.TreeStore.__init__(self, str, Process, Pango.Style) Gtk.ListStore.__init__(self, str, Process, Pango.Style)
for pid in os.listdir('/proc'): for pid in os.listdir('/proc'):
try: try:
pid = int(pid) pid = int(pid)
...@@ -98,8 +98,8 @@ class ProcessTreeStore(Gtk.TreeStore): ...@@ -98,8 +98,8 @@ class ProcessTreeStore(Gtk.TreeStore):
try: try:
maps = open('/proc/%d/maps' % pid).read().strip() maps = open('/proc/%d/maps' % pid).read().strip()
if 'python' in maps: if 'python' in maps:
self.append(None, (proc.title.strip(), proc, self.append((proc.title.strip(), proc,
Pango.Style.NORMAL)) Pango.Style.NORMAL))
except IOError: except IOError:
pass pass
except ValueError: except ValueError:
...@@ -670,7 +670,7 @@ class PyrasiteWindow(Gtk.Window): ...@@ -670,7 +670,7 @@ class PyrasiteWindow(Gtk.Window):
store.set_value(iter, 2, Pango.Style.NORMAL) store.set_value(iter, 2, Pango.Style.NORMAL)
def create_tree(self): def create_tree(self):
tree_store = ProcessTreeStore() tree_store = ProcessListStore()
tree_view = Gtk.TreeView() tree_view = Gtk.TreeView()
self.tree_view = tree_view self.tree_view = tree_view
tree_view.set_model(tree_store) tree_view.set_model(tree_store)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment