Changeset 678


Ignore:
Timestamp:
Oct 25, 2007 7:24:00 AM (12 years ago)
Author:
stefan
Message:

allow to store emails in a file instead of sending them (so no need to store smtp-server-password)

Location:
branches/testScripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/NBemail.py

    r662 r678  
    7474
    7575#------------------------------------------------------------------------
    76 # Send email
     76# Send email (or store in a file)
    7777#------------------------------------------------------------------------
    7878def send(toAddrs,subject,message):
     
    8282       % (sender, ", ".join(toAddrs), subject))
    8383  msgWHeader += message
    84  
    85   # Get smpt server password
     84
     85  #store email in a file instead of sending
     86  if len(NBuserConfig.STORE_EMAIL) > 0 and not NBuserConfig.STORE_EMAIL.isspace() :
     87    NBlogMessages.writeMessage( '  store email in file '+NBuserConfig.STORE_EMAIL)
     88    emailfile=open(NBuserConfig.NIGHTLY_BUILD_ROOT_DIR+'/'+NBuserConfig.STORE_EMAIL, 'a')
     89    emailfile.write(msgWHeader)
     90    emailfile.write("\n============ EMAIL END ======================================\n")
     91    emailfile.close()
     92    return
     93
     94  print len(NBuserConfig.STORE_EMAIL)
     95  print NBuserConfig.STORE_EMAIL.isspace()
     96
     97  # Get smtp server password
    8698  if os.path.isfile(NBuserConfig.SMTP_PASSWORD_FILENAME) :
    8799    pwFilePtr = open(NBuserConfig.SMTP_PASSWORD_FILENAME,'r')
  • branches/testScripts/NBuserConfig.py

    r673 r678  
    5858#                 detected are sent to MY_EMAIL_ADDRESS and the
    5959#                 project manager.
     60#  STORE_EMAIL: If set, then e-mails are not send but stored in a file.
     61#               The filename is relative to NIGHTLY_BUILD_ROOT_DIR.
     62#               If set, then no values for the SMTP_ fields need to be given.
    6063#----------------------------------------------------------------------
    6164SMTP_SERVER_NAME = 'xxx.smtp.server.name'
     
    6972SEND_MAIL_TO_PROJECT_MANAGER=0
    7073
    71 
     74STORE_EMAIL = ''
    7275
    7376#----------------------------------------------------------------------
     
    132135MY_EMAIL_ADDR =  userParameters.data['MY_EMAIL_ADDR']
    133136SEND_MAIL_TO_PROJECT_MANAGER = userParameters.data['SEND_MAIL_TO_PROJECT_MANAGER']
     137STORE_EMAIL = userParameters.data['STORE_EMAIL']
    134138SVNPATH_PREFIX = userParameters.data['SVNPATH_PREFIX']
    135139DOWNLOAD_3RD_PARTY = userParameters.data['DOWNLOAD_3RD_PARTY']
  • branches/testScripts/userParametersEmpty.py

    r672 r678  
    1414'MY_EMAIL_ADDR': '',
    1515'SEND_MAIL_TO_PROJECT_MANAGER': 0,
     16'STORE_EMAIL': '',
    1617'SVNPATH_PREFIX': '',
    1718'DOWNLOAD_3RD_PARTY': 1,
Note: See TracChangeset for help on using the changeset viewer.