comparison hgext/progress.py @ 10540:dd9d057465c1 stable

progress: provide an explicit disable method for developers The other three checks for disabling the progress bar have serious side effects for any class that derives from ui.ui()
author Steve Borho <steve@borho.org>
date Tue, 23 Feb 2010 23:10:01 -0600
parents 4bab7c3db4e1
children 08716b8ba9fb
comparison
equal deleted inserted replaced
10539:fc5908d01ed7 10540:dd9d057465c1
168 return orig(*args) 168 return orig(*args)
169 169
170 sharedprog = None 170 sharedprog = None
171 171
172 def uisetup(ui): 172 def uisetup(ui):
173 # Apps that derive a class from ui.ui() can use
174 # setconfig('progress', 'disable', 'True') to disable this extension
175 if ui.configbool('progress', 'disable'):
176 return
173 if ui.interactive() and not ui.debugflag and not ui.quiet: 177 if ui.interactive() and not ui.debugflag and not ui.quiet:
174 # we instantiate one globally shared progress bar to avoid 178 # we instantiate one globally shared progress bar to avoid
175 # competing progress bars when multiple UI objects get created 179 # competing progress bars when multiple UI objects get created
176 global sharedprog 180 global sharedprog
177 if not sharedprog: 181 if not sharedprog: