Re: [python API] add package download event

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> From: "tim lauridsen" <tim.lauridsen@xxxxxxxxx>
> To: "Yellowdog Updater, Modified" <yum@xxxxxxxxxxxxxxxxx>
> Sent: Friday, September 14, 2012 8:29:00 AM
> Subject: Re:  [python API] add package download event
> 
> 
> 
> 
> 
> On Wed, Sep 12, 2012 at 9:43 PM, Alon Bar-Lev < alonbl@xxxxxxxxxx >
> wrote:
> 
> 
> Hello,
> 
> Currently we have:
> PT_DOWNLOAD - start download
> PT_DOWNLOAD_PKGS - list of packages to download.
> The void until:
> PT_GPGCHECKPT_GPGCHECK
> 
> This void takes a lot of time as packages are downloaded.
> 
> May I suggest adding an event before/after each package is
> downloaded?
> 
> Maybe I missed this exiting functionality, but all I see is raw text
> logs that may provide this information if I parse the data.
> 
> Regards,
> Alon Bar-Lev.
> _______________________________________________
> Yum mailing list
> Yum@xxxxxxxxxxxxxxxxx
> http://lists.baseurl.org/mailman/listinfo/yum
> 
> 
> This event is only for the mayor events, you must make a download
> callback handler for tracking the download of each file being
> download
> 
> 
> You can take a look at the yumex backend code of how to handle it (
> YumexDownloadCallback)
> 
> 
> https://github.com/timlau/yumex/blob/master/src/yumexbackend/yum_server.py
> 
> 
> Tim

Hello Tim

Appreciate your help!

I don't like to use the progress interface and parse the file name for such simple task....

I think that download a file is just like install or verify, it is a major event that starts, stops, and may fail.

My solution is:
---
     def verifyPkg(self, fo, po, raiseError):
         if self._lastpkg != po:
             self._lastpkg = po
             self._output.info("Download/Verify: %s" % get_package_name(po))
         yum.YumBase.verifyPkg(self, fo, po, raiseError)
---

As verifyPkg() is called at least once for every package, so I can show the progress with proper package object.

Thanks,
Alon.
_______________________________________________
Yum mailing list
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux