Show
Ignore:
Timestamp:
07/05/07 15:23:03 (17 months ago)
Author:
Tarek Ziad?? <tarek@…>
Message:

finalized v1

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • mailer/sender.py

    r134 r136  
    3434    return res.last_inserted_ids()[0] 
    3535 
    36 def mail_status(mail_id): 
     36def mail_status(mail_id=None): 
    3737    """getting mail status""" 
     38    def _small(mail): 
     39        return {'subject': mail.subject, 'date': mail.date, 
     40                'status': mail.status} 
     41 
     42    if mail_id is None: 
     43        return [_small(mail) for mail in 
     44                mailed_data.select().execute()] 
     45 
    3846    res = mailed_data.select().execute(original_id=mail_id).fetchall() 
    3947    if len(res) == 0: 
    4048        # still in queue 
    41         return 'processing' 
     49        return u'processing' 
    4250    return res[0].status 
    4351 
     52def mail_queue_size(): 
     53    """return the queue size""" 
     54    return len(mail_data.select().execute().fetchall()) 
     55