]> git.parisson.com Git - telecaster-client.git/commitdiff
add eno type interfaces, fix psutil parsing
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 24 Nov 2021 16:41:06 +0000 (17:41 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 24 Nov 2021 16:41:06 +0000 (17:41 +0100)
telecaster/tools/status.py
telecaster/tools/tools.py

index c646c75a90f889c30596bfb498a0d14ecd2f2c86..f82a3a3f72a730c3650d169643fa6d04aef90aa6 100644 (file)
@@ -42,7 +42,8 @@ from django.conf import settings
 class Status(object):
 
     interfaces = ['eth0', 'eth1', 'eth2', 'eth0-eth2', 'eth3', 'eth4',
-                  'wlan0', 'wlan1', 'wlan2', 'wlan3', 'wlan4']
+                  'wlan0', 'wlan1', 'wlan2', 'wlan3', 'wlan4', 'eno0',
+                  'eno1',]
     acpi_states = {0: 'battery', 1: 'battery', 2: 'AC'}
 
     def __init__(self):
@@ -109,8 +110,8 @@ class Status(object):
     def get_ids(self):
         self.jacking = get_pid('jackd', args=False) != None
 
-        self.audio_encoding = get_pid('gst-launch-0.10', args='lamemp3enc') != None
-        self.video_encoding = get_pid('gst-launch-0.10', args='vp8enc') != None
+        self.audio_encoding = get_pid('gst-launch-1.0', args='lamemp3enc') != None
+        self.video_encoding = get_pid('gst-launch-1.0', args='vp8enc') != None
 
         self.audio_monitoring = get_pid('deefuzzer', args=self.mp3_monitoring_conf) != None
         self.video_monitoring = get_pid('deefuzzer', args=self.webm_monitoring_conf) != None
index b096829ec15b5714a8fa5dbf5bfc452645c4da96..487d9ff1289bd7f369267f79394658c1e70d877e 100644 (file)
@@ -106,10 +106,10 @@ def xml2dict(conf_file):
 def get_pid(name, args=None):
     """Get a process pid filtered by arguments and uid"""
     for proc in psutil.process_iter():
-        if proc.cmdline:
-            if name == proc.name:
+        if proc.cmdline():
+            if name == proc.name():
                 if args:
-                    if args in proc.cmdline[1:]:
+                    if args in proc.cmdline()[1:]:
                         return proc.pid
                 else:
                     return proc.pid