Commit 0cae9cc3 authored by Tres Seaver's avatar Tres Seaver

Make 'mkzopeinstance' work from a SVN checkout.

parent d1769d15
......@@ -50,6 +50,9 @@ def main():
skelsrc = None
python = None
if check_buildout():
python = os.path.abspath('bin/zopepy')
for opt, arg in opts:
if opt in ("-d", "--dir"):
skeltarget = os.path.abspath(os.path.expanduser(arg))
......@@ -186,5 +189,14 @@ def write_inituser(fn, user, password):
fp.close()
os.chmod(fn, 0644)
def check_buildout():
""" Are we running from within a buildout which supplies 'zopepy'?
"""
if os.path.exists('buildout.cfg'):
from ConfigParser import RawConfigParser
parser = RawConfigParser()
parser.read('buildout.cfg')
return 'zopepy' in parser.sections()
if __name__ == "__main__":
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment