[issue20328] mailbox: add method to delete mailbox

2016-09-08 Thread R. David Murray

R. David Murray added the comment:

Given that there's been no clarification of the problem being solved in several 
years, I'm going to reject this.  If someone wants to sort it out and improve 
the patch accordingly we can reopen.

--
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-08-19 Thread Jonathan Dowland

Jonathan Dowland added the comment:

Hi David, whilst writing my patch I've tried to keep an open mind as to users 
of the methods, but I do have my own purpose in the back of my mind, and that's 
an archive mail tool which I would like to delete mail folders if, after 
performing an archive operation, they are empty. However, the archive mail tool 
has no awareness or interest in sub-folders. The user would be surprised, 
however, if it deleted them, should they exist.

There's also the issue of lack of locks for Maildirs. If one wanted to avoid 
recursive deleting, how could one achieve it? consider pseudo code

if len(mbox.list_folders()) = 0:
  # no sub-folders, safe to delete?
  mbox.delete()

There are no guarantees an external process didn't create a sub folder between 
the test and the delete operation.

Finally, if one has a delete() operation that doesn't operate on sub-folders, 
but you want to recursively delete, you can at least assemble such a method. If 
you have a recursively-deleting method, and you *don't* want to delete 
sub-folders, you're stuck.

Having said all that please let me know what you're thinking; I'll happily try 
to cook up a patch to add both recursive and non-recursive delete methods.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-08-19 Thread R. David Murray

R. David Murray added the comment:

Well, if you can delete subfolders, then you aren't deleting the main folder, 
either (unless it is empty?).  So isn't this really a 'delete_messages' method? 
 In which case, how does it differ from the 'clear' method?  Only in that it 
deletes the folder if it is empty?  That doesn't sound like a good API to me.

I find myself really confused as to what your goal is here.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-07-13 Thread R. David Murray

R. David Murray added the comment:

I find it surprising that deleting a mailbox does not delete subfolders.  What 
is the rationale for that?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-07-07 Thread Jonathan Dowland

Jonathan Dowland added the comment:

Hi, sorry for the long silence on this issue. I've had a few things going on. 
Anyway, I didn't want to forget all about this; I've been working on it in two 
phases. Phase 1 adds delete methods; Phase 2 handles non-existent mailboxes.

Please find attached my first cut at phase 1. I am working on further tests as 
well, but they aren't quite ready.

--
keywords: +patch
Added file: 
http://bugs.python.org/file35891/0001-add-delete-methods-to-mailbox-types.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-07-07 Thread Jonathan Dowland

Jonathan Dowland added the comment:

another test

--
Added file: 
http://bugs.python.org/file35893/0003-test-for-deletion-of-sub-folders.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-07-07 Thread Jonathan Dowland

Jonathan Dowland added the comment:

patch adding tests

--
Added file: 
http://bugs.python.org/file35892/0002-add-tests-for-deleting-Maildir-and-singleFileMailbox.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-02-23 Thread Jonathan Dowland

Jonathan Dowland added the comment:

Hi,

On Fri, Jan 31, 2014 at 03:03:09PM +, R. David Murray wrote:
 I think your arguments are good ones.  So, if you want to propose a
 patch that defines some semantics for delete (and possibly address the
 maildir folder delete similarly), I will review it.  Also fine if you
 want to discuss it more before working on a patch.  (Also OK if you
 *don't* want to work on a patch, although in that case it is a lot
 less likely to happen :)

Thanks - I intend to write a patch (my first for Python proper), it will
take me quite a long time (simply due to lack of free time) but when I
have any interesting WIP to share I'll update this bug.

Thanks again

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20328] mailbox: add method to delete mailbox

2014-01-31 Thread R. David Murray

R. David Murray added the comment:

I think your arguments are good ones.  So, if you want to propose a patch that 
defines some semantics for delete (and possibly address the maildir folder 
delete similarly), I will review it.  Also fine if you want to discuss it more 
before working on a patch.  (Also OK if you *don't* want to work on a patch, 
although in that case it is a lot less likely to happen :)

--
stage:  - needs patch
title: mailbox: - mailbox: add method to delete mailbox

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20328
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com