This is a Python 2.x & 3.x client API for the yum-daemon Dbus Service
This module gives a simple pythonic interface to doing Yum package action using the yum-daemon Dbus service.
It use async call to the yum-daemon, so signal can be catched and a Gtk gui dont get unresonsive
There is 2 classes YumDaemonClient & YumDaemonReadOnlyClient
YumDaemonClient uses a system DBus service running as root and can make chages to the system.
YumDaemonReadOnlyClient uses a session DBus service running as current user and can only do readonly actions.
Usage: (Make your own subclass based on yumdaemon.YumDaemonClient and overload the signal handlers):
from yumdaemon import YumDaemonClient
class MyClient(YumDaemonClient):
def __init(self):
YumDaemonClient.__init__(self)
# Do your stuff here
def on_UpdateProgress(self,name,frac,fread,ftime):
# Do your stuff here
pass
def on_TransactionEvent(self,event, data):
# Do your stuff here
pass
def on_RPMProgress(self, package, action, te_current, te_total, ts_current, ts_total):
# Do your stuff here
pass
def on_GPGImport(self, pkg_id, userid, hexkeyid, keyurl, timestamp ):
# do stuff here
pass
Usage: (Make your own subclass based on yumdaemon.YumDaemonReadOnlyClient and overload the signal handlers):
from yumdaemon import YumDaemonReadOnlyClient
class MyClient(YumDaemonReadOnlyClient):
def __init(self):
YumDaemonClient.__init__(self)
# Do your stuff here
def on_UpdateProgress(self,name,frac,fread,ftime):
# Do your stuff here
pass
A class to communicate with the yumdaemon DBus services in a easy way
End the daemon
Get the yum lock, this give exclusive access to the daemon and yum this must always be called before doing other actions
Release the yum lock
Set the Watchdog state
Parameters: | state (boolean (b)) – True = Watchdog active, False = Watchdog disabled |
---|
Get a list of pkg list for a given package filter each pkg list contains [pkg_id, field,....] where field is a atrribute of the package object Ex. summary, size etc.
Parameters: |
|
---|
Read a config setting from yum.conf
Parameters: | setting (string) – setting to read |
---|
set a yum config setting
Parameters: |
|
---|
Get yum package attribute (description, filelist, changelog etc)
Parameters: |
|
---|
Get Updateinfo for a package
Parameters: | pkg_id – pkg_id to get update info from |
---|
Get a list of pkg ids for a given filter (installed, updates ..)
Parameters: | pkg_filter (string) – package filter (‘installed’,’available’,’updates’,’obsoletes’,’recent’,’extras’) |
---|---|
Returns: | list of pkg_id’s |
Return type: | list of strings |
Get a list of pkg ids for starts with name
Parameters: |
|
---|---|
Returns: | list of pkg_is’s |
Get History transaction in a interval of days from today
Parameters: | start_days (integer) – start of interval in days from now (0 = today) |
---|
:param end_days:end of interval in days from now :type end_days: integer :return: a list of (transaction is, date-time) pairs :type sender: json encoded string
Search the history for transaction matching a pattern
Parameters: | pattern (list (strings)) – patterne to match |
---|---|
Returns: | list of (tid,isodates) |
Get packages from a given yum history transaction id
Parameters: | tid (integer) – history transaction id |
---|---|
Returns: | list of (pkg_id, state, installed) pairs |
Return type: | list |
Get list of Groups
Search for packages where keys is matched in fields
Parameters: |
|
---|---|
Returns: | list of pkg_id’s |
Clear the current transaction
Get the current transaction
Returns: | the current transaction |
---|
Add an package to the current transaction
Parameters: |
|
---|
Do a install <pattern string>, same as yum install <pattern string>
Parameters: | pattern (string) – package pattern to install |
---|
Do a install <pattern string>, same as yum remove <pattern string>
Parameters: | pattern (string) – package pattern to remove |
---|
Do a update <pattern string>, same as yum update <pattern string>
Parameters: | pattern (string) – package pattern to update |
---|
Do a install <pattern string>, same as yum remove <pattern string>
Parameters: | pattern (string) – package pattern to downgrade |
---|
Get a list of pkg ids for the current availabe updates
Get a list of pkg ids for the current availabe updates
Get packages in a group
Parameters: |
|
---|
Confirm import of at GPG Key by yum
Parameters: |
|
---|
A class to communicate with the yumdaemon DBus services in a easy way
End the daemon
Get the yum lock, this give exclusive access to the daemon and yum this must always be called before doing other actions
Release the yum lock
Set the Watchdog state
Parameters: | state (boolean (b)) – True = Watchdog active, False = Watchdog disabled |
---|
Get a list of pkg list for a given package filter each pkg list contains [pkg_id, field,....] where field is a atrribute of the package object Ex. summary, size etc.
Parameters: |
|
---|
Read a config setting from yum.conf
Parameters: | setting (string) – setting to read |
---|
Get yum package attribute (description, filelist, changelog etc)
Parameters: |
|
---|
Get Updateinfo for a package
Parameters: | pkg_id – pkg_id to get update info from |
---|
Get a list of pkg ids for a given filter (installed, updates ..)
Parameters: | pkg_filter (string) – package filter (‘installed’,’available’,’updates’,’obsoletes’,’recent’,’extras’) |
---|---|
Returns: | list of pkg_id’s |
Return type: | list of strings |
Get a list of pkg ids for starts with name
Parameters: |
|
---|---|
Returns: | list of pkg_is’s |
Get list of Groups
Get packages in a group
Parameters: |
|
---|
Base Exception from the backend
PolicyKit access was denied.
Ex. User press cancel button in policykit window
Yum is locked by another application
Ex. yum is running in a another session You have not called the Lock method to grep the Lock
Error in the yum transaction.