Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Folder CPAN distribution.

Report information
The Basics
Id: 12920
Status: rejected
Priority: 0/
Queue: Email-Folder

People
Owner: Nobody in particular
Requestors: bdfoy [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Some extensions for Email::Folder::Maildir
I was playing with Email::Folder::Maildir, but wanted to move around in the message queue. I added a lot to the package and here it is. I'd really like to see the same API available to all subclasses of Email::Folder::Reader, where appropriate. BEGIN { package Email::Folder::Maildir; sub count { $_[0]->{_messages} || $_[0]->_what_is_there; scalar @{ $_[0]->{_messages} }; } sub new { shift->SUPER::new( @_ )->init } sub init { $_[0]->_what_is_there; $_[0]->{_cursor} = -1; # next_message starts at 0; $_[0] } sub messages { $_[0]->{_messages} } sub message_total { $#{ $_[0]->messages } + 1 } sub cursor { $_[0]->{_cursor} += $_[1] } sub current_message { $_[0]->get_message( $_[0]->cursor ) } sub previous_message { $_[0]->get_message( $_[0]->cursor( -1 ) ) } sub next_message { $_[0]->get_message( $_[0]->cursor( +1 ) ) } sub message_file { abs( $_[1] ) <= $_[0]->message_total ? $_[0]->{_messages}[ $_[1] ] : () } sub get_message { my $self = shift; my $num = shift; my $file = $self->message_file( $num ); open my($fh), $file or carp "Couldn't open file $file: $!"; my $message = join '', <$fh>; } }
Date: Mon, 23 May 2005 13:28:46 +0100
From: Simon Wistow <simon [...] thegestalt.org>
To: brian_d_foy via RT <bug-Email-Folder [...] rt.cpan.org>
Subject: Re: [cpan #12920] Some extensions for Email::Folder::Maildir
RT-Send-Cc:
On Sat, May 21, 2005 at 09:10:22PM -0400, brian_d_foy via RT said: Show quoted text
> I was playing with Email::Folder::Maildir, but wanted to move around > in the message queue. I added a lot to the package and here it is. I'd > really like to see the same API available to all subclasses of > Email::Folder::Reader, where appropriate.
This discussion moved to the PEP list