Exemple #1
0
    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)
Exemple #2
0
    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 )
Exemple #3
0
    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)
Exemple #4
0
    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
Exemple #5
0
 def update( self, amount_read, now=None ):
     BaseMeter.update( self, amount_read, now )
Exemple #6
0
 def __init__(self):
     BaseMeter.__init__( self )
     self.totSize = ""   # Total size to download in a formatted string (Kb, MB etc)
Exemple #7
0
 def __init__(self):
     BaseMeter.__init__(self)
     self.totSize = ""  # Total size to download in a formatted string (Kb, MB etc)
Exemple #8
0
 def update(self, amount_read, now=None):
     BaseMeter.update(self, amount_read, now)
Exemple #9
0
 def __init__(self):
     self.logger = logging.getLogger("yum")
     BaseMeter.__init__(self)
Exemple #10
0
 def __init__(self, fo=sys.stdout):
     BaseMeter.__init__(self)
     self.fo = fo
     self.last_text = None
Exemple #11
0
 def _do_start(self, *args, **kwargs):
     BaseMeter._do_start(self, *args, **kwargs)
     self._do_update(0)
Exemple #12
0
 def __init__(self, app, fo=sys.stderr):
     BaseMeter.__init__(self)
     self.fo  = fo
     self.app = app
     self.i   = 100
Exemple #13
0
 def __init__(self, app, fo=sys.stderr):
     BaseMeter.__init__(self)
     self.fo = fo
     self.app = app
     self.i = 100