From a079e81ea51a3bc59b0a1df397ed07e7affd4798 Mon Sep 17 00:00:00 2001 From: kriss Date: Sat, 15 Mar 2008 22:50:47 +0000 Subject: [PATCH] CLEANUP: Using new function in Processinterface.py to find out if pppd is running. git-svn-id: http://www.neo1973-germany.de/svn@58 46df4e5c-bc4e-4628-a0fc-830ba316316d --- SettingsGUI/trunk/src/settingsgui/GSMPanel.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/SettingsGUI/trunk/src/settingsgui/GSMPanel.py b/SettingsGUI/trunk/src/settingsgui/GSMPanel.py index 07499f0..d6a6ada 100644 --- a/SettingsGUI/trunk/src/settingsgui/GSMPanel.py +++ b/SettingsGUI/trunk/src/settingsgui/GSMPanel.py @@ -104,16 +104,6 @@ class GSMPanel(gtk.VBox): return False - def check_pppd_running(self): - if not os.path.exists("/proc"): - return False - for key in os.listdir("/proc"): - if key.replace("/proc/", ""): - if key.isdigit(): - fd = open(os.path.join("/proc/", key, "cmdline")) - if fd.read().find("pppd") >= 0: - return True - return False ################################################################################ ######### Callbacks from libgsmd-tool subprocess output - as callbacks ######### @@ -329,7 +319,7 @@ class GSMPanel(gtk.VBox): def start_gsmd(self, widget): # restart not working yet - using stop and start - if self.check_pppd_running(): + if process_running("pppd"): mbox = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_YES_NO, "There seems to be a GPRS connection runnung.\nDo you want to close it?") response = mbox.run()