diff options
author | Guido van Rossum <guido@python.org> | 2003-02-27 20:14:51 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-02-27 20:14:51 (GMT) |
commit | 68468eba635570400f607e140425a222018e56f9 (patch) | |
tree | 2176c8822392383a88caa0a2209a1d2f3446d45c /Lib/imaplib.py | |
parent | f389c7727362321a91dbaff13b7e1cef6cbaa3d8 (diff) | |
download | cpython-68468eba635570400f607e140425a222018e56f9.zip cpython-68468eba635570400f607e140425a222018e56f9.tar.gz cpython-68468eba635570400f607e140425a222018e56f9.tar.bz2 |
Get rid of many apply() calls.
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r-- | Lib/imaplib.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py index 6a27a67..c3d56a7 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -579,9 +579,9 @@ class IMAP4: """ name = 'SEARCH' if charset: - typ, dat = apply(self._simple_command, (name, 'CHARSET', charset) + criteria) + typ, dat = self._simple_command(name, 'CHARSET', charset, *criteria) else: - typ, dat = apply(self._simple_command, (name,) + criteria) + typ, dat = self._simple_command(name, *criteria) return self._untagged_response(typ, dat, name) @@ -642,7 +642,7 @@ class IMAP4: # raise self.error('unimplemented extension command: %s' % name) if (sort_criteria[0],sort_criteria[-1]) != ('(',')'): sort_criteria = '(%s)' % sort_criteria - typ, dat = apply(self._simple_command, (name, sort_criteria, charset) + search_criteria) + typ, dat = self._simple_command(name, sort_criteria, charset, *search_criteria) return self._untagged_response(typ, dat, name) @@ -692,7 +692,7 @@ class IMAP4: raise self.error('command %s illegal in state %s' % (command, self.state)) name = 'UID' - typ, dat = apply(self._simple_command, (name, command) + args) + typ, dat = self._simple_command(name, command, *args) if command in ('SEARCH', 'SORT'): name = command else: @@ -723,7 +723,7 @@ class IMAP4: # raise self.error('unknown extension command: %s' % name) if not name in Commands: Commands[name] = (self.state,) - return apply(self._simple_command, (name,) + args) + return self._simple_command(name, *args) @@ -995,7 +995,7 @@ class IMAP4: def _simple_command(self, name, *args): - return self._command_complete(name, apply(self._command, (name,) + args)) + return self._command_complete(name, self._command(name, *args)) def _untagged_response(self, typ, dat, name): @@ -1040,7 +1040,7 @@ class IMAP4: i, n = self._cmd_log_idx, self._cmd_log_len while n: try: - apply(self._mesg, self._cmd_log[i]) + self._mesg(*self._cmd_log[i]) except: pass i += 1 @@ -1390,7 +1390,7 @@ if __name__ == '__main__': def run(cmd, args): M._mesg('%s %s' % (cmd, args)) - typ, dat = apply(getattr(M, cmd), args) + typ, dat = getattr(M, cmd)(*args) M._mesg('%s => %s %s' % (cmd, typ, dat)) if typ == 'NO': raise dat[0] return dat |