diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 172227751..95e0a2adb 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-09-12 Alex Roitman + * src/plugins/TestcaseGenerator.py (fill_object): Use integer + confidence level. * src/DateHandler/_Date_fr.py (DateParserFR.init_strings): Typo. * src/const.py.in (app_gramps): Revert to using a string. diff --git a/gramps2/src/plugins/TestcaseGenerator.py b/gramps2/src/plugins/TestcaseGenerator.py index 42efed776..21a034b24 100644 --- a/gramps2/src/plugins/TestcaseGenerator.py +++ b/gramps2/src/plugins/TestcaseGenerator.py @@ -1186,7 +1186,7 @@ class TestcaseGenerator(Tool.Tool): if randint(0,1) == 1: (year, d) = self.rand_date( ) o.set_date_object( d) - o.set_confidence_level( self.rand_type(Utils.confidence)) + o.set_confidence_level(choice(Utils.confidence.keys())) if issubclass(o.__class__,RelLib._UrlBase.UrlBase): while randint(0,1) == 1: @@ -1235,13 +1235,7 @@ class TestcaseGenerator(Tool.Tool): return (year, event_ref) def rand_type( self, list): - if type(list) == dict: - key = choice(list.keys()) - value = list[key] - if value == _("Custom"): - value = self.rand_text(self.SHORT) - return( (key,value)) - elif issubclass( list.__class__, RelLib.GrampsType): + if issubclass( list.__class__, RelLib.GrampsType): map = list.get_map() key = choice( map.keys()) if key == list.get_custom():