Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fae50890
Commit
fae50890
authored
Jul 21, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added option to refilemessages() to keep sequences
parent
edc78aa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
Lib/mhlib.py
Lib/mhlib.py
+27
-4
No files found.
Lib/mhlib.py
View file @
fae50890
...
...
@@ -409,9 +409,9 @@ class Folder:
# Refile one or more messages -- may raise os.error.
# 'tofolder' is an open folder object
def
refilemessages
(
self
,
list
,
tofolder
):
def
refilemessages
(
self
,
list
,
tofolder
,
keepsequences
=
0
):
errors
=
[]
refiled
=
[]
refiled
=
{}
for
n
in
list
:
ton
=
tofolder
.
getlast
()
+
1
path
=
self
.
getmessagefilename
(
n
)
...
...
@@ -431,15 +431,38 @@ class Folder:
pass
continue
tofolder
.
setlast
(
ton
)
refiled
.
append
(
n
)
refiled
[
n
]
=
ton
if
refiled
:
self
.
removefromallsequences
(
refiled
)
if
keepsequences
:
tofolder
.
_copysequences
(
self
,
refiled
.
items
())
self
.
removefromallsequences
(
refiled
.
keys
())
if
errors
:
if
len
(
errors
)
==
1
:
raise
os
.
error
,
errors
[
0
]
else
:
raise
os
.
error
,
(
'multiple errors:'
,
errors
)
# Helper for refilemessages() to copy sequences
def
_copysequences
(
self
,
fromfolder
,
refileditems
):
fromsequences
=
fromfolder
.
getsequences
()
tosequences
=
self
.
getsequences
()
changed
=
0
for
name
,
seq
in
fromsequences
.
items
():
try
:
toseq
=
tosequences
[
name
]
new
=
0
except
:
toseq
=
[]
new
=
1
for
fromn
,
ton
in
refileditems
:
if
fromn
in
seq
:
toseq
.
append
(
ton
)
changed
=
1
if
new
and
toseq
:
tosequences
[
name
]
=
toseq
if
changed
:
self
.
putsequences
(
tosequences
)
# Move one message over a specific destination message,
# which may or may not already exist.
def
movemessage
(
self
,
n
,
tofolder
,
ton
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment