Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Dwayne Bailey
099ebb676c Forgot to bump build number 2011-05-20 15:38:03 +02:00
Dwayne Bailey
a8f6b830f6 Fix bug #633765 - wrap TinyTM Postgress errors 2011-05-20 15:25:36 +02:00
2 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,29 @@
--- src/trunk/virtaal/virtaal/plugins/tm/models/tinytm.py 2010/09/14 14:49:58 15768
+++ src/trunk/virtaal/virtaal/plugins/tm/models/tinytm.py 2010/09/14 14:59:13 15769
@@ -18,6 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
+import logging
+
from virtaal.common import pan_app
from basetmmodel import BaseTMModel
@@ -69,10 +71,13 @@
# Uncomment this if you don't trust the results
#results = self._db.execute("""SELECT * FROM tinytm_get_fuzzy_matches('en', 'de', 'THE EUROPEAN ECONOMIC COMMUNITY', '', '')""")
cursor = self._db_con.cursor()
- cursor.execute(
- """SELECT * FROM tinytm_get_fuzzy_matches(%s, %s, %s, '', '')""",
- (self.source_lang, self.target_lang, query_str.encode('utf-8'))
- )
+ try:
+ cursor.execute(
+ """SELECT * FROM tinytm_get_fuzzy_matches(%s, %s, %s, '', '')""",
+ (self.source_lang, self.target_lang, query_str.encode('utf-8'))
+ )
+ except psycopg.Error, e:
+ logging.error("[%s] %s" % (e.pgcode, e.pgerror))
for result in cursor.fetchall():
quality, source, target = result[:3]
if not isinstance(target, unicode):

View file

@ -2,7 +2,7 @@
Name: virtaal
Version: 0.6.1
Release: 7%{?dist}
Release: 8%{?dist}
Summary: Localization and translation editor
Group: Development/Tools
@ -15,6 +15,7 @@ Patch0: virtaal-0.5.0-setup_drop_MO_generation.patch
Patch1: virtaal-0.3.0-autocorr_shared_location.patch
Patch2: virtaal-0.6.1-bug611751-libtranslate_error_reporting.patch
Patch3: virtaal-0.6.1-bug675623-pt_spellchecking.patch
Patch4: virtaal-0.6.1-bug633765-wrap_tinytm_postgress_errors.patch
BuildArch: noarch
BuildRequires: python
@ -83,6 +84,7 @@ DTD files, subtitles, and other formats.
%patch1 -p1 -b .autocorr_shared_location
%patch2 -p3 -b .bug611751_libtranslate_error
%patch3 -p1 -b .bug675623_pt_spelling
%patch4 -p3 -b .bug633765-tinytm_postgress_errors
%build
%{__python} setup.py build
@ -169,7 +171,10 @@ rm -rf %{buildroot}
%changelog
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-7
* Fri May 20 2011 Dwayne Bailey <dwayne@translate.org.za> - 0.6.1-8
- Fix bug #633765 - wrap TinyTM Postgress errors
* Mon Feb 07 2011 Dwayne Bailey <dwayne@translate.org.za> - 0.6.1-7
- Fix bug #675623 - pt uses pt_BR instead of pt_PT for spell checking
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-6