【问题标题】:TurboGears 2.3: debug through EclipseTurboGears 2.3:通过 Eclipse 调试
【发布时间】:2013-09-11 18:09:28
【问题描述】:

在 TurboGears 2.2 中,使用以下代码创建 tg_launch.py​​ 文件将允许在 Eclipse 中使用断点对其进行调试(安装了 PyDev 插件):

if __name__ == '__main__':
    from paste.script.serve import ServeCommand
    ServeCommand("serve").run(["development.ini"])

现在,在 TG 2.3 中,粘贴已被变速箱取代,我似乎无法弄清楚新代码应该是什么。我尝试在齿轮箱.commands.serve 中使用 ServeCommand,但无法正确设置参数...

谁能帮帮我?

【问题讨论】:

    标签: eclipse python-2.7 turbogears2


    【解决方案1】:

    我相信我找到了正确的方法。这是放入“tg_launch.py​​”的代码:

    if __name__ == '__main__':
        from gearbox.main import GearBox
        gearbox = GearBox()
        gearbox.run(["serve", "--config=development.ini"])
    

    如果您想调试您的设置(引导代码),请使用以下命令:

        gearbox.run(["setup-app", "--config=development.ini"])
    

    请参阅http://turbogears.readthedocs.org/en/latest/turbogears/gearbox.html 了解所有可用的命令和选项。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-02
      • 2012-03-09
      • 1970-01-01
      • 2012-06-10
      • 2015-01-18
      • 2018-08-25
      • 2010-09-13
      • 1970-01-01
      相关资源
      最近更新 更多