mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Remove apply()
This commit is contained in:
parent
fe55464f39
commit
d91085598f
56 changed files with 179 additions and 285 deletions
|
|
@ -65,7 +65,7 @@ class ProfileBrowser:
|
|||
|
||||
def displaystats(self):
|
||||
W.SetCursor('watch')
|
||||
apply(self.stats.sort_stats, self.sortkeys)
|
||||
self.stats.sort_stats(*self.sortkeys)
|
||||
saveout = sys.stdout
|
||||
try:
|
||||
s = sys.stdout = StringIO.StringIO()
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ def inspect(foo): # JJS 1/25/99
|
|||
class ConsoleTextWidget(W.EditText):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
apply(W.EditText.__init__, (self,) + args, kwargs)
|
||||
W.EditText.__init__(self, *args, **kwargs)
|
||||
self._inputstart = 0
|
||||
self._buf = ''
|
||||
self.pyinteractive = PyInteractive.PyInteractive()
|
||||
|
|
|
|||
|
|
@ -652,7 +652,7 @@ class Debugger(bdb.Bdb):
|
|||
class SourceViewer(W.PyEditor):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
apply(W.PyEditor.__init__, (self,) + args, kwargs)
|
||||
W.PyEditor.__init__(self, *args, **kwargs)
|
||||
self.bind('<click>', self.clickintercept)
|
||||
|
||||
def clickintercept(self, point, modifiers):
|
||||
|
|
@ -815,7 +815,7 @@ class BreakpointsViewer:
|
|||
class TracingMonitor(W.Widget):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
apply(W.Widget.__init__, (self,) + args, kwargs)
|
||||
W.Widget.__init__(self, *args, **kwargs)
|
||||
self.state = 0
|
||||
|
||||
def toggle(self):
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class Application(FrameWork.Application):
|
|||
window = self._windows[wid]
|
||||
if hasattr(window, attr):
|
||||
handler = getattr(window, attr)
|
||||
apply(handler, args)
|
||||
handler(*args)
|
||||
return 1
|
||||
|
||||
def getfrontwindow(self):
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class Widget:
|
|||
if type(args[0]) == FunctionType or type(args[0]) == MethodType:
|
||||
self._possize = args[0]
|
||||
else:
|
||||
apply(self.resize, args[0])
|
||||
self.resize(*args[0])
|
||||
elif len(args) == 2:
|
||||
self._possize = (0, 0) + args
|
||||
elif len(args) == 4:
|
||||
|
|
@ -175,37 +175,37 @@ class Widget:
|
|||
|
||||
def forall(self, methodname, *args):
|
||||
for w in self._widgets:
|
||||
rv = apply(w.forall, (methodname,) + args)
|
||||
rv = w.forall(methodname, *args)
|
||||
if rv:
|
||||
return rv
|
||||
if self._bindings.has_key("<" + methodname + ">"):
|
||||
callback = self._bindings["<" + methodname + ">"]
|
||||
rv = apply(callback, args)
|
||||
rv = callback(*args)
|
||||
if rv:
|
||||
return rv
|
||||
if hasattr(self, methodname):
|
||||
method = getattr(self, methodname)
|
||||
return apply(method, args)
|
||||
return method(*args)
|
||||
|
||||
def forall_butself(self, methodname, *args):
|
||||
for w in self._widgets:
|
||||
rv = apply(w.forall, (methodname,) + args)
|
||||
rv = w.forall(methodname, *args)
|
||||
if rv:
|
||||
return rv
|
||||
|
||||
def forall_frombottom(self, methodname, *args):
|
||||
if self._bindings.has_key("<" + methodname + ">"):
|
||||
callback = self._bindings["<" + methodname + ">"]
|
||||
rv = apply(callback, args)
|
||||
rv = callback(*args)
|
||||
if rv:
|
||||
return rv
|
||||
if hasattr(self, methodname):
|
||||
method = getattr(self, methodname)
|
||||
rv = apply(method, args)
|
||||
rv = method(*args)
|
||||
if rv:
|
||||
return rv
|
||||
for w in self._widgets:
|
||||
rv = apply(w.forall_frombottom, (methodname,) + args)
|
||||
rv = w.forall_frombottom(methodname, *args)
|
||||
if rv:
|
||||
return rv
|
||||
|
||||
|
|
@ -670,7 +670,7 @@ def CallbackCall(callback, mustfit, *args):
|
|||
maxargs = func.func_code.co_argcount - 1
|
||||
else:
|
||||
if callable(callback):
|
||||
return apply(callback, args)
|
||||
return callback(*args)
|
||||
else:
|
||||
raise TypeError, "uncallable callback object"
|
||||
|
||||
|
|
@ -679,7 +679,7 @@ def CallbackCall(callback, mustfit, *args):
|
|||
else:
|
||||
minargs = maxargs
|
||||
if minargs <= len(args) <= maxargs:
|
||||
return apply(callback, args)
|
||||
return callback(*args)
|
||||
elif not mustfit and minargs == 0:
|
||||
return callback()
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ def copyres(input, output, *args, **kwargs):
|
|||
output = Res.FSpOpenResFile(output, 3)
|
||||
openedout = 1
|
||||
try:
|
||||
apply(buildtools.copyres, (input, output) + args, kwargs)
|
||||
buildtools.copyres(input, output, *args, **kwargs)
|
||||
finally:
|
||||
if openedin:
|
||||
Res.CloseResFile(input)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue