Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyrasite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
pyrasite
Commits
c239d62c
Commit
c239d62c
authored
Mar 13, 2012
by
Nathaniel Case
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TreeStore -> ListStore
parent
684c93cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
pyrasite/tools/gui.py
pyrasite/tools/gui.py
+5
-5
No files found.
pyrasite/tools/gui.py
View file @
c239d62c
...
...
@@ -86,11 +86,11 @@ class Process(pyrasite.PyrasiteIPC, GObject.GObject):
return
self
.
_title
class
Process
TreeStore
(
Gtk
.
Tree
Store
):
class
Process
ListStore
(
Gtk
.
List
Store
):
"""This TreeStore finds all running python processes."""
def
__init__
(
self
,
*
args
):
Gtk
.
Tree
Store
.
__init__
(
self
,
str
,
Process
,
Pango
.
Style
)
Gtk
.
List
Store
.
__init__
(
self
,
str
,
Process
,
Pango
.
Style
)
for
pid
in
os
.
listdir
(
'/proc'
):
try
:
pid
=
int
(
pid
)
...
...
@@ -98,8 +98,8 @@ class ProcessTreeStore(Gtk.TreeStore):
try
:
maps
=
open
(
'/proc/%d/maps'
%
pid
).
read
().
strip
()
if
'python'
in
maps
:
self
.
append
(
None
,
(
proc
.
title
.
strip
(),
proc
,
Pango
.
Style
.
NORMAL
))
self
.
append
((
proc
.
title
.
strip
(),
proc
,
Pango
.
Style
.
NORMAL
))
except
IOError
:
pass
except
ValueError
:
...
...
@@ -670,7 +670,7 @@ class PyrasiteWindow(Gtk.Window):
store
.
set_value
(
iter
,
2
,
Pango
.
Style
.
NORMAL
)
def
create_tree
(
self
):
tree_store
=
Process
Tree
Store
()
tree_store
=
Process
List
Store
()
tree_view
=
Gtk
.
TreeView
()
self
.
tree_view
=
tree_view
tree_view
.
set_model
(
tree_store
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment