Browse Source

fix subprocess return bug

tags/mservice-0.1
sonakinci41 6 months ago
parent
commit
66f6153d08
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      MService.py

+ 1
- 1
MService.py View File

@@ -80,7 +80,6 @@ class MService(Gtk.Window):
def subprocess_parse(self,get):
get = get.communicate()[0]
get = get.decode("utf-8","strict")
get = get.split("\n")[0]
return get

def enable_service(self,widget,service):
@@ -118,6 +117,7 @@ class MService(Gtk.Window):
def get_service_status(self,service):
get = subprocess.Popen(["service","status",service], stdout = subprocess.PIPE)
get = self.subprocess_parse(get)
get = get.split("\n")[0]
get = get.split(" ")
if "running" in get:
return True


Loading…
Cancel
Save