All pastes #363360 Raw Edit

vam

public python v1 · immutable
·published 2007-02-19 10:16 UTC
rendered paste body
from ldtp import *from ldtputils import *from accntconfig import *import timelaunchapp('evolution')windowName = 'frm*Evolution*'if windowName != '':    selectmenuitem (windowName, 'mnuEdit;mnuPreferences')else:    msg = 'Unable to get Evolution window handle: '    log (msg + windowName, 'error')    raise LdtpExecutionError (msg)                # Wait till the gui appears    waittillguiexist ('dlgEvolutionPreferences')    selecttab ('dlgEvolutionPreferences', 'ptl0', 'Mail Accounts')    click ('dlgEvolutionPreferences', 'btnAdd')# Script execution starts here...#first_time_acct_setup = Falsetry:    try:        log ('IMAP Account setup', 'teststart')        data_object = LdtpDataFileParser (datafilename)        enterIdentifyInfo (datafilename)        _recvType = data_object.gettagvalue ('recvservertype')        if _recvType != []:            comboselect ('frmEvolutionAccountAssistant', 'cboServerType', _recvType [0] )            # if recv_type[0] == 'IMAP'             log ('Executing receiving mail configuration', 'info')            configureReceivingMail (datafilename)            log ('Executing receiving options configuration', 'info')            imapReceivingOptions (datafilename)        _sendType = data_object.gettagvalue ('sendservertype')        if _sendType != []:            comboselect ('frmEvolutionAccountAssistant', 'cboServerType1', _sendType [0] )            if _sendType [0] == 'SMTP':                configureSmtp (datafilename)                setAccountName (datafilename)                applyChanges ( )            else:                    configureSendmail ( )                setAccountName (datafilename)                applyChanges ( )            waittillguinotexist ('dlgEvolutionPreferences')            click ('dlgEvolutionPreferences', 'btnClose')            # waittillguinotexist ('dlgEvolutionPreferences')    except error, msg:        log ('' + str (msg), 'error')        try:            click ('frmEvolutionAccountAssistant', 'btnCancel')            click ('dlgEvolutionPreferences', 'btnClose')            raise LdtpExecutionError (msg)        except error, msg:            log ('' + str (msg), 'error')            raise LdtpExecutionError (msg)except LdtpExecutionError:    click ('dlgEvolutionPreferences', 'btnClose')    #waittillguinotexist ('dlgEvolutionPreferences')    msg = 'IMAP Account setup'	    log (msg, 'fail')    log (msg, 'testend')    raise LdtpExecutionError (msg)msg = 'IMAP Account setup'log (msg, 'pass')log (msg, 'testend')