Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 878458 Details for
Bug 1080351
[api][rfe] public api for callback when executing the rpm transaction
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
test implementation of rpm callback
callback.py (text/x-python), 2.13 KB, created by
Tim Lauridsen
on 2014-03-25 13:03:56 UTC
(
hide
)
Description:
test implementation of rpm callback
Filename:
MIME Type:
Creator:
Tim Lauridsen
Created:
2014-03-25 13:03:56 UTC
Size:
2.13 KB
patch
obsolete
> >import dnf.yum.rpmtrans > >class RPMProgress(dnf.yum.rpmtrans,TransactionDisplay): > """ > Progress object for RPM Transaction > :api > """ > > def __init__(self,base): > super(TransactionDisplay, self).__init__() > self._actions = {self.PKG_CLEANUP : 'cleanup', > self.PKG_DOWNGRADE : 'downgrade', > self.PKG_ERASE : 'remove', > self.PKG_INSTALL : 'install', > self.PKG_OBSOLETE : 'obsolete', > self.PKG_REINSTALL : 'reinstall', > self.PKG_UPGRADE : 'upgrade'} > > def event(self, package, action, te_current, te_total, ts_current, ts_total): > """ > @param package: A yum package object or simple string of a package name > @param action: A constant transaction set state > @param te_current: current number of bytes processed in the transaction > element being processed > @param te_total: total number of bytes in the transaction element being > processed > @param ts_current: number of processes completed in whole transaction > @param ts_total: total number of processes in the transaction. > """ > if package: > if isinstance(package, str): # package can be both str or dnf package object > pkg_name = package > else: > pkg_name = str(package) > if action in self._actions: > to_do = self.actions[action] > else: > to_do = None > frac = float(te_total)/float(te_current) > self.progress(pkg_name, to_do, frac) > > def progress(self, name, to_do, fraction) > """ > progress event of the current rpm transaction :api > > overload this in a child class > > Args: > name: name of the package rpm is processing > to_do: the action rpm is performing (install, upgrade, remove, reinstall, obsolete, downgrade) > fraction: progress fraction from 0 to 1 of the current action > """ > pass >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1080351
: 878458