| Server IP : 172.67.134.114 / Your IP : 104.23.197.122 Web Server : Apache/2.4.37 System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : ricodeal ( 1046) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib64/python3.6/site-packages/gnome_abrt/ |
Upload File : |
## Copyright (C) 2012 ABRT team <[email protected]>
## Copyright (C) 2001-2005 Red Hat, Inc.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
import os
from gnome_abrt import wrappers
class Application:
def __init__(self, executable, name=None, icon=None):
self.executable = executable or "N/A"
if name:
self.name = name
elif executable:
self.name = os.path.basename(executable)
else:
self.name = None
self.icon = icon
def find_application(cmdline, envp, pid, component):
app = None
if envp:
app = wrappers.get_app_for_env(envp.split('\n'), int(pid))
if not app and cmdline:
app = wrappers.get_app_for_cmdline(cmdline)
if not app:
return Application(cmdline.split(" ")[0] if cmdline else None,
name=component)
ret = Application(app.get_executable(),
name=app.get_name(), icon=app.get_icon())
return ret