Hi Steve

Looks like I relied on a slight API change (or quirk) when I worked on
that code.

Please check whether the attached patch fixes your problem. It only
patches the file storage/statsdb.py under the toolkit's installation
directory.

I'll check it into the repository if it fixes your problem.

Cheers
Wynand
Hi Friedel,

Thanks for the welcome!

Regarding the version...

/usr/local/lib/python2.5/site-packages/jToolkit/data/dates.py:27: DeprecationWarning: The sre module is deprecated, please import re.
  import sre
PootleServer 1.2.0
jToolkit 0.7.8
Translate Toolkit 1.2.0
Kid 0.9.6
ElementTree 1.2.6
Python 2.5.2 (r252:60911, Oct 16 2008, 08:12:18)
[GCC 3.4.6 [FreeBSD] 20060305] (on freebsd6/posix)


and here is the releveant traceback for the error...

2008-11-12 15:28:40: Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/Pootle/users.py", line 279, in handle
    page = self.getpage(pathwords, session, argdict)
File "/usr/local/lib/python2.5/site-packages/Pootle/pootle.py", line 455, in getpage return translatepage.TranslatePage(project, session, argdict, dirfilter=pofilename) File "/usr/local/lib/python2.5/site-packages/Pootle/translatepage.py", line 77, in __init__
    self.receivetranslations()
File "/usr/local/lib/python2.5/site-packages/Pootle/translatepage.py", line 349, in receivetranslations self.project.updatetranslation(self.pofilename, item, newvalues, self.session) File "/usr/local/lib/python2.5/site-packages/Pootle/projects.py", line 1206, in updatetranslation
    pofile.updateunit(item, newvalues, session.prefs, languageprefs)
File "/usr/local/lib/python2.5/site-packages/Pootle/pootlefile.py", line 541, in updateunit
    self.statistics.reclassifyunit(item)
File "/usr/local/lib/python2.5/site-packages/Pootle/statistics.py", line 47, in reclassifyunit self.statscache.recacheunit(self.basefile.filename, self.basefile.checker, unit) File "/usr/local/lib/python2.5/site-packages/translate/storage/statsdb.py", line 485, in recacheunit
    totals_without_unit = self.file_totals[fileid] - \
File "/usr/local/lib/python2.5/site-packages/translate/storage/statsdb.py", line 176, in __getitem__ return Record(FileTotals.keys, result.fetchone(), self._compute_derived_values)
AttributeError: 'NoneType' object has no attribute 'fetchone'

thanks

steve


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Translate-pootle mailing list
Translate-pootle@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/translate-pootle


commit 37d95e8428c2eb8d2a97551bd4e9b558b1a5f82a
Author: Wynand Winterbach <[EMAIL PROTECTED]>
Date:   Wed Nov 12 16:55:09 2008 +0200

    Older versions of SQLite didn't return any values with execute
    calls. Instead, you have to use the cursor after an execute
    call.
    
    Changed two call sites in statsdb.py to work with older versions.

diff --git a/storage/statsdb.py b/storage/statsdb.py
index 2f9027d..faffc65 100644
--- a/storage/statsdb.py
+++ b/storage/statsdb.py
@@ -190,11 +190,11 @@ class FileTotals(object):
     _compute_derived_values = classmethod(_compute_derived_values)
 
     def __getitem__(self, fileid):
-        result = self.cur.execute("""
+        self.cur.execute("""
             SELECT %(keys)s
             FROM   filetotals
             WHERE  fileid=?;""" % {'keys': self.db_keys()}, (fileid,))
-        return Record(FileTotals.keys, result.fetchone(), self._compute_derived_values)
+        return Record(FileTotals.keys, self.cur.fetchone(), self._compute_derived_values)
 
     def __setitem__(self, fileid, record):
         self.cur.execute("""
@@ -471,12 +471,12 @@ class StatsCache(object):
         return fileid
 
     def get_unit_stats(self, fileid, unitid):
-        values = self.cur.execute("""
+        self.cur.execute("""
             SELECT   state, sourcewords, targetwords
             FROM     units
             WHERE    fileid=? AND unitid=?
         """, (fileid, unitid))
-        result = values.fetchone()
+        result = self.cur.fetchone()
         if result is not None:
             return result
         else:

begin:vcard
fn:Wynand Winterbach
n:Winterbach;Wynand
org:Translate.org.za
adr:Groenkloof;;63A Wenning Street;Pretoria;Gauteng;0181;South Africa
email;internet:[EMAIL PROTECTED]
title:Associate
tel;work:+27 12 460 1095
tel;fax:+27 12 460 1095
tel;cell:+27 84 268 5340
x-mozilla-html:FALSE
url:http://www.translate.org.za
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Translate-pootle mailing list
Translate-pootle@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Reply via email to