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

2009-03-04 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

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?


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJrrfo+gerLs4ltQ4RAg9nAKCMz3Vv9FJTD83E5g4EPE3OrWlIYwCgqkHF
++1Zv8K5hM/H3KH0jE0ZfUw=
=dn0X
-END PGP SIGNATURE-
___
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 )


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

2009-03-04 Thread Andreas Jung
-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 )


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

2009-02-24 Thread Hanno Schlichting
Tres Seaver wrote:
 Hanno Schlichting wrote:
 Andreas Jung wrote:
 On Mon, Feb 23, 2009 at 17:46, Tres Seaver tsea...@palladion.com wrote:
 Creating an instance from the SVN checkout itself doesn't work for me
 either for the same reason. The created scripts try to use the general
 Python interpreter without the correct sys.path and end up missing out
 all the dependencies.
 
 Right:  if you hack it to use the 'zopepy' script, rather than
 sys.executable, then the instance scripts work.

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.

Hanno

___
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 )


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

2009-02-24 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hanno Schlichting wrote:
 Tres Seaver wrote:
 Hanno Schlichting wrote:
 Andreas Jung wrote:
 On Mon, Feb 23, 2009 at 17:46, Tres Seaver tsea...@palladion.com wrote:
 Creating an instance from the SVN checkout itself doesn't work for me
 either for the same reason. The created scripts try to use the general
 Python interpreter without the correct sys.path and end up missing out
 all the dependencies.
 Right:  if you hack it to use the 'zopepy' script, rather than
 sys.executable, then the instance scripts work.
 
 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'?)


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJpIFu+gerLs4ltQ4RAl/9AJ0fs1Re3TPN3ywPAfVO0hf18z9XzwCeNz3u
Zupy2J8xlHfR7jsUTHUFe4U=
=0fQW
-END PGP SIGNATURE-

___
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 )


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

2009-02-24 Thread Hanno Schlichting
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.

Hanno

___
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 )


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

2009-02-23 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hanno Schlichting wrote:
 Andreas Jung wrote:
 I haven't seen an issue with this. What is the exact failure?

 Andreas

 On Mon, Feb 23, 2009 at 17:46, Tres Seaver tsea...@palladion.com wrote:
 The scripts run, but produce instances which don't work, because they
 plug in the base python, rather than the zopepy one.  Is anybody
 working on fixing this issue?
 
 Creating an instance from the SVN checkout itself doesn't work for me
 either for the same reason. The created scripts try to use the general
 Python interpreter without the correct sys.path and end up missing out
 all the dependencies.

Right:  if you hack it to use the 'zopepy' script, rather than
sys.executable, then the instance scripts work.

 So far only creating an instance from a source distribution built from
 the SVN checkout works for me.


- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJotYZ+gerLs4ltQ4RArhKAJ9NbZ6GfApTxw3NzG9/tez5OLrAGQCgynKK
REUivQU9PkOHseeIquG7AL0=
=zJxt
-END PGP SIGNATURE-
___
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 )