[kupfer] screen: Implement is_valid for sessions



commit 46a9e87069afb6ae84684c74fc1c4e824cb6a052
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Apr 12 00:46:45 2011 +0200

    screen: Implement is_valid for sessions
    
    Launchpad-bug: https://bugs.launchpad.net/kupfer/+bug/756449

 kupfer/plugin/screen.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/screen.py b/kupfer/plugin/screen.py
index 2f3502f..a83af26 100644
--- a/kupfer/plugin/screen.py
+++ b/kupfer/plugin/screen.py
@@ -39,6 +39,13 @@ class ScreenSession (Leaf):
 	def get_actions(self):
 		return (AttachScreen(),)
 
+	def is_valid(self):
+		for pid, name, time, status in screen_sessions_infos():
+			if self.object == pid:
+				return True
+		else:
+			return False
+
 	def get_description(self):
 		for pid, name, time, status in screen_sessions_infos():
 			if self.object == pid:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]