Samuel Kay | 9 Jun 2012 21:00
Picon

Re : XSLT test error

Dear all,

I had the same problem as below, with the "Unable to locate filter addsearch.xslt" message and the whole error

I installed Planet-Venus on another computer with nearly the same OS, and tests worked.

After an inquiry, I found that tests where not run in the same order on both computer. If I run test in the
"right" order it works on both computer.

If I only run the test "test_filter_xslt.py" (with the "./runtests.py test_filter_xslt.py" command) I
have the same error on both computer, the one I had first.

Can someone tell me if there is something wrong with my install or if there is a small bug in the tests ?

Samuel Kay

Not working test order :

modules = ['tests.test_filter_xslt', 'tests.test_docs', 'tests.test_subconfig',
'tests.test_idindex', 'tests.test_reconstitute', 'tests.test_filter_genshi',
'tests.test_apply', 'tests.test_rlists', 'tests.test_filter_tmpl', 'tests.test_config_csv',
'tests.test_spider', 'tests.test_splice', 'tests.test_scrub', 'tests.test_foaf',
'tests.test_filters', 'tests.test_filter_django', 'tests.test_sam', 'tests.test_expunge',
'tests.test_opml', 'tests.test_config', 'tests.test_themes']

Working test order :

modules = ['tests.test_subconfig', 'tests.test_docs', 'tests.test_foaf', 'tests.test_spider',
'tests.test_filter_genshi', 'tests.test_rlists', 'tests.test_idindex', 'tests.test_expunge',
'tests.test_config', 'tests.test_filter_xslt', 'tests.test_reconstitute',
(Continue reading)

Andy Grover | 11 Jun 2012 21:55
Picon
Favicon
Gravatar

help with hack to use google translate

Hi, all,

I've been a bit frustrated because http://planet.fedoraproject.org/ has
enough non-English entries to be frustrating. I've hacked together
support for calling Google Translate, which seems to work pretty well!
Code is below. The biggest bug is that it is retranslating existing
entries, which is not only wasteful but since GT is a paid API, costs
real money! I was hoping someone could help me properly insert the
translate hook to work properly with the caching so as to not do this.

Once this is cleaned up and the hacks are removed, might this be
something upstream would merge?

http://fedoraplanet.groveronline.com/ (current dev instance, with
planet.f.o content translated.. it's not perfect, but it's better)

Thanks -- Regards -- Andy

--- __init__.py	2012-06-11 12:34:11.225999994 -0700
+++ __init__.py.new	2012-06-10 23:02:16.424000005 -0700
 <at>  <at>  -889,6 +888,11  <at>  <at> 
                        item.language != self._channel.language) :
                         self.set_as_string(key + "_language",
item.language)
                     value += cache.utf8(item.value)
+                import translate
+                try:
+                    value = translate.translate(value)
+                except Exception:
+                    pass
(Continue reading)


Gmane