Package conary :: Package conaryclient :: Module callbacks
[hide private]
[frames] | no frames]

Source Code for Module conary.conaryclient.callbacks

  1  # -*- mode: python -*- 
  2  # 
  3  # Copyright (c) 2006-2008 rPath, Inc. 
  4  # 
  5  # This program is distributed under the terms of the Common Public License, 
  6  # version 1.0. A copy of this license should have been distributed with this 
  7  # source file in a file called LICENSE. If it is not present, the license 
  8  # is always available at http://www.rpath.com/permanent/licenses/CPL-1.0. 
  9  # 
 10  # This program is distributed in the hope that it will be useful, but 
 11  # without any warranty; without even the implied warranty of merchantability 
 12  # or fitness for a particular purpose. See the Common Public License for 
 13  # full details. 
 14  # 
 15   
 16   
 17  # Generally useful callbacks for client work... 
 18   
 19  from conary import callbacks 
 20  from conary import changelog 
 21   
22 -class FetchCallback(callbacks.LineOutput, callbacks.FetchCallback):
23 - def fetch(self, got, need):
24 if need == 0: 25 self._message("Downloading source (%dKB at %dKB/sec)..." \ 26 % (got/1024, self.rate/1024)) 27 else: 28 self._message("Downloading source (%dKB (%d%%) of %dKB at %dKB/sec)..." \ 29 % (got/1024, (got*100)/need , need/1024, self.rate/1024))
30
31 - def __init__(self, *args, **kw):
32 callbacks.LineOutput.__init__(self, *args, **kw) 33 callbacks.FetchCallback.__init__(self, *args, **kw)
34
35 -class ChangesetCallback(callbacks.LineOutput, callbacks.ChangesetCallback):
36
37