Personal tools
 
You are here: Home Plone Forums

Re: [Product-Developers] buildout and eclipse

by silviot :: Rate this Message:

Reply to Author | View in Thread


On Tue, Apr 15, 2008 at 10:15 AM, Tim Knapp <duffyd@...> wrote:

> > Any one familiar with eclipse innards and buildout recipes?
> >
> > Is it concievable to generate a eclipse project file as part of a
> > buildout such that the run environment inside eclipse is already setup?
>
> You seen this: http://pypi.python.org/pypi/pb.recipes.pydev/0.4.1
>
> -Tim
 
I managed to use that recipe with Plone.
I had to install the latest eclipse+pydev (3.3.2 + 1.3.14).
I created a pydev project.
I set the pydevproject_path of the pb.recipes.pydev recipe to the newly created .pydevproject file.
After that I had code completion, but not for products in the ${instance:products} directories (CMFCore, ATContenttypes etc).
I wrote a few lines that work for me in a iw.recipe.cmd:py section in the buildout.
They should probably be found in the recipe, but I don't know how to patch it (never dugg into recipes).
In case it is useful, the code is:

[pydev]
recipe = pb.recipes.pydev
pydevproject_path = /home/myuser/workspace/project/.pydevproject
target_python = python2.4
eggs =
     ${instance:eggs}
     pb.recipes.pydev
extra_paths =
     ${buildout:directory}/prodlinks

[make_pydev_init_files]
# we need this (a Products directory with symlinks to all plone products)
# to have completion of code in the Products namespace
recipe = iw.recipe.cmd:py
on_install=true
cmds = 
      >>> dirs = """${instance:products}""".split("\n")
      >>> prodlinks = os.path.join("""${buildout:directory}""".strip() , 'prodlinks')
      >>> Products = os.path.join(prodlinks,'Products')
      >>> import os
      >>> if not os.path.isdir(prodlinks): os.mkdir(prodlinks)
      >>> if not os.path.isdir(Products): os.mkdir(Products) 
      >>> open(os.path.join(Products , '__init__.py'),'w').write('#')
      >>> for dir in dirs:
      >>>      if dir:
      >>>           for product in [os.path.join(dir,a) for a in os.listdir(dir) if os.path.isdir(os.path.join(dir,a))]:
      >>>               linkname = os.path.join(Products, os.path.basename(product))
      >>>               if not os.path.islink(linkname): os.symlink(product,linkname)

 

Silvio

_______________________________________________
Product-Developers mailing list
Product-Developers@...
http://lists.plone.org/mailman/listinfo/product-developers