GNOME Bugzilla – Bug 334629
selectevent doesn't work
Last modified: 2006-07-21 17:50:08 UTC
steps: 1. In Evo DayView 2. Create a event named 'new summary' In python >>> selectevent ('frmEvolution-Calendars','calDayView','new summary') selectevent ( frmEvolution-Calendars , calDayView , new summary ) *** Unable to select calendar event index Traceback (most recent call last):
+ Trace 66951
raise LdtpExecutionError (str (msg))
Created attachment 61347 [details] [review] Proposed patch Patrick: With this patch, can you please try and update this bug ?
Poornima: With latest LDTP can you please check selectevent function with the steps mentioned by Patrick and update this bug ? Unfortunately, I'm unable to reproduce this bug due to my Evolution setup in NLD10.
after apply your patch, selecteventindex work now. >>> selectevent ('frmEvolution-Calendars','calDayView','new summary') selectevent ( frmEvolution-Calendars , calDayView , new summary ) *** Unable to select calendar event based on name Traceback (most recent call last):
+ Trace 66977
>>> selecteventindex('frmEvolution-Calendars','calDayView',1) selecteventindex ( frmEvolution-Calendars , calDayView , 1 ) 1
Start LDTP binary seperately in a console and before that, please run this command 'export LDTP_DEBUG=1' and paste the output of LDTP binary here. In another console, run execute the following steps in python prompt from ldtp import * selectevent ('frmEvolution-Calendars','calDayView','new summary')
Patrick: Looks like all day event 'label / label_by' entry is not listed in accessibility ? Note: Tested with Evolution 2.4.0 in SuSE Linux 10.0 CC: Evolution developers.
Harry: Apologize. With the help of Poornima <pnayak@novell.com> identified that Calendar Event label will be listed in accessibility as 'Calendar Event: Summary is <actual summary>.'. One question here I have is, In localized version how this string will be displayed ? Localized version of 'Calendar Event: Summary is <actual summary>.' ? Patrick: I hope in this case we may need to use the whole string 'Calendar Event: Summary is <actual summary>.' ? or the other way is we can use a pattern matching in the code, something like '*: *<actual summary>.' NOTE: I need to work out some exact regular expression.
In http://cvs.gnome.org/viewcvs/evolution/a11y/calendar/ea-cal-view-event.c?view=markup You can have a look at ea_cal_view_event_get_name(). Yes, it is the localized version of "Calendar Event: Summary is %s." or sth. similar.
Harry: This string is specific to evolution or commonly provided by gnome calendar for all the applications uses gnome-calendar ? Patrick: If its common in gnome-calendar, then we need to add the regular expression based search of string in main LDTP, otherwise we need to have a function in evoutils directory under pyautosuite/evolution. What do you suggest ?
Patrick: In few Indian locale languages, the msgstr string does not contain ': Summary is %s.' and we have only 'Calendar view' equivalent string. So, how do we go about that, when we plan for localized testing ?
It's ok now if 'Calendar Event: Summary is <name>.' work. In localized test, we could use selecteventindex as a workaround but: >>> selectevent ('frmEvolution-*','calDayView','Calendar Event: Summary is test.') selectevent ( frmEvolution-* , calDayView , Calendar Event: Summary is test. ) *** Unable to select calendar event index Traceback (most recent call last):
+ Trace 66995
(In reply to comment #8) > Harry: This string is specific to evolution or commonly provided by gnome > calendar for all the applications uses gnome-calendar ? This is specific to evolution. I never heard gnome-calendar before. What is it?
Patrick: Let me debug the issuer further based on comment #10. Harry: I remember the key word gnome-calendar and after your question I googled ;) and found few links.... http://mail.gnome.org/archives/gnome-list/2001-July/msg00208.html http://mail.gnome.org/archives/calendar-list/1999-September/msg00012.html http://www.collaborium.org/onsite/jos2000/related/guides/gnome/caluse.html http://www.sdconsult.no/linux/gnome/gcal.html and all of them are referring to Evolution Calendar.
Harry: For appointment with subject 'new summary', I get 'Calendar Event: Summary is new summary. ' from Accessible_getName function call. Why three extra spaces at end ? Harry: Also, For meeting with subject 'new meeting', I get 'Calendar Event: Summary is new meeting. It is a meeting.' Here also three spaces in between and also extra some strings 'It is a meeting'. This string is not available for appointment. Will this be added for appointment too ? Patrick: If I use 3 extra spaces at end of this it worked fine ;) Regular expression is not implemented here.
(In reply to comment #13) > Harry: For appointment with subject 'new summary', I get 'Calendar Event: > Summary is new summary. ' from Accessible_getName function call. Why three > extra spaces at end ? > Harry: Also, For meeting with subject 'new meeting', I get 'Calendar Event: > Summary is new meeting. It is a meeting.' Here also three spaces in between > and also extra some strings 'It is a meeting'. This string is not available for > appointment. Will this be added for appointment too ? As I said in comment 7, please take a look at the source code of ea_cal_view_event_get_name (), you will see where the spaces come from.
Patrick: 3 extra spaces we got because of 'name_string = g_strdup_printf ("%s %s %s %s", summary_string, alarm_string, recur_string, meeting_string);' this line in ea_cal_view_event_get_name function (ea-cal-view-event.c). And the space ordering will be different if we have alarms or recurrences.
Yes. nags, it's work but quite hard to use. if there is a event with alarm, recur, or meeting, the name will be very long or with strange space.
Reassigning to Patrick.
Created attachment 69346 [details] [review] I have modified select_event to match the event name only with the summary and ignore the rest of the string. This should select the right event at most times (there is the rare case when the starting of the string alone is given, it will match that too.)