Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python GWTP mergelocales.py的问题_Python_Gwt_Gwtp - Fatal编程技术网

Python GWTP mergelocales.py的问题

Python GWTP mergelocales.py的问题,python,gwt,gwtp,Python,Gwt,Gwtp,我正在尝试使用mergelocales.py脚本,但无法使其正常工作 在我的ui.xml(我用来测试它的ui.xml)中,我有以下区域设置: <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat' ui:generateKeys="com.google.gwt.i18n.rebin

我正在尝试使用mergelocales.py脚本,但无法使其正常工作

在我的ui.xml(我用来测试它的ui.xml)中,我有以下区域设置:

<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
    ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat'
    ui:generateKeys="com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator"
    ui:generateLocales="en_US, es_ES"
    ui:defaultLocale="es_ES"
    xmlns:g="urn:import:com.google.gwt.user.client.ui">
现在,我正在尝试运行mergelocales.py以获取LocalizableSources*.properties文件,当我尝试运行时:

python2.5~/Downloads/mergelocales.pyextras/myModule src/main/java/com/google/gwt/i18n/client/

我得到以下堆栈跟踪:

Skipping non-default locale in extra directory: com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_en_US.properties
Skipping non-default locale in extra directory: com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_es_ES.properties
Traceback (most recent call last):
  File "/Users/admin/Downloads/mergelocales.py", line 497, in <module>
    main()    
  File "/Users/admin/Downloads/mergelocales.py", line 131, in main
    mergeLocales( args[0], args[1] )
  File "/Users/admin/Downloads/mergelocales.py", line 466, in mergeLocales
    pathname = os.path.join( resourcesDir, defaultLocaleFilename )
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 60, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'
跳过额外目录中的非默认区域设置:com.mycompany.myproject.client.mvp.views.myViewImplMyViewImplUIBinderImpleGenMessages\u en\u US.properties
跳过额外目录中的非默认区域设置:com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages\u es\u es.properties
回溯(最近一次呼叫最后一次):
文件“/Users/admin/Downloads/mergelocales.py”,第497行,在
main()
文件“/Users/admin/Downloads/mergelocales.py”,主目录第131行
合并区域设置(参数[0],参数[1])
文件“/Users/admin/Downloads/mergelocales.py”,第466行,在mergelocales中
路径名=os.path.join(resourcesDir,defaultLocaleFilename)
文件“/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py”,第60行,在join中
如果b.startswith('/'):
AttributeError:“非类型”对象没有属性“StartWith”

要使脚本正常工作,我是否缺少一些东西?

现在,我正在尝试运行mergelocales.py以获取LocalizableResources*.properties文件,并[…]获得以下堆栈跟踪…

您必须创建空白LoalZiabrReSurCE.FraseFixs>强>手动自己,它们将由MyeleloCas脚本填充。请看这里:

比如说,我们希望我们的应用程序也能提供法语版本我们需要创建两个名为LocalizableResource.properties和LocalizableResource_fr.properties的空文件。LocalizableSource.properties将包含默认(英语)文本,而LocalizableSource_fr.properties将包含法语文本。这些文件应该位于src/main/resources/com/google/gwt/i18n/client中


中,您确定有足够新的python版本吗?2.5对我来说似乎相当老了,在2010年被2.7取代,最近被3.0取代。我也尝试过使用Python2.7,结果是一样的
Skipping non-default locale in extra directory: com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_en_US.properties
Skipping non-default locale in extra directory: com.mycompany.myproject.client.mvp.views.MyViewImplMyViewImplUiBinderImplGenMessages_es_ES.properties
Traceback (most recent call last):
  File "/Users/admin/Downloads/mergelocales.py", line 497, in <module>
    main()    
  File "/Users/admin/Downloads/mergelocales.py", line 131, in main
    mergeLocales( args[0], args[1] )
  File "/Users/admin/Downloads/mergelocales.py", line 466, in mergeLocales
    pathname = os.path.join( resourcesDir, defaultLocaleFilename )
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 60, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'