简体   繁体   English

插件可以在eclipse中快速切换运行配置

[英]Plugin to switch run configuration quickly in eclipse

Is there a plugin which can help to switch run configuration quickly in eclipse? 是否有插件可以帮助在eclipse中快速切换运行配置?

I am trying to learn django with practice a Eclipse with PyDev. 我正在尝试用PyDev练习Eclipse,学习django。 I am follwing this page . 我正在关注这个页面 This page frequently need to supply different parameters to manage.py, for example: 此页面经常需要为manage.py提供不同的参数,例如:

If you're interested, also run the following commands: 如果您有兴趣,还可以运行以下命令:

 python manage.py validate -- Checks for any errors in the 

construction of your models. 建造你的模型。 python manage.py sqlcustom polls -- Outputs any custom SQL statements (such as table modifications or constraints) that are defined for the application. python manage.py sqlcustom polls - 输出为应用程序定义的任何自定义SQL语句(例如表修改或约束)。 python manage.py sqlclear polls -- Outputs the necessary DROP TABLE statements for this app, according to which tables already exist in your database (if any). python manage.py sqlclear polls - 根据数据库中已存在的表(如果有),为此应用程序输出必要的DROP TABLE语句。

To follow the tutorial, I will need to click the triangle next to the run button , then click "Run Configurations..", then select "Arguments" tab. 要按照教程,我需要单击运行按钮旁边的三角形,然后单击“运行配置..”,然后选择“参数”选项卡。 Modify the argument, press "Apply", then press "Run". 修改参数,按“应用”,然后按“运行”。

I don't want to repeat each step to have different parameters. 我不想重复每个步骤以获得不同的参数。 Is there other way to do it quickly? 还有其他方法可以快速完成吗? Maybe a plugin? 也许是一个插件?

I am not sure if this is the right place to ask, if not, please help to move it to proper place. 我不确定这是否是正确的地方,如果没有,请帮助将它移到适当的地方。

Eclipse Runner可以为您完成此操作。

Actually, for Django, the PyDev integration should have what you want builtin... 实际上,对于Django来说,PyDev集成应该有你想要的内置...

The steps on http://pydev.org/manual_adv_django.html should be more complete, but mainly you have to configure your project as Django and then in any PyDev editor you can do http://pydev.org/manual_adv_django.html上的步骤应该更完整,但主要是你必须将项目配置为Django,然后在任何PyDev编辑器中你可以做

Ctrl+2 dj (and then press enter) Ctrl + 2 dj(然后按回车键)

to open a dialog to choose which django command to run. 打开一个对话框,选择要运行的django命令。

Or you may enter the command directly there... ie: 或者您可以直接在那里输入命令...即:

Ctrl+2 dj syncdb (when pressing enter syncdb will be run directly) Ctrl + 2 dj syncdb(按下输入syncdb将直接运行)

-- note that it'll use the manage.py configured in the project to which the editor is related to run the command (so, the opened editor must be an editor from the project). - 请注意,它将使用与编辑器相关的项目中配置的manage.py来运行命令(因此,打开的编辑器必须是项目中的编辑器)。

Another option would be right clicking the project and selecting the option under the 'Django menu'. 另一种选择是右键单击项目并选择“Django菜单”下的选项。

ps: If in some occasion you really had to change the command line all the time, the ${string_prompt} variable could help you -- although other variables in the run configuration could be more suited depending on your use case. ps:如果在某些情况下你真的不得不一直更改命令行,$ {string_prompt}变量可以帮助你 - 尽管运行配置中的其他变量可能更适合你的用例。

ps2: I think you could rename this question to note that what you want is related to running the django manage.py in PyDev (if that's really your use case). ps2:我想你可以重命名这个问题,注意你想要的是在PyDev中运行django manage.py(如果那是你的用例)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM