为什么qooxdoo生成器抛出错误TypeError:'int'对象不可订阅

时间:2013-01-30 18:45:52

标签: qooxdoo

当我在源代码上运行qooxdoo生成器时,出现错误:

TypeError:'int'对象不可订阅

我的源代码导致了这个问题:

/* ************************************************************************

   Copyright:

   License:

   Authors:

   ************************************************************************ */

/* ************************************************************************

   #asset(first/*)

   ************************************************************************ */

/**
 * This is the main application class of your custom application "first"
 */
qx.Class.define("first.Application", {

    extend : qx.application.Standalone,
    members : {

    main : function() {
        // Call super class
        this.base(arguments);

        // Enable logging in debug variant
        if (qx.core.Environment.get("qx.debug")) {
        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;
        // support additional cross-browser console. Press F7 to toggle visibility
        qx.log.appender.Console;
        }

        var layout = new qx.ui.layout.Grid(9, 5);

        var label_f = new qx.ui.basic.Label("fahrenheit");
        var label_c = new qx.ui.basic.Label("celsius");
        var tf_f = new qx.ui.form.TextField();
        var tf_c = new qx.ui.form.TextField();

        var button_f = new qx.ui.form.Button("F->C");
        var button_c = new qx.ui.form.Button("C->F");

        // Document is the application root
        var doc = this.getRoot();
        doc.setLayout(layout);

        // Add button to document at fixed coordinates
        doc.add(label_f, {row: 0, column: 0});

    }

    }
}
           );

1 个答案:

答案 0 :(得分:2)

这是一个Python例外。你的JavaScript似乎很好,我运行没有问题。你能否做到以下几点:

  • 说明您如何运行生成器(例如./generate.py source)?
  • 在您的生成器调用中添加-s(例如./generate.py -s source - 这会打印一个python堆栈跟踪)并在此处打印输出
  • 运行./generate.py info并在此处打印输出
  • 通过jslint.com =>验证您的config.json是否有效JSON你应该得到:JSON: good.