Bug 768877
Summary: | python client breaks PO file when no translation found | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Zanata | Reporter: | Akira TAGOH <tagoh> | ||||
Component: | Component-PythonClient | Assignee: | James Ni <jni> | ||||
Status: | CLOSED NEXTRELEASE | QA Contact: | Ding-Yi Chen <dchen> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | unspecified | CC: | jni, zanata-bugs | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | zanata python client version: 1.3.4 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2012-04-05 06:33:35 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | 768875 | ||||||
Bug Blocks: | 786670 | ||||||
Attachments: |
|
Description
Akira TAGOH
2011-12-19 09:08:54 UTC
*** Bug 768875 has been marked as a duplicate of this bug. *** Hi, I have make a commit to git-hub for zanata-python-client to fix this issue, if there is no translation, or the locale is not enabled on the server, the client will stop writing. Please check out the latest code for testing. 'map-from' actually works, but the client only display the locale name using on the client side, doesn't output the process of mapping. So do you think we should output more detail info for mapping process? like: Mapping zh_CN to zh-Hans-CN Retrieving zh-Hans-CN translation from server: ..... or Can not find mapping in zanata.xml, using zh_CN directly. Retrieving zh_CN translation from server: ..... Maybe it is more clear for the user? Best Regards Hi, I add a option named --noskeleton to python client. If users doesn't want to generate empty po files when no translation found, they can enable this option. The python client will generate skeletons files for empty po files by default, since some publican users need this feature. Please take reference: Bug 754870 https://bugzilla.redhat.com/show_bug.cgi?id=768877 Also, the python client need to make consist with Maven client. Hi, I add a option named --noskeleton to python client in commit 47bb369bbb https://github.com/zanata/zanata-python-client/commit/47bb369bbbfd0d243050b6b98e98bd3690b9ad0c. If users doesn't want to generate empty po files when no translation found, they can enable this option. By default, the python client will generate skeletons files when no translations found, since some publican users need this feature. Please take reference: "Bug 754870 Maven client should generate skeletons for empty files" https://bugzilla.redhat.com/show_bug.cgi?id=768877 Also, the python client need to make consist with Maven client. Best Regards Version 1.3.4 does contain this function, yet zanata --help pull does not show such option. Please add a description of this --noskeletion function. Another thing I need to mention is when I run following command: zanata --noskeletion --project-type=gettext Following error occurs if zanata.xml does not contain <project-type>gettext</project-type> error: 'NoneType' object has no attribute 'makefile' This does not occurs without --noskeletion, nor does it happen for zanata po pull. Thus this bug is reassigned. Created attachment 565193 [details]
zanata.xml for ibus-chewing
That error: 'NoneType' object has no attribute 'makefile' is actually happen when pull from ibus-chewing, translate.zanata.org. In comment 5 I make 2 error: 1. the command is "zanata --noskeleton --project-type=gettext" 2. "zanata po pull" also trigger this problem Mmm, seems the error: 'NoneType' object has no attribute 'makefile' is caused by python-httplib2. (see http://code.google.com/p/httplib2/issues/detail?id=62) Hi Ding Thanks a lot for your info. I have tried to install version 0.7.2 of python-httplib2, and try with version 1.3.4 of zanata-python-client, found this issue is fixed. There is no need to modify the zanata-python-client. The reason of this issue is "server refused the connection", so if you want to verify this issue, you can just simplify change the URL in zanata.xml to <url>http://localhost:8080/zanata</url> and stop running local instance of zanata, you will see the error message with python-httplib2 < 0.7.1: error: 'NoneType' object has no attribute 'makefile' with 0.7.2. the error message is changed to: error: [Errno 111] Connection refused. If you want to verify this issue on F15, F16, please download 0.7.2 directly from: http://httplib2.googlecode.com/files/httplib2-0.7.2.tar.gz unzip and run 'python setup.py install'. James, The default behaviour, (without --noskeleton), is now consist with maven client. which is good. However, there is no option if user do need skeleton files. I'll verified this for now, but note that you might need to provide such option in future. VERIFIED with 1.3.4-7-gab64 |