def update(self, amount_read, now=None): """Update the status bar. :param amount_read: the amount of data, in bytes, that has been read :param now: the current time in seconds since the epoch. If *now* is not given, the output of :func:`time.time()` will be used. """ BaseMeter.update(self, amount_read, now)
def update( self, amount_read, now=None ): """Update the status bar. :param amount_read: the amount of data, in bytes, that has been read :param now: the current time in seconds since the epoch. If *now* is not given, the output of :func:`time.time()` will be used. """ BaseMeter.update( self, amount_read, now )
def __init__(self, fo=sys.stderr, hide_finished=False): BaseMeter.__init__(self) self.fo = fo self.hide_finished = hide_finished try: width = int(os.environ['COLUMNS']) except (KeyError, ValueError): width = getScreenWidth() #self.unsized_templ = '\r%-60.60s %5sB %s ' self.unsized_templ = '\r%%-%s.%ss %%5sB %%s ' % (width *2/5, width*3/5) #self.sized_templ = '\r%-45.45s %3i%% |%-15.15s| %5sB %8s ' self.bar_length = width/5 self.sized_templ = '\r%%-%s.%ss %%3i%%%% |%%-%s.%ss| %%5sB %%8s ' % (width*4/10, width*4/10, self.bar_length, self.bar_length)
def __init__(self, parseCallback, userCallback): """ Constructor @type parseCallback: object @param parseCallback: repository parser callback @type userCallback: dict @param userCallback: user callback """ # call parent constructor BaseMeter.__init__(self) # set update frequency as 10 Hz self.update_period = 0.1 # set user callback self.__userCallback = userCallback # set parser callback self.__parseCallback = parseCallback
def update( self, amount_read, now=None ): BaseMeter.update( self, amount_read, now )
def __init__(self): BaseMeter.__init__( self ) self.totSize = "" # Total size to download in a formatted string (Kb, MB etc)
def __init__(self): BaseMeter.__init__(self) self.totSize = "" # Total size to download in a formatted string (Kb, MB etc)
def update(self, amount_read, now=None): BaseMeter.update(self, amount_read, now)
def __init__(self): self.logger = logging.getLogger("yum") BaseMeter.__init__(self)
def __init__(self, fo=sys.stdout): BaseMeter.__init__(self) self.fo = fo self.last_text = None
def _do_start(self, *args, **kwargs): BaseMeter._do_start(self, *args, **kwargs) self._do_update(0)
def __init__(self, app, fo=sys.stderr): BaseMeter.__init__(self) self.fo = fo self.app = app self.i = 100