a 7c¬Ùã@sôdZddlZddlZejeZejZiZ iZ iZ iZ e eƒD]ÚZe ¡sJqs zHandle.new_packagetarget)N) rrrr$r+r4r7r5r r;r=r@r r r rr%Çs  ÿ 1 r%c@s eZdZdZdd„Zdd„ZdS)r<a'Librepo result class This class holds information about a downloaded/localised repository. **Attributes:** .. attribute:: rpmmd_repo See: :data:`.LRR_RPMMD_REPO` .. attribute:: yum_repo See: :data:`.LRR_YUM_REPO` .. attribute:: rpmmd_repomd See: :data:`.LRR_RPMMD_REPOMD` .. attribute:: yum_repomd See: :data:`.LRR_YUM_REPOMD` .. attribute:: rpmmd_timestamp See: :data:`.LRR_RPMMD_TIMESTAMP` .. attribute:: yum_timestamp See: :data:`.LRR_YUM_TIMESTAMP` cCstj ||¡S)z„Returns information about a downloaded/localised repository. *option* could be one of: :ref:`result-options-label` )rr<r5r8r r rr5iszResult.getinfocCs*|tvrtd|jj|fƒ‚| t|¡S)Nr.)Ú ATTR_TO_LRRr1r2rr5r6r r rr7ps  ÿzResult.__getattr__N)rrrr$r5r7r r r rr<Isr<cCs t |¡S)a Download metadata. *list* is a list of :class:`~librepo.MetadataTarget` objects. Exception is raised only if a nonrecoverable error related to the function itself is meet (Errors related to individual downloads are reported via corresponding MetadataTarget objects) :param list: List of :class:`~.librepo.MetadataTarget` objects. :returns: *None* )rÚdownload_metadata)r'r r rrBxs rBFcCs t ||¡S)aj Download list of packages. *list* is a list of :class:`~librepo.PackageTarget` objects. If the *failfast* is True, then whole downloading is stopped immediately when any of download fails (and exception is raised). If the failfast is False, then this function returns after all downloads finish (no matter if successfully or unsuccessfully) and exception is raised only if a nonrecoverable error related to the function itself is meet (Errors related to individual downloads are reported via corresponding PackageTarget objects) :param list: List of :class:`~.librepo.PackageTarget` objects. :param failfast: If *True*, stop whole downloading immediately when any of downloads fails. If *False*, ignore failed download(s) and continue with other downloads. :returns: *None* )rÚdownload_packages)r'Zfailfastr r rrC†srCcCst |||¡S)a, Download specified URL and write it content to opened file descriptor. :param url: Target URL :param fd: Opened file descriptor (To get a file descriptor use for example **os.open()**. :param handle: :Class:`~librepo.Handle` object or *None* :returns: *None* )rÚ download_url)r:Úfdrr r rrD›s rDcCs t |¡S)zÊ Get the highest timestamp of the repo's repomd.xml. :param result_object: Used (filled) :Class:`~librepo.Result` :returns: The highest timestamp from repomd (Float) or *0.0* on error. )rÚyum_repomd_get_age)Z result_objectr r rrF§srFcCs t ||¡S)aQ ONLY FOR DEVELOPMENT (DEBUGGING) PURPOSES! (Deprecated, use :func:`~log_set_file` instead) When python debug log handler is used, the librepo is **THREAD-UNSAFE**! If used, it overrides logging set by :func:`~log_set_file` and vice versa. :param log_function: Function that will handle the debug messages. :param user_data: An data you want to be passed to the log_function during call. :returns: *None* Example:: def debug_function(msg, _): print(msg) librepo.set_debug_log_handler(debug_function) )rÚset_debug_log_handler)Z log_functionZ user_datar r rrG°srGcCs t |¡S)aySet a filename of a file where logs are going to be written. Note: Only one file could be set at a time. Note: If the LIBREPO_DEBUG environ variable is set and this function is used then the LIBREPO_DEBUG effect will be suppressed. (All debug output will be redirected to the specified file) :param filename: Filename :returns: Id of the handler )rÚ log_set_file)Úfilenamer r rrHÈs rHcCs t |¡S)z/Remove handler. :param handler_id: id )rÚlog_remove_handler)Z handler_idr r rrJÖsrJ)F)N)N)1r$ÚsysZlibrepo._librepoZlibrepoÚmodulesrZcurrent_modulerZLibrepoExceptionr/r0rAr Údirr3ÚisupperÚgetattrr-ÚsetattrÚendswithÚ startswithrZ RPMMD_FULLZYUM_FULLZ LR_YUM_FULLZRPMMD_REPOMDONLYZYUM_REPOMDONLYZLR_YUM_REPOMDONLYZ RPMMD_BASEXMLZ YUM_BASEXMLZLR_YUM_BASEXMLZ RPMMD_BASEDBZ YUM_BASEDBZ LR_YUM_BASEDBZ RPMMD_HAWKEYZ YUM_HAWKEYZ LR_YUM_HAWKEYrrrr%r<rBrCrDrFrGrHrJr r r rÚslT            )/