From e07455b891d3dc5bd6eb386aee2366a1da2dc231 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 5 Dec 2009 03:09:21 +0000 Subject: [PATCH] 3410: holidays.xml is reported to not load from user's plugin directory svn: r13703 --- src/plugins/drawreport/Calendar.py | 7 ++++++- src/plugins/webreport/WebCal.py | 11 +++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugins/drawreport/Calendar.py b/src/plugins/drawreport/Calendar.py index 84d9187e9..ef57e8278 100644 --- a/src/plugins/drawreport/Calendar.py +++ b/src/plugins/drawreport/Calendar.py @@ -413,8 +413,13 @@ class CalendarOptions(MenuReportOptions): country = EnumeratedListOption(_("Country for holidays"), 0) holiday_table = libholiday.HolidayTable() + countries = holiday_table.get_countries() + countries.sort() + if (len(countries) == 0 or + (len(countries) > 0 and countries[0] != '')): + countries.insert(0, '') count = 0 - for c in holiday_table.get_countries(): + for c in countries: country.add_item(count, c) count += 1 country.set_help(_("Select the country to see associated holidays")) diff --git a/src/plugins/webreport/WebCal.py b/src/plugins/webreport/WebCal.py index 615722de8..41f5dde0b 100644 --- a/src/plugins/webreport/WebCal.py +++ b/src/plugins/webreport/WebCal.py @@ -1434,8 +1434,15 @@ class WebCalOptions(MenuReportOptions): country = EnumeratedListOption(_('Country for holidays'), 0 ) holiday_table = libholiday.HolidayTable() - for index, item in enumerate(holiday_table.get_countries()): - country.add_item(index, item) + countries = holiday_table.get_countries() + countries.sort() + if (len(countries) == 0 or + (len(countries) > 0 and countries[0] != '')): + countries.insert(0, '') + count = 0 + for c in countries: + country.add_item(count, c) + count += 1 country.set_help(_("Holidays will be included for the selected " "country")) menu.add_option(category_name, "country", country)