mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- added OscTextMeter() class
it's sole purpose is to show the progress immediately because it might take some time until it shows up (depending on the used bufsize)
This commit is contained in:
parent
9187508513
commit
3e4f6fdc9e
@ -10,6 +10,7 @@ from core import *
|
||||
import cmdln
|
||||
import conf
|
||||
import oscerr
|
||||
import urlgrabber.progress
|
||||
|
||||
MAN_HEADER = r""".TH %(ucname)s "1" "%(date)s" "%(name)s %(version)s" "User Commands"
|
||||
.SH NAME
|
||||
@ -37,6 +38,11 @@ You can modify osc commands, or roll you own, via the plugin API:
|
||||
osc was written by several authors. This man page is automatically generated.
|
||||
"""
|
||||
|
||||
class OscTextMeter(urlgrabber.progress.TextMeter):
|
||||
"""show the progress bar immediately"""
|
||||
def _do_start(self, *args, **kwargs):
|
||||
urlgrabber.progress.TextMeter._do_start(self, *args, **kwargs)
|
||||
self._do_update(0)
|
||||
|
||||
class Osc(cmdln.Cmdln):
|
||||
"""Usage: osc [GLOBALOPTS] SUBCOMMAND [OPTS] [ARGS...]
|
||||
@ -135,8 +141,7 @@ class Osc(cmdln.Cmdln):
|
||||
self.options.verbose = conf.config['verbose']
|
||||
self.download_progress = None
|
||||
if conf.config.get('show_download_progress', False):
|
||||
import urlgrabber.progress
|
||||
self.download_progress = urlgrabber.progress.TextMeter()
|
||||
self.download_progress = OscTextMeter()
|
||||
|
||||
|
||||
def get_cmd_help(self, cmdname):
|
||||
|
Loading…
Reference in New Issue
Block a user