From: <fri...@us...> - 2006-09-26 07:33:26
|
Revision: 3968 http://svn.sourceforge.net/translate/?rev=3968&view=rev Author: friedelwolff Date: 2006-09-26 00:33:06 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Small fixes to improve Pootle's use of terminology matching Modified Paths: -------------- src/branches/wordforge-0-10-branch/translate/search/match.py src/branches/wordforge-0-10-branch/translate/search/terminology.py src/branches/wordforge-0-10-branch/translate/storage/factory.py Modified: src/branches/wordforge-0-10-branch/translate/search/match.py =================================================================== --- src/branches/wordforge-0-10-branch/translate/search/match.py 2006-09-26 07:32:12 UTC (rev 3967) +++ src/branches/wordforge-0-10-branch/translate/search/match.py 2006-09-26 07:33:06 UTC (rev 3968) @@ -81,7 +81,7 @@ self.candidates.units.append(simpleunit) self.candidates.units.sort(sourcelencmp) if not self.candidates.units: - raise Exception("No usable translation memory") + raise ValueError("No usable translation memory") print "TM initialised with %d candidates (%d to %d characters long)" % \ (len(self.candidates.units), len(self.candidates.units[0].source), len(self.candidates.units[-1].source)) Modified: src/branches/wordforge-0-10-branch/translate/search/terminology.py =================================================================== --- src/branches/wordforge-0-10-branch/translate/search/terminology.py 2006-09-26 07:32:12 UTC (rev 3967) +++ src/branches/wordforge-0-10-branch/translate/search/terminology.py 2006-09-26 07:33:06 UTC (rev 3968) @@ -55,7 +55,7 @@ # many false positives. # First remove a possible disambiguating bracket at the end - b = sre.sub("\s*\(.*\)\s*$", "", b) + b = sre.sub("\s+\(.*\)\s*$", "", b) if b in a[:self.MAX_LEN]: return 100 Modified: src/branches/wordforge-0-10-branch/translate/storage/factory.py =================================================================== --- src/branches/wordforge-0-10-branch/translate/storage/factory.py 2006-09-26 07:32:12 UTC (rev 3967) +++ src/branches/wordforge-0-10-branch/translate/storage/factory.py 2006-09-26 07:33:06 UTC (rev 3968) @@ -42,7 +42,7 @@ """returns the filename""" if not isinstance(storefile, basestring): if not hasattr(storefile, "name"): - raise Exception("Factory can only guess filetype from filename") + raise ValueError("Factory can only guess filetype from filename") else: storefilename = storefile.name else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |