-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 04.03.2009 18:18 Uhr, Tres Seaver wrote: > Tres Seaver wrote: >> Hanno Schlichting wrote: >>> Tres Seaver wrote: >>>> Hanno Schlichting wrote: >>>>> I looked at this, but guessing or reliably getting to the zopepy script >>>>> wasn't possible. So I added an explicit option to the script instead and >>>>> documented it. You can now use: >>>>> bin/mkzopeinstance --python=bin/zopepy >>>>> on the SVN trunk. You can omit this option and it will use >>>>> sys.executable as before. >>>> Maybe we can detect buildout vs. tarball (e.g., the presence of >>>> 'buildout.cfg' vs. 'makefile'?) >>> What you have available inside the mkzopeinstance script is: >>> sys.executable which is just your regular Python interpreter and then >>> sys.argv which is ./bin/mkzopeinstance. >>> As the 'zopepy' script can be called anything, I don't see how you can >>> be smarter here. >> I'm not worried about generalities: I think that 'mkzopeinstance' >> should work from inside a SVN checkout of the Zope2 trunk, where the >> script is going to have a known hame. Something like this:: > >> --- src/Zope2/utilities/mkzopeinstance.py (revision 97232) >> +++ src/Zope2/utilities/mkzopeinstance.py (working copy) >> @@ -50,6 +50,9 @@ >> 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 @@ >> 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() > > > Any objections if I check this in? >
Not from my side. Andreas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkmuuQkACgkQCJIWIbr9KYy44QCePL1et0sbZuiercxnG8b5JT1K I4cAnR255teqWV4IKdegbcTiKOJUOeH2 =TFgh -----END PGP SIGNATURE-----
begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. & Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:i...@zopyx.com title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )