|
From: <fri...@us...> - 2009-02-27 12:57:07
|
Revision: 9682
http://zaf.svn.sourceforge.net/zaf/?rev=9682&view=rev
Author: friedelwolff
Date: 2009-02-27 12:56:57 +0000 (Fri, 27 Feb 2009)
Log Message:
-----------
Some error checking to make sure we don't try to add a group with an existing flag
Modified Paths:
--------------
trunk/dict/zu/hunspell/hunspell_format.py
Modified: trunk/dict/zu/hunspell/hunspell_format.py
===================================================================
--- trunk/dict/zu/hunspell/hunspell_format.py 2009-02-27 11:09:03 UTC (rev 9681)
+++ trunk/dict/zu/hunspell/hunspell_format.py 2009-02-27 12:56:57 UTC (rev 9682)
@@ -82,6 +82,9 @@
def add_group(self, group=None, **kwargs):
"""Adds a new group to the file"""
+ same_flag = [egroup for egroup in self.groups if egroup.flag == kwargs["flag"]]
+ if len(same_flag):
+ raise ValueError("There is already a group with the flag '%s'.", kwargs["flag"])
new_group = group or AffixGroup(**kwargs)
self.groups.append(new_group)
return new_group
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|