Rework undocumented listjoin to create UID sequences
This function was badly named and completely undocumented. Rework it to avoid copying the full UID list using an iterator. Make it possible to hand it a list of UIDs as strings rather than implicitely relying on the fact that they are numeric already. Document the code. The behavior off the function itself remained otherwise unchanged. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
8de326b29f
commit
0a25408199
@ -54,7 +54,7 @@ class GmailFolder(IMAPFolder):
|
||||
try:
|
||||
imapobj.select(self.getfullname())
|
||||
result = imapobj.uid('copy',
|
||||
imaputil.listjoin(uidlist),
|
||||
imaputil.uid_sequence(uidlist),
|
||||
self.trash_folder)
|
||||
assert result[0] == 'OK', \
|
||||
"Bad IMAPlib result: %s" % result[0]
|
||||
|
@ -638,7 +638,7 @@ class IMAPFolder(BaseFolder):
|
||||
self.ui.flagstoreadonly(self, uidlist, flags)
|
||||
return
|
||||
r = imapobj.uid('store',
|
||||
imaputil.listjoin(uidlist),
|
||||
imaputil.uid_sequence(uidlist),
|
||||
operation + 'FLAGS',
|
||||
imaputil.flagsmaildir2imap(flags))
|
||||
assert r[0] == 'OK', 'Error with store: ' + '. '.join(r[1])
|
||||
|
Reference in New Issue
Block a user