All pastes #368624 Raw Edit

Gokul

public python v1 · immutable
#368624 ·published 2007-02-23 05:40 UTC
rendered paste body
#To insert a Appointment.from createAppointment import *def insertAppointment (summary, location, description, fromDate, fromTime, toDate,\		       toTime, calendar):     try:          time.sleep (2)          setandverify ('dlgAppointment*', 'txtSummary', summary)          time.sleep (2)	  if setandverify ('dlgAppointment*', 'txtLocation', location) == 0:               log ('Set value is Failed', 'cause')               raise LdtpExecutionError (0)	  else:                value = gettextvalue ('dlgAppointment*', 'cboCalendar')		print value		if calendar != value:                    comboselect ('dlgAppointment*', 'cboCalendar', calendar)          if fromDate != '0':               if setandverify ('dlgAppointment*', 'txtDate', fromDate) == 0:               	    log ('Set value is Failed', 'cause')                    raise LdtpExecutionError (0)          if guiexist ('*Warning') == 1:               log ('Error in  date format','cause')               click ('*Warning','btnOK')               raise LdtpExecutionError (0)                    if toDate != '0':               try:                    comboselect ('dlgAppointment*', 'cbofor','until')               except:                    pass               if setandverify ('dlgAppointment*', 'txtDate1', toDate) == 0:                    log ('Set value in Failed', 'cause')                    raise LdtpExecutionError (0)          if guiexist ('*Warning') == 1:               log ('Error in date format','cause')               click ('*Warning','btnOK')               raise LdtpExecutionError (0)          if str(from_time) != '0':               if setandverify ('dlgAppointment*', 'txt5', fromTime) == 0:                    log ('Set value in From time entry is failed', 'cause')                    raise LdtpExecutionError (0)          time.sleep (1)          if guiexist ('*Warning*') == 1:               log ('Error in input time format','cause')               click ('*Warning','btnOK')               raise LdtpExecutionError (0)                    if str(toTime) != '0':               if setandverify ('dlgAppointment*', 'txt7', toTime) == 0:                    log ('Failed to set value in to time entry', 'cause')                    raise LdtpExecutionError (0)          if guiexist ('*Warning*') == 1:               log ('Error in input time format','cause')               click ('*Warning*','btnOK')               raise LdtpExecutionError (0)               	  if setandverify ('dlgAppointment*', 'txtDescription', description) == 0:               log ('Failed to set value in description field', 'cause')               raise LdtpExecutionError (0)          	  time.sleep(3)     except error,msg:          log('Errorin Appointment','error')          raise LdtpExecutionError (0)