|
Packit |
8ea169 |
.. _usage:
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Usage examples
|
|
Packit |
8ea169 |
==============
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Creating new problem
|
|
Packit |
8ea169 |
--------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/daemon_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Creating problem for different executable
|
|
Packit |
8ea169 |
-----------------------------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/selinux_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Adding custom data
|
|
Packit |
8ea169 |
------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/userspace_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Querying problems
|
|
Packit |
8ea169 |
-----------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/list_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Querying all problems
|
|
Packit |
8ea169 |
---------------------
|
|
Packit |
8ea169 |
The ``list`` method used with ``auth=True`` parameter
|
|
Packit |
8ea169 |
will try to authenticate via
|
|
Packit |
8ea169 |
`polkit <http://www.freedesktop.org/wiki/Software/polkit>`_ to
|
|
Packit |
8ea169 |
gain access to all problems on the system.
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
If there is no authentication agent running or authentication
|
|
Packit |
8ea169 |
is unsuccessful, the list of problems which belong to current
|
|
Packit |
8ea169 |
user is returned (same as returned by the ``list`` method).
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/list_all_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Editing existing problems
|
|
Packit |
8ea169 |
-------------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/edit_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Watching for new problems
|
|
Packit |
8ea169 |
-------------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/watch_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Watching for new problems in a thread
|
|
Packit |
8ea169 |
--------------------------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/thread_watch_example.py
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
Getting bug numbers of problems reported to bugzilla
|
|
Packit |
8ea169 |
----------------------------------------------------
|
|
Packit |
8ea169 |
|
|
Packit |
8ea169 |
.. literalinclude:: ../examples/bugzilla_numbers.py
|