Home | Trees | Index | Help |
---|
Module weekly :: Class SendWeekly |
|
Read all entries of a week from a diary file and send the entries as a mail to a receiver.
Format of an entry:Every entry starts with the date on a single line. This line has a leading "-- " and a european styled date "DD.MM.YYYY". The text of the entry in the next lines can be free formated.Example diary entries:
-- 30.12.2004 Programming - today I finished a small script to make the ldap query -- 31.12.2004 on Call - fix a small cpu load issue
Method Summary | |
---|---|
Initialize the class and set the important values | |
create a full formated SMTP message with the header lines "From:", "To:", "Subject:" and optionally "cc:" and "bcc:" | |
Replace the wildcards in the subject string with current values | |
create the weekly message from the diary entries stored in the dictionary | |
convert a line starting with "-- DD.MM.YYYY" to the ISO-Format YYYYMMDD | |
Process all steps to send a email with the diary entries | |
read the diary file into the internal structures | |
search the first and the last day of the week with the "date" inside | |
search the first entry of this week | |
search the last entry of this week | |
send the preformated smtp message |
Instance Variable Summary | |
---|---|
str |
dayinweek : One day in the week to process |
str |
diaryfile : file with the diary entries |
str |
mailbcopy : BCC address of the mail sended by this script |
str |
mailcopy : CC address of the mail sended by this script |
str |
mailreceiver : Receiver address of the mail sended by this script |
str |
mailsender : Sender address of the mail sended by this script |
str |
mailserver : SMTP server to send this mail |
str |
mailsubject : Subject of the weekly mail |
str |
startingweek : First weekday of a week; valid values are sunday or monday |
Class Variable Summary | |
---|---|
dict |
_SendWeekly__dates = {}
|
str |
_SendWeekly__firstday = ''
|
str |
_SendWeekly__lastday = ''
|
list |
_SendWeekly__message = []
|
SRE_Pattern |
_SendWeekly__re_dateline = ^--
|
int |
_SendWeekly__secondsperday = 86400 |
list |
_SendWeekly__SMTPMessage = []
|
Method Details |
---|
__init__(self,
bcopy='',
copy='',
file='',
sender='',
receiver='',
subject='',
server='',
dayinweek='',
startingweek='')
Initialize the class and set the important values
|
createSMTPMessage(self)create a full formated SMTP message with the header lines "From:", "To:", "Subject:" and optionally "cc:" and "bcc:" |
createSubject(self, subject='')Replace the wildcards in the subject string with current values %B replaced by the date of the first entry %E replaced by the date of the last entry
|
createweekly(self)create the weekly message from the diary entries stored in the dictionary
|
linedate2iso(self, dateline)convert a line starting with "-- DD.MM.YYYY" to the ISO-Format YYYYMMDD
|
processAll(self)Process all steps to send a email with the diary entries |
readdiary(self, filename='')read the diary file into the internal structures
|
searchdays(self, date='')search the first and the last day of the week with the "date" inside
|
searchfirstday(self, date)search the first entry of this week
|
searchlastday(self, date)search the last entry of this week
|
sendSMTPMessage(self, server='')send the preformated smtp message
|
Instance Variable Details |
---|
dayinweekOne day in the week to process
|
diaryfilefile with the diary entries
|
mailbcopyBCC address of the mail sended by this script
|
mailcopyCC address of the mail sended by this script
|
mailreceiverReceiver address of the mail sended by this script
|
mailsenderSender address of the mail sended by this script
|
mailserverSMTP server to send this mail
|
mailsubjectSubject of the weekly mail
|
startingweekFirst weekday of a week; valid values are sunday or monday
|
Class Variable Details |
---|
_SendWeekly__dates
|
_SendWeekly__firstday
|
_SendWeekly__lastday
|
_SendWeekly__message
|
_SendWeekly__re_dateline
|
_SendWeekly__secondsperday
|
_SendWeekly__SMTPMessage
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Wed Oct 11 22:31:42 2006 | http://epydoc.sf.net |