RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð �PNG ��� IHDR���0���0����`n���� cHRM��z&��������������u0���`��:���p��Q<���bKGD�������������tIME� 6���� AIDATX��]pU����{��{�G�n$$@ -�-jВAک��P��1O���j��:cU|hg�}�C�ʋU�:�A A�����|$$$������}�^}8i *�د�?w�9gݵ��:{��F"��&��4� �@��@q_����Ow��9<<|�ԩ�;w���"�#GV�^}Ճ7�|s˖-{��|��G�-[��R�Q�aőTR)� �2!�e�63��X�U������{��Z�m۶�^}�5����}����v�R��J�J,�$� B�$Ф")�i��D�9+䜆B.�qf�үÇoذaժU�i>��so����a^���۷����3�<�ꫯnݺ��"���\���gn0�h��B�i� hR��,W*�e�65��LS�ر�0ēO>���755���ι@O?��ҥK������:::����1��X�9S�%�'�I���$��Sg�ڥ3'zF/� ��Z�8ES6WZ#�.�\��P�R�2����-[�,_�|�`�j�Xl6M���b�Z�* �jҟ0��҉B""� y22r�ܹ�CG�;���{7nn��ma���������2S���� <��x�⡡�|p.Pw��x��y�C�=��O� ��CB}�ӵ����?�wq`8�e����{+Չɱ�\{&�LL������vww��]��?q��Y�������P(���vuu9���S?w���ݻ�v<���mш ��D�DR&�j�X�����y�>���dyg�7��b��s�p��E���BDR� t����������=w�\�[;:[&._�Dlڸv�]��u�驚�/Y�a�����d�%��*)1� �V\G���[F]����X���i����J:z�N�9�?xϭ+X�V|���U�n� �g���hҜ�b�aҢ^��j�f�ZV�K��w.�ؾp�}{� �/e��{O�o�����R�8���i� !jB`�3n;Mw.=7�S�'��F�yW��x�}LXNfz�����b�p�b�bq~�����s�4�H�2��q^�r��n���\aFf4�����n�c��Q�n�X�,����ӑҤd5DDDd9'd��,�l��.���)?��������#}C�k����ܖq����m�a��y��8D���,K)�I�$I�8NE�aH)�|�VCDƘ��DF0D@M�"3�+�����Kcú��+n}��-�k:W�K������3ƄRʌ��m۞��q�9WJ���d�0�,�8��ٶ�⦈B�h���䩡�eDCj&$ �1�Y��\�>{~`�M����ͷt�#?VZ'@D²l"�,+�ɤc0�r��R*��X��n�_kMD�1"""ι�:%X��� $�b:i�b4�X<�/"r�����[Vo��T��0V�i���sΓ$IG���4M�c�R�eq��QS�+5{�{�,��a"��D�2�CҐ(I`CS�s�ʥ�R&�p�����۴(�N���e�sq�Ғ|%�����k�=�0S3@�`�i9�K��Պ�0T�Y��ؼD*��DE��2�gO�bŷrY����z�T��R�҉҆SX�Tϑ����/�Zi�eL��X��jdx䏿�eَ���7��П"?�����0y����<��R�N8�\X9ӥx ��^�L�l�ކ��u����/���Q�B�^p�f��\3��]�INƑ�L�"--�r�!8?���Rp~����v��|�M��$����_M�����GgF�/U�^�^p�Dk�ٲ�vM� ����L$�eGʓ01*���Two��f��#���ޱ��7��!5rdy"D��V���\ט��[y�f���@���Um����2w\�fg_z�y���v|`$_ow402�|���c��Zt��J��Yw���b8+L����R�t߉O�xS���'�L��`/lY�� ���Z;f�nX���f��$�<���Ϩ�J��z"�y��%�qzz��(B��Y�@D�)�uS���<�\.[�����*T(�8v�̗����rrr2I�� N5w����^k=�}�:�S�yӌ��ً+�����NY碧f����0)��h. �R����4�Ա�>�X,:����c�0�0�Rn6���mii�MW*�j��i�I�0�,ˊ���È�8���j�$I�hkk�`||�B!b��l6�8Ncc��U��<���1f�&"FQdYV�B�b���j3�>�!��j>���g���g��RD����8���r�08�u�7��]3������~�,b�P���%tEXtdate:create�2025-02-07T10:02:54+00:00� t����%tEXtdate:modify�2025-02-07T10:02:54+00:00�P�6���(tEXtdate:timestamp�2025-02-07T10:02:54+00:00�E������IEND�B`�
| Server IP : 128.227.220.250 / Your IP : 216.73.216.35 Web Server : Apache/2.4.64 (Unix) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux dumont.ece.ufl.edu 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64 User : daemon ( 2) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib64/python2.7/site-packages/problem/ |
Upload File : |
import os
import inspect
import datetime
from problem import proxies, exception, tools, watch
from _pyabrt import *
JAVA = 'java'
SELINUX = 'selinux'
CCPP = 'CCpp'
PYTHON = 'Python'
KERNELOOPS = 'Kerneloops'
RUNTIME = 'runtime'
XORG = 'xorg'
UNKNOWN = 'libreport'
REQUIRED_FIELDS = ['executable']
PROBLEM_TYPES = {
'JAVA': JAVA,
'SELINUX': SELINUX,
'CCPP': CCPP,
'PYTHON': PYTHON,
'KERNELOOPS': KERNELOOPS,
'RUNTIME': RUNTIME,
'XORG': XORG,
'UNKNOWN': UNKNOWN,
}
class Problem(object):
'''
Base class for the other problem types.
No need to use this class directly, use one
of the specific problem classes.
'''
def __init__(self, typ, reason):
self._data = dict()
self._dirty_data = dict()
self._persisted = False
self._proxy = None
self._probdir = None
self.type = typ
self.analyzer = typ
self.reason = reason
self._proxy = proxies.get_proxy()
def __cast(self, attr, val, reverse=False):
# str with digits -> int
if not reverse and type(val) == str and val.isdigit():
val = int(val)
# by attr name
mapping = {
'time': (datetime.datetime.fromtimestamp,
lambda x: x.strftime('%s'))
}
if attr in mapping:
fun, revfun = mapping[attr]
if reverse:
fun = revfun
val = fun(val)
if reverse:
return str(val)
return val
def __getattr__(self, attr):
exc = AttributeError("object has no attribute '{0}'".format(attr))
val = None
# was deleted before?
if attr in self._dirty_data and self._dirty_data[attr] is None:
raise exc
if attr in self._data:
val = self._data[attr]
# try to fetch the item
if self._persisted:
val = self._proxy.get_item(self._probdir, attr)
self._data[attr] = val
if val is None:
raise exc
val = self.__cast(attr, val)
super(Problem, self).__setattr__(attr, val)
return val
def __setattr__(self, attr, value):
super(Problem, self).__setattr__(attr, value)
if not attr[0] == '_':
self._data[attr] = value
if self._persisted:
self._dirty_data[attr] = value
def __delattr__(self, attr):
# it might not be loaded at first
self.__getattr__(attr)
super(Problem, self).__delattr__(attr)
del self._data[attr]
if self._persisted:
self._dirty_data[attr] = None
def __getitem__(self, attr):
try:
return self.__getattr__(attr)
except AttributeError as e:
raise KeyError(e)
def __setitem__(self, attr, value):
self.__setattr__(attr, value)
def __delitem__(self, attr):
try:
self.__delattr__(attr)
except AttributeError as e:
raise KeyError(e)
def __repr__(self):
return '<problem.{0} ({1})>'.format(self.__class__.__name__, self.reason)
def add_current_process_data(self):
''' Add pid, gid and executable of current
process to this problem object
'''
self.pid = os.getpid()
self.gid = os.getgid()
#self.executable = os.readlink('/proc/{0}/exe'.format(os.getpid()))
# ^ always '/usr/bin/python' so we need:
self.executable = os.path.abspath(inspect.stack()[-1][1])
def add_current_environment(self):
''' Add environment of current process to this problem object '''
self.environ = ''
for key, value in os.environ.iteritems():
self.environ += '{0}={1}\n'.format(key, value)
def items(self):
return self._data.items()
def validate(self):
for field in REQUIRED_FIELDS:
if not hasattr(self, field):
raise exception.ValidationError(
'Missing required field {0}'.format(field))
def save(self):
''' Create this problem or update modified data
Create or update the project if some of its fields
were modified.
Return ``None`` in case of modification, identifier
if new problem was created.
'''
self.validate()
# convert to strings
str_data = dict()
for key, value in self._data.iteritems():
str_data[str(key)] = self.__cast(key, value, reverse=True)
# already persisted?
if self._persisted:
for key, value in self._dirty_data.iteritems():
if value is None:
self._proxy.del_item(self._probdir, key)
else:
self._proxy.set_item(self._probdir, key,
self.__cast(key, value, reverse=True))
self._dirty_data = dict()
else:
# create
ret = self._proxy.create(str_data)
self._persisted = True
self._probdir = str(ret)
return self._probdir
def delete(self):
''' Delete this problem '''
if self._persisted:
self._proxy.delete(self._probdir)
self._persisted = False
self._probdir = None
self._dirty_data = {}
class Java(Problem):
''' Java problem '''
def __init__(self, reason):
super(Java, self).__init__(JAVA, reason)
class Selinux(Problem):
''' Selinux problem '''
def __init__(self, reason):
super(Selinux, self).__init__(SELINUX, reason)
class Ccpp(Problem):
''' C, C++ problem '''
def __init__(self, reason):
super(Ccpp, self).__init__(CCPP, reason)
class Python(Problem):
''' Python problem '''
def __init__(self, reason):
super(Python, self).__init__(PYTHON, reason)
class Kerneloops(Problem):
''' Kerneloops problem '''
def __init__(self, reason):
super(Kerneloops, self).__init__(KERNELOOPS, reason)
class Xorg(Problem):
''' Xorg problem '''
def __init__(self, reason):
super(Xorg, self).__init__(XORG, reason)
class Runtime(Problem):
''' Runtime problem '''
def __init__(self, reason):
super(Runtime, self).__init__(RUNTIME, reason)
class Unknown(Problem):
''' Unknown problem '''
def __init__(self, reason):
super(Unknown, self).__init__('libreport', reason)
def list(auth=False, __proxy=proxies.get_proxy()):
''' Return the list of the problems
Use ``auth=True`` if authentication should be attempted.
If authentication via polkit fails, function behaves
as if ``auth=False`` was specified (only users problems are
returned).
'''
fun = __proxy.list
if auth:
fun = __proxy.list_all
return map(lambda x: tools.problemify(x, __proxy), fun())
def get(identifier, auth=False, __proxy=proxies.get_proxy()):
''' Return problem object matching ``identifier``
Return ``None`` in case the problem does not exist.
Use ``auth=True`` if authentication should be attempted.
'''
fun = __proxy.list
if auth:
fun = __proxy.list_all
if identifier not in fun():
return None
return tools.problemify(identifier, __proxy)
def get_problem_watcher(auth=False):
''' Return ``ProblemWatcher`` object which can be used
to attach callbacks called when new problem is created
Use ``auth=True`` if authentication should be attempted for
new problem that doesn't belong to current user. If not
set such a problem is ignored.
'''
return watch.ProblemWatcher(auth)