Package osaf :: Package mail :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Contains common utility methods shared across the Mail Domain (SMTP, IMAP4, POP3) and message parsing

Classes [hide private]
  Counter
  HTMLCleaner
Functions [hide private]
 
trace(printString) source code
 
getEmptyDate(view)
Returns a DateTime object with today's date and the current Operating System timezone set to 0 ticks.
source code
 
dateIsEmpty(date)
Determines if a datetime is empty (hh:mm:ss == 00:00:00.0).
source code
 
disableTwistedTLS(items, TLSKEY='STARTTLS')
Removes TLS from the Capabilities.
source code
 
alert(message, args=<Locale: en_US>)
Displays a generic alert dialog.
source code
 
alertMailError(message, account, args=<Locale: en_US>)
Displays a mail specific alert dialog with a Edit Account Settings button which takes the user to the Account Dialog.
source code
 
NotifyUIAsync(message, logger=<Locale: en_US>, cl='setStatusMessage', *args, **keys) source code
 
setStatusMessage(message, progressPercentage=-1) source code
 
callMethodInUIThread(method, *args) source code
 
dateTimeToRFC2822Date(dt)
Converts a datetime object to a RFC2822 Date String.
source code
 
createMessageID()
Creates a unique message id.
source code
 
hasValue(value)
This method determines if a String has one or more non-whitespace characters.
source code
 
isString(var) source code
 
dataToBinary(mailMessage, attribute, data, mimeType='application/octet-stream', compression='bz2', indexed=True)
Converts non-string data to a Lob.
source code
 
binaryToData(binary)
Converts a Lob to data.
source code
 
stripHTML(text) source code
Variables [hide private]
  log = logging.getLogger("MailService")
Function Details [hide private]

getEmptyDate(view)

source code 
Returns a DateTime object with today's date and the current Operating System timezone set to 0 ticks.
Returns:
datetime object

dateIsEmpty(date)

source code 
Determines if a datetime is empty (hh:mm:ss == 00:00:00.0).
Parameters:
  • date (datetime) - The date to check if it is empty
Returns:
True if the date is empty, False otherwise

disableTwistedTLS(items, TLSKEY='STARTTLS')

source code 
Removes TLS from the Capabilities. If TLS is in the Capabilities twisted will force a TLS connection event if the user specified a non-encypted protocol exchange.
Parameters:
  • TLSKEY (String) - String key to remove from items list

dateTimeToRFC2822Date(dt)

source code 
Converts a datetime object to a RFC2822 Date String.
Parameters:
  • dt (datetime) - a datetime instance
Returns:
RFC2822 Date String

createMessageID()

source code 
Creates a unique message id.
Returns:
String containing the unique message id

hasValue(value)

source code 
This method determines if a String has one or more non-whitespace characters. This is useful in checking that a Subject or To address field was filled in with a useable value.
Parameters:
  • value (String) - The String value to check against. The value can be None
Returns:
Boolean