예제 #1
0
 def __init__(self, report):
     """
     :param report: A report object to be notified.
     :type report: ProgressReport
     """
     DownloadBaseCallback.__init__(self)
     self.report = report
예제 #2
0
파일: rpmtools.py 프로젝트: ulif/pulp_rpm
 def __init__(self, report):
     """
     :param report: A report object to be notified.
     :type report: ProgressReport
     """
     DownloadBaseCallback.__init__(self)
     self.report = report
예제 #3
0
 def updateProgress(self, name, frac, fread, ftime):
     msg = "Downloading: %s %s(%d%%)" % (
         name,
         fread,
         int(float(frac) * 100)
     )
     self._sink.verbose(msg)
     self._sink.keepAlive(msg)
     DownloadBaseCallback.updateProgress(self, name, frac, fread, ftime)
예제 #4
0
    def __init__(self, observer):
        """
        Sets up instance variables

        Arguments:
            total_pkgs - number of packages to download
        """

        DownloadBaseCallback.__init__(self)

        self.observer = observer
예제 #5
0
    def __init__(self, observer):
        """
        Sets up instance variables

        Arguments:
            total_pkgs - number of packages to download
        """

        DownloadBaseCallback.__init__(self)

        self.observer = observer
예제 #6
0
 def _do_start(self, now=None):
     """
     Notification that a file download has started.
     The event is forwarded to the report object to be consolidated
     with other reported progress information.
     :param now: timestamp.
     :type now: float
     """
     DownloadBaseCallback._do_start(self, now)
     action = 'Downloading'
     package = ' | '.join((self._getName(), self.totSize))
     self.report.set_action(action, package)
예제 #7
0
파일: rpmtools.py 프로젝트: ulif/pulp_rpm
 def _do_start(self, now=None):
     """
     Notification that a file download has started.
     The event is forwarded to the report object to be consolidated
     with other reported progress information.
     :param now: timestamp.
     :type now: float
     """
     DownloadBaseCallback._do_start(self, now)
     action = 'Downloading'
     package = ' | '.join((self._getName(), self.totSize))
     self.report.set_action(action, package)
예제 #8
0
    def __init__(self, total_pkgs):
        """
        Sets up instance variables

        Arguments:
            total_pkgs - number of packages to download
        """

        self.total_pkgs = total_pkgs
        self.downloaded_pkgs = 0
        self.last_pct = 0
        self.last_time = 0
        DownloadBaseCallback.__init__(self)
예제 #9
0
    def __init__(self, callback):
        """
        Constructor

        @type  callback: method
        @param callback: user callback
        """
        # call parent constructor
        DownloadBaseCallback.__init__(self)

        # initialize packages URL dictionary
        self.__packagesUrl = {}

        # set user callback
        self.__userCallback = callback
예제 #10
0
 def __init__(self, total_pkgs):
     self.total_pkgs = total_pkgs
     self.downloaded_pkgs = 0
     self.last_pct = 0
     self.last_time = 0
     DownloadBaseCallback.__init__(self)
예제 #11
0
 def __init__(self, total_pkgs):
     self.total_pkgs = total_pkgs
     self.downloaded_pkgs = 0
     self.last_pct = 0
     self.last_time = 0
     DownloadBaseCallback.__init__(self)
예제 #12
0
 def __init__(self, sink):
     DownloadBaseCallback.__init__(self)
     self._sink = sink