[Zope-dev] Zope2 trunk: getting 'mkzopeinstance' / 'mkzeoinstance' working

Andreas Jung lists at zopyx.com
Wed Mar 4 12:23:22 EST 2009


-----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-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20090304/cb94beda/attachment.vcf 


More information about the Zope-Dev mailing list