Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 47 lines (37 sloc) 1.03 KB
# Simple script to generate a .codeintel/config file for a buildout directory.
# The buildout must use collective.recipe.omelette to generate a parts/omelette
# directory. This will be used as the Python path
import os.path
import sys
path = "parts/omelette"
buildout = "bin/buildout"
python = sys.executable
if len(sys.argv) > 1:
path = sys.argv[1]
path = os.path.abspath(path)
if len(sys.argv) > 2:
python = sys.argv[2]
if not os.path.exists(path):
print "Cannot find path", path
if not os.path.exists(python):
print "Cannot find interpreter", python
if os.path.exists(buildout):
hashbang = open(buildout, 'r').readline()
if hashbang.startswith("#!"):
hashbang = hashbang[2:]
python = hashbang.strip()
if not os.path.exists(".codeintel"):
open(os.path.join(".codeintel", "config"), "w").write("""\
"Python": {
"python": "%s",
"pythonExtraPaths": [
""" % (python, path))