diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-08-27 15:50:10 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-08-27 15:50:10 +0200 |
commit | 79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5 (patch) | |
tree | 1a1e7ab8a8a4b703f3237d2ed77ed9f60a2d42fd /ayatanasettings/psutil.py | |
parent | 4bfbd579171d9194956376c7153f378ff6eb9d4e (diff) | |
parent | 1398450b47460ae951f69e410311677cb8fc14a7 (diff) | |
download | ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.tar.gz ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.tar.bz2 ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.zip |
Merge branch 'pr/full-rewrite'
Attributes GH PR #25: https://github.com/AyatanaIndicators/ayatana-settings/pull/25
Diffstat (limited to 'ayatanasettings/psutil.py')
-rw-r--r-- | ayatanasettings/psutil.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/ayatanasettings/psutil.py b/ayatanasettings/psutil.py deleted file mode 100644 index acdbe67..0000000 --- a/ayatanasettings/psutil.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import psutil -import os -from .appdata import APPNAME - -def isRunning(): - - for pProc in psutil.process_iter(): - - sName = pProc.name - - if not isinstance(sName, str): - - sName = pProc.name() - - if sName == 'python3' or sName == 'python': - - lCmdLine = pProc.cmdline - - if not isinstance(lCmdLine, list): - - lCmdLine = pProc.cmdline() - - for sCmd in lCmdLine: - - if sCmd.endswith(APPNAME) and pProc.pid != os.getpid(): - - return True - - elif sName.endswith(APPNAME) and pProc.pid != os.getpid(): - - return True - - return False - -def isSystemd(): - - for pProc in psutil.process_iter(): - - sName = pProc.name - - if not isinstance(sName, str): - - sName = pProc.name() - - if sName == 'systemd': - - lCmdLine = pProc.cmdline - - if not isinstance(lCmdLine, list): - - lCmdLine = pProc.cmdline() - - for sCmd in lCmdLine: - - if sCmd == '--user': - - return True - - return False |