Python& OpenERP开发环境设置如何? [英] Python & OpenERP development environment setup howto?

查看:155
本文介绍了Python& OpenERP开发环境设置如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了开放ERP服务器&网络,决定对较厚的gtk。我在eclipse中添加了2个项目,pydev在Ubuntu 11.10上运行,然后启动。我浏览了网络客户端设置我虽然安装已经完成了在某些时候,虽然我已经执行了一个脚本,试图将我的主文件夹中的所有位和文件复制到文件系统中,一些将转到/ ect或usr / local。我不想这样,所以我停止了这个过程。因为那么我虽然我必须以root&我不能跟踪进程,尽管源码是因为它被分散在文件系统中。



当我尝试安装新的模块时出现问题。我无法进入模块列表&甚至压缩它,并尝试通过客户端导入它失败没有错误。



在尝试获取我添加的模块显示我发现这在论坛上你如果您在运行openerp-server时没有指定插件路径,则必须在将模块放入插件后运行setup.py install。



所以看起来像我必须运行:



python setup.py build

sudo python setup.py install



首先我感到困惑,为什么你需要构建我认为这是需要建立的c lib,我在安装依赖关系时做到这一点。



其次,如果您需要运行它来获取一个新的模块,那么 setup.py install 是重要的。如果从文件系统运行,如何跟踪源文件。



我曾经尝试避免将所有内容复制到文件系统中。现在启动脚本在usr / local / bin中,所以我假设我不能运行,在eclipse中使用'debug as'或者看eclipse控制台中的日志。我也在文档中找到,建议启动服务器:



./ openerp-server.py -addons-path =〜/ home / workspace / stable / addons



这显然覆盖了安装创建的文件系统中的插件,这表明你只需要在Eclipse中的插件中的模块可以调试等等,但其他资源将在别处?



我想没关系,但我仍然无法想象这将如何工作,我想如果这是完成的方式,那么如何达到标准去eclipse控制台?



我想我可以在eclipse中有完整的项目,除了插件之外的所有资源仅供参考,而只有插件实际上将运行,因为它们是被-addons-path参数所覆盖。



然后,如果我可以得到输出去控制台,这将是我期望的。



我已经看到在eclipse工作区中使用链接或者像eclipse php设置一样以root身份运行eclipse的一些补丁。



任何人都可以告诉我如何启动服务器和Web eclipse的应用程序和日志输出出现在控制台中?



也许有经验的python开发人员可以发现我的盲点和建议我可能会在这里丢失什么?

解决方案

我感到你的痛苦。几年前,当我开始与OpenERP合作时,我经历了同样的过程。好消息是,这不是太难设置,OpenERP在Eclipse中与PyDev平滑运行。



首先查看 OpenERP的开发者书籍。他们规定了运行的大部分要求。



要尝试回答您的具体问题,您不需要运行设置.py 脚本在您的开发环境中。只有部署到服务器时才需要。要让服务器识别新模块,请转到管理菜单,然后选择模块管理:更新模块列表。我还在运行OpenERP 5.0,所以在6.1版本中,名称和位置可能略有不同。



对于Eclipse中的项目配置,我刚刚检出每个分支启动板,然后将每个项目作为项目导入到我的Eclipse工作区。 6.0和6.1之间的启动细节有些不同。这是我的命令行参数:



6.0:


- addons-path $ {workspace_loc:openerp-addons-6.0} --config $ {workspace_loc:openerp-config / src / server.config} --xmlrpc-port = 9069 --netrpc-port = 9070 --xmlrpcs-port = 9071


6.1需要网络客户端与服务器一起启动:


- addons-path $ {workspace_loc:openerp-addons-trunk},$ {workspace_loc:openerp-web-trunk} / addons,$ {workspace_loc:openerp-migration} --config $ {workspace_loc :openerp-config / src / server.config} --xmlrpc-port = 9069 --netrpc-port = 9070 --xmlrpcs-port = 9071



I downloaded Open ERP server & web, having decided against the thicker gtk. I added the 2 as projects in eclipse, pydev running on Ubuntu 11.10 and started then up. I went through the web client setup & I though the installation had been done. At some point though I had executed a script that tried to copy all the bits and pieces out of my home folder into the file system some going to /ect or usr/local. I didn't want this so I stopped the process. Cause then I though I'd have to run eclipse as root & I'd not be able to trace process though the source cause it's all be scattered thought the file system.

Problems came when I tried to install a new module. I couldn't get it into the module list & even zipping it up and trying to import it through the client failed without errors.

While trying to get the module I added to show up I discovered this on the forums "You'll have to run setup.py install after putting the module in addons if you didn't specify an addons path when running openerp-server."

So it looked like I had to run:

python setup.py build
sudo python setup.py install

Firstly I'm confused about why you need to build I thought it was onlt the c libs that needed building and I'd done that when installing dependences.

Secondly setup.py install is obviosuly vital if you need to run it to get a new module recognised. How can I trace stuff through the source if it's running from all over the file system.

Everything has now been copied out of home into the file system as I had tried to avoid. Now the start up scripts are in usr/local/bin so I assume I can't run, using 'debug as' in eclipse or see the logs in the eclipse console. I also found in the documentation that that suggests starting the server with:

./openerp-server.py –addons-path=~/home/workspace/stable/addons

Which apparently overrides the addons in the file system created by the install, suggesting that you'd have just the modules in addon in eclipse where one could debug etc, but the other resources would be elsewhere?

I suppose that's ok, but I still have trouble visualizing how this is going to work, I suppose if this is the way it's done then how would one get standard out to go to the eclipse console?

I suppose I could have the complete project in eclipse but all the resources besides the addons would just be for reference purposes, while only the addons would actually be running since they are over-ridden by the –addons-path argument.

Then if I could get output to go to the console it would be like what I would expect.

I've seen some refferrences to using links in the eclipse workspace or running eclipse as root like an eclipse php setup.

Can anyone tell me how to start the server and web apps from eclipse and have the log output appear in the console?

Maybe an experienced python developer can spot my blind spots & suggests what I may be else I might be missing here?

解决方案

I feel your pain. I went through the same process a couple of years ago when I started working with OpenERP. The good news is that it's not too hard to set up, and OpenERP runs smoothly in Eclipse with PyDev.

Start by looking at the developer book for OpenERP. They lay out most of the requirements for getting it running.

To try and answer your specific questions, you shouldn't need to run the setup.py script at all in your development environment. It's only necessary when you deploy to a server. To get the server to recognize a new module, go to the administration menu, and choose Modules Management: Update Modules List. I'm still running OpenERP 5.0, so the names and locations might be slightly different in version 6.1.

For the project configuration in Eclipse, I just checked out each branch from launchpad, and then imported each one as a project into my Eclipse workspace. The launch details are a bit different between 6.0 and 6.1. Here are my command line arguments for each:

6.0:

--addons-path ${workspace_loc:openerp-addons-6.0} --config ${workspace_loc:openerp-config/src/server.config} --xmlrpc-port=9069 --netrpc-port=9070 --xmlrpcs-port=9071

6.1 needs the web client to launch with the server:

--addons-path ${workspace_loc:openerp-addons-trunk},${workspace_loc:openerp-web-trunk}/addons,${workspace_loc:openerp-migration} --config ${workspace_loc:openerp-config/src/server.config} --xmlrpc-port=9069 --netrpc-port=9070 --xmlrpcs-port=9071

这篇关于Python& OpenERP开发环境设置如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆