2011-05-06 60 views
0

我是Play和GWT的新手,並且遵循文檔here。但是,我看到以下錯誤:commands.py:name'play_command'沒有被定義

bash-3.2$ play deps test-gwt 

!! Error whileloading /opt/play-1.2.1/modules/gwt-1.0/commands.py: name 'play_command' is not defined 
~ 
~ Resolving dependencies using /Users/Harit/Documents/personal/projects/test-gwt/conf/dependencies.yml, 
~ 
~ play->gwt 1.0 (from playLocalModules) 
~ 
~ Installing resolved dependencies, 
~ 
~ modules/gwt-1.0 -> /opt/play-1.2.1/modules/gwt-1.0 
~ 
~ Done! 

我看到有一個相應的錯誤here和狀態是fix_commited,但我不知道我該怎麼辦?

回答

1

是不是因爲play-gwt模塊與play 1.2不兼容? 顯然這個模塊是相當陳舊,不是非常活躍,命令語法在版本1.1.x或類似的東西中已經改變。

之前,你寫commands.py這樣的:

... 
if play_command.startswith('gwt:'): 
... 

,現在,它是這樣的:

... 
MODULE = "secure" 

COMMANDS = ["secure:", "secure:ov", "secure:override"] 

HELP = { 
    "secure:": "Show help for the secure module", 
    "secure:override": "Override the CSS, login or layout" 
} 

def execute(**kargs): 
    command = kargs.get("command") 
    app = kargs.get("app") 
    args = kargs.get("args") 
    env = kargs.get("env") 

    if command == 'secure:': 
... 

在我看來,修飾是真的很輕,所以你可以問模塊所有者,如果他願意這樣做,甚至可以自己做;)

還有一個GWT2模塊,它似乎更活躍:http://www.playframework.org/modules/gwt2(顯然沒有新版本罪ce去年十月,但github項目顯示了最近提交的play1.2支持)

+0

至少解決了錯誤:)。謝謝 – daydreamer 2011-05-06 23:26:36

+0

不用客氣;) – mandubian 2011-05-07 07:24:10