[Zope-dev] Changing and migrating persistence structure

2010-08-04 Thread Martin Aspeli
Hi,

[I posted this to zodb-dev, but it seems that list isn't working at
the moment(?) so I thought I'd try here too]

I have a package (plone.registry) that currently has a persistent
structure like this:

Registry(Persistent)
|
+--> Records(Persistent)
   |
   +--> BTree of Record(Persistent)
  |
  +--> PersistentField(Persistent)

That is, a Registry is a persistent object containing a persistent
Records object that in turn contains a BTree of persistent Record
objects that contain a persistent PersistentField and a primitive
value.

This is quite inefficient, though, because it results in a lot of
object loads. On any given request, some of our projects load a dozen
or more values from the registry. Each is just a simple primitive, but
we need to load the full shebang to make it work.

Now, I'd like to move to this structure:

 Registry(Persistent)
 |
 +--> Records
   |
   +--> BTree of Field
   |
   +--> BTree of values

Here, there's only one Persistent object, plus the two BTrees: one
holding all the fields and one holding all the values. Records no
longer needs to be persistent (its attributes become part of the
parent Registry's _p_jar). Fields no longer need to be persistent
either, since they are in effect immutable objects. Values are
primitives anyway.

I've done this (in a branch) and it works for new sites. However, I'm
having a nightmare trying to migrate old sites. As soon as I access
anything that uses the registry, I get ZODB errors, because the
persistent structure is now different. In particular, it's trying to
read a value into e.g. a Records object that used to derive from
Persistent, but now no longer does.

What is the best way to manage this type of migration?

In terms of API compatibility, I'd really like to keep
plone.registry.Record as the name and module path of the record, since
it is used by the API. The difference is that before it was persisted
and returned by an API on the Registry. Now, it's constructed as
needed on the fly from the internal data structure.

The same applies to the various field types that derive from
PersistentField, which are now Persistent, but won't be. There's code
and documentation out there that use these.

I'm less worried about the Records object, which was always an
implementation detail, and the BTree-of-records, which will never have
been accessed directly.

Cheers,
Martin
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/5/10 00:16 , Willi Langenberger wrote:
> According to Jens Vagelpohl:
>> before=$(svn info $ROOT | grep "^Last Changed Rev:" | cut -d " " -f 4)
>> svn up -q $ROOT
>> after=$(svn info $ROOT | grep "^Last Changed Rev:" | cut -d " " -f 4)
> 
> I think
> 
>   svn info $ROOT
> 
> doesnt give you the newest revision somewhere down the directory
> tree. You have to use something like
> 
>   svn info -R $ROOT | grep "^Last Changed Rev:"| cut -d ""-f 4 | \
>   sort -k1n,1 | tail -1
> 
> (note the "-R" flag for the "svn info" command).

Thanks Willi, I'll give that a try when I have a moment. I wouldn't be
surprised if that was the case.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxaW6gACgkQRAx5nvEhZLLmxACeLNo3ssUdKOHFRlQpYmnpuI2I
B1IAn3Q0aAEqrIB++OtiJCrXf6Ew8meA
=anjj
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Developer meeting 2010-08-02 at 15:00 UTC

2010-08-04 Thread Christian Theune
Hi,

there notes from this weeks meeting should appear in a few minutes:
http://docs.zope.org/zopetoolkit/zope-dev/zope-dev-20100803.html

In short:

Documentation improvements are making progress with Jens leading on 
making stuff accessible on doc.zope.org. Getting the packages in shape 
needs support with some initial bookkeeping (blueprints/bugs) and 
probably some coordinated effort at a sprint.

Has everyone who was supposed to received their MSDN licenses by now?

Adam is done with the Windows egg builder but due to PyPI issues and a 
hickup in doc.zope.org we couldn't review it.

Christian

-- 
Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Marius Gedminas
On Wed, Aug 04, 2010 at 05:41:08PM +0200, Wichert Akkerman wrote:
> On 8/4/10 17:38 , Jens Vagelpohl wrote:
> > IMHO trying to come up with some kind of programmatic algorithm to judge
> > a bit of documentation as "good enough to show" is insane. I'm  not
> > going to attempt it.
> 
> Fair enough.
> 
> > Maybe "shitty" (for some definition of "shitty", as someone else would
> > say) package docs will compel the maintainers to improve them.
> 
> I doubt it, considering the exposure of "shitty" docs on pypi does not 
> seem to have had any impact (aside from scaring away potential users).

Crappy docs on PyPI make me want to run away (with one exception: ReST
formatting errors on PyPI make me want to check out the source and fix
them).

Crappy docs on docs.zope.org make me want to check out the source
package and commit fixes.

I'm not prepared to speculate why I'm having these reactions -- is it a
prettier CSS?  The splitting of the docs into multiple reasonably-sized
pages instead of one huge undigestable lump?

I guess what I'm saying is: there's hope yet, don't give up!

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 17:41 , Wichert Akkerman wrote:
> On 8/4/10 17:38 , Jens Vagelpohl wrote:
>> Maybe "shitty" (for some definition of "shitty", as someone else would
>> say) package docs will compel the maintainers to improve them.
> 
> I doubt it, considering the exposure of "shitty" docs on pypi does not 
> seem to have had any impact (aside from scaring away potential users).

You're probably right, sad as it is.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZioYACgkQRAx5nvEhZLKTMACgmvcoBs5xV7sjkw4chXs0I54F
F84AoIkBOjYT8jOzYkX9CpOHbWh446MI
=T2Zd
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Wichert Akkerman
On 8/4/10 17:38 , Jens Vagelpohl wrote:
> IMHO trying to come up with some kind of programmatic algorithm to judge
> a bit of documentation as "good enough to show" is insane. I'm  not
> going to attempt it.

Fair enough.

> Maybe "shitty" (for some definition of "shitty", as someone else would
> say) package docs will compel the maintainers to improve them.

I doubt it, considering the exposure of "shitty" docs on pypi does not 
seem to have had any impact (aside from scaring away potential users).

Wichert.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 17:26 , Wichert Akkerman wrote:
> I'm wondering: can it be made to skip useless docs such as 
> http://docs.zope.org/zope.hookable/index.html, perhaps by checking for 
> linecount?
> 
> There are also a lot of packages that only have a changelog and no 
> documentation, for example 
> http://docs.zope.org/zope.contenttype/index.html . Should those be 
> considered good enough to be linked?

IMHO trying to come up with some kind of programmatic algorithm to judge
a bit of documentation as "good enough to show" is insane. I'm  not
going to attempt it.

Maybe "shitty" (for some definition of "shitty", as someone else would
say) package docs will compel the maintainers to improve them.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZiWcACgkQRAx5nvEhZLLOTACfWhQ7OQGQW1noXiT1MbTATbhi
SAwAoK/a6i+E2qbmfbNUxTalTNO78MoA
=T1Kj
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Wichert Akkerman
On 8/4/10 16:29 , Jens Vagelpohl wrote:
> The script (see below) sits at the root of the documentation buildout
> (such as the buildout at http://svn.zope.org/zopetoolkit/), which
> precreates the necessary sphinx-build script (that's why I am modifying
> $PATH). It's run every 15 minutes to detect and incorporate
> documentation changes in SVN. I'm not sure why it did stop firing the
> way it should.

I'm wondering: can it be made to skip useless docs such as 
http://docs.zope.org/zope.hookable/index.html, perhaps by checking for 
linecount?

There are also a lot of packages that only have a changelog and no 
documentation, for example 
http://docs.zope.org/zope.contenttype/index.html . Should those be 
considered good enough to be linked?

Wichert.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 14:55 , Marius Gedminas wrote:
> On Wed, Aug 04, 2010 at 11:09:58AM +0200, Jens Vagelpohl wrote:
>> On 8/4/10 10:57 , Adam GROSZER wrote:
>>> Hello Jens,
>>>
>>>   Something is wrong with the automatic update of
>>>   http://docs.zope.org/zopetoolkit/
>>>
>>>   Recent changes don't seem to show up.
>> I rebuilt it now. There's a check in a shell script to see if the
>> Subversion code is newer than the checked-out code, but it doesn't seem
>> to be reliable. I'll have to watch it.
>>
>> If someone could code up something more reliable I'd be very happy.
> 
> Can we see the shell script somewhere?

The script (see below) sits at the root of the documentation buildout
(such as the buildout at http://svn.zope.org/zopetoolkit/), which
precreates the necessary sphinx-build script (that's why I am modifying
$PATH). It's run every 15 minutes to detect and incorporate
documentation changes in SVN. I'm not sure why it did stop firing the
way it should.

jens



#!/bin/sh
ROOT="/home/zope/zopetoolkit"

export PATH="${PATH}:${ROOT}/bin"

before=$(svn info $ROOT | grep "^Last Changed Rev:" | cut -d " " -f 4)
svn up -q $ROOT
after=$(svn info $ROOT | grep "^Last Changed Rev:" | cut -d " " -f 4)

if [ "$before" != "$after" ]; then
echo "Updated from revision $before to $after;  rebuilding HTML docs."
cd $ROOT/doc
python bootstrap.py
${ROOT}/doc/bin/buildout -q -q
make -s releaseinfo >/dev/null
make -s html >/dev/null
fi

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZeVMACgkQRAx5nvEhZLJJzwCcCHstIBdBOiPMch+MQw7AYokD
27IAn0lK9AD+O9mMNALTtbxsVjczyANL
=V54Y
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] z3c.blobfile release and PyPI ownership

2010-08-04 Thread Martin Aspeli
Hi,

I'd like to make a new z3c.blobfile release. Can I please have PyPI access?

The current owners are uoestermeier, nadako.

Cheers,
Martin
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Marius Gedminas
On Wed, Aug 04, 2010 at 11:09:58AM +0200, Jens Vagelpohl wrote:
> On 8/4/10 10:57 , Adam GROSZER wrote:
> > Hello Jens,
> > 
> >   Something is wrong with the automatic update of
> >   http://docs.zope.org/zopetoolkit/
> > 
> >   Recent changes don't seem to show up.
> 
> I rebuilt it now. There's a check in a shell script to see if the
> Subversion code is newer than the checked-out code, but it doesn't seem
> to be reliable. I'll have to watch it.
> 
> If someone could code up something more reliable I'd be very happy.

Can we see the shell script somewhere?

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 32 OK, 9 Failed, 1 Unknown

2010-08-04 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue Aug  3 12:00:00 2010 UTC to Wed Aug  4 12:00:00 2010 UTC.
There were 42 messages: 6 from Zope Tests, 1 from buildbot at 
enfoldsystems.com, 4 from buildbot at pov.lt, 13 from buildbot at 
winbot.zope.org, 8 from ccomb at free.fr, 10 from jdriessen at 
thehealthagency.com.


Test failures
-

Subject: FAILED : winbot / ztk_dev py_244_win32
From: buildbot at winbot.zope.org
Date: Tue Aug  3 22:08:38 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017858.html

Subject: FAILED : winbot / ztk_dev py_254_win32
From: buildbot at winbot.zope.org
Date: Tue Aug  3 22:15:45 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017860.html

Subject: FAILED : winbot / ztk_dev py_265_win32
From: buildbot at winbot.zope.org
Date: Tue Aug  3 22:22:28 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017861.html

Subject: FAILED : winbot / ztk_dev py_265_win64
From: buildbot at winbot.zope.org
Date: Tue Aug  3 22:29:23 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017862.html

Subject: FAILED : winbot / ZODB_dev py_270_win32
From: buildbot at winbot.zope.org
Date: Wed Aug  4 03:40:33 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017876.html

Subject: FAILED : winbot / ZODB_dev py_270_win64
From: buildbot at winbot.zope.org
Date: Wed Aug  4 04:35:23 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017878.html

Subject: FAILED : Zope Buildbot / zope2.12 slave-osx
From: jdriessen at thehealthagency.com
Date: Wed Aug  4 06:54:17 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017879.html

Subject: FAILED : Zope Buildbot / zope2 slave-osx
From: jdriessen at thehealthagency.com
Date: Wed Aug  4 06:54:28 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017880.html

Subject: FAILED : Zope Buildbot / ztk slave-osx
From: jdriessen at thehealthagency.com
Date: Wed Aug  4 06:54:32 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017881.html


Unknown
---

Subject: [zodb-tests] buildbot failure in Enfold Systems on 
zodb-trunk-python-2.6-maestro
From: buildbot at enfoldsystems.com
Date: Wed Aug  4 04:00:33 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017877.html


Tests passed OK
---

Subject: OK : Zope 3.4 Known Good Set / py2.4-64bit-linux
From: buildbot at pov.lt
Date: Tue Aug  3 21:09:04 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017847.html

Subject: OK : Zope 3.4 Known Good Set / py2.4-32bit-linux
From: buildbot at pov.lt
Date: Tue Aug  3 21:29:17 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017848.html

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Tue Aug  3 21:31:36 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017849.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Tue Aug  3 21:33:36 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017850.html

Subject: OK : Zope-2.12 Python-2.6.5 : Linux
From: Zope Tests
Date: Tue Aug  3 21:35:36 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017851.html

Subject: OK : Zope-2.12-alltests Python-2.6.5 : Linux
From: Zope Tests
Date: Tue Aug  3 21:37:37 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017852.html

Subject: OK : Zope-trunk Python-2.6.5 : Linux
From: Zope Tests
Date: Tue Aug  3 21:39:37 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017853.html

Subject: OK : Zope-trunk-alltests Python-2.6.5 : Linux
From: Zope Tests
Date: Tue Aug  3 21:41:37 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017854.html

Subject: OK : Bluebream / Python2.4.6 32bit linux
From: ccomb at free.fr
Date: Tue Aug  3 22:06:04 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017855.html

Subject: OK : Bluebream / Python2.5.2 32bit linux
From: ccomb at free.fr
Date: Tue Aug  3 22:06:14 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017856.html

Subject: OK : Bluebream / Python2.6.4 32bit linux
From: ccomb at free.fr
Date: Tue Aug  3 22:06:16 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017857.html

Subject: OK : Zope 3.4 Known Good Set / py2.5-64bit-linux
From: buildbot at pov.lt
Date: Tue Aug  3 22:09:14 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017859.html

Subject: OK : Zope 3.4 Known Good Set / py2.5-32bit-linux
From: buildbot at pov.lt
Date: Tue Aug  3 22:29:31 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017863.html

Subject: OK : winbot / ztk_10 py_244_win32
From: buildbot at winbot.zope.org
Date: Tue Aug  3 22:37:48 EDT 2010
URL: http://mail.zope.org/pipermail/zope-tests/2010-August/017864.html

Subject: OK : winbot / ztk_10 py_254_win32
From: buildbot at winbot.zope.org
Date: Tue Aug  3 22:45:29 EDT 2010

Re: [Zope-dev] docs.zope.org automation

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 11:33 , Chris Withers wrote:
> Jens Vagelpohl wrote:
>>> I've just been doing some build and release tools for a customer that
>>> involve this sort of stuff, I resorted to:
>> 
>>
>> Yikes. Maybe the subshell isn't so bad after all :-P
> 
> Yeah ;-) Although getting the right python path set up can be a pain...

In my particular case that's not a problem. I simply re-use sys.path
from the running interpreter, which is good enough. Something like this:

cmd = 'PYTHONPATH="%s" %s setup.py --long-description' % (
   sys.executable, ':'.join(sys.path))
status, output = commands.getstatusoutput(cmd)

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZNUcACgkQRAx5nvEhZLKNtwCgqgZcNkJWZlS+qMkn8Ra9brnZ
gcgAnjnA/KaraIL93Ue+CvPlVzxwYs10
=ykyG
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org automation

2010-08-04 Thread Chris Withers
Jens Vagelpohl wrote:
>> I've just been doing some build and release tools for a customer that
>> involve this sort of stuff, I resorted to:
> 
> 
> Yikes. Maybe the subshell isn't so bad after all :-P

Yeah ;-) Although getting the right python path set up can be a pain...

Here's the actual version I use to do an in-process sdist:

 try:
 orig_argv = sys.argv
 orig_stdout,orig_stderr = sys.stdout,sys.stderr
 curdir = os.getcwd()
 sys.argv = sys.argv[0:1]+['egg_info',
   '--tag-svn-revision',
   '--tag-date',
   'sdist']
 sys.path.insert(0,location)
 os.chdir(location)
 sys.stdout,sys.stderr = StringIO(),StringIO()
 # yuk, but setup.py is yuk anyway!
 if 'setup' in sys.modules:
 del sys.modules['setup']
 import setup
 finally:
 os.chdir(curdir)
 sys.path.pop(0)
 sys.stdout,sys.stderr = orig_stdout,orig_stderr
 sys.argv = orig_argv

cheers,

Chris

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Chris Withers
Charlie Clark wrote:
> As you know, I don't use Plone either. I'm also evil but in a different  
> way! The recipe just sets up a Zope 2 instance, which I believe is a bit  
> tricky to work on all platforms. 

It's a piece of piss and needs no special recipes:

http://docs.zope.org/zope2/releases/2.12/INSTALL-buildout.html#creating-a-buildout-based-zope-instance

cheers,

Chris

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Charlie Clark
Am 04.08.2010, 11:15 Uhr, schrieb Chris Withers :

> yes, which it isn't for me, since it's evil and I'm not using Plone

Well, I said it was the idiot's guide...

As you know, I don't use Plone either. I'm also evil but in a different  
way! The recipe just sets up a Zope 2 instance, which I believe is a bit  
tricky to work on all platforms. That said the recipe could probably be a  
simpler.

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Chris Withers
Hanno Schlichting wrote:
> If you have a package, which isn't in the "Products" namespace and
> still want its initialize to be called, you need to add some bits to
> your configure.zcml:
> 
> 

Right, that's the bit I was after :-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Hanno Schlichting
On Wed, Aug 4, 2010 at 11:13 AM, Chris Withers  wrote:
> Okay, but what about:
>
> 
>
> ...causes Whatever/__init__.py's initialize method to get called?

Yes. Eggified products behave in the same way as code dumped into one
of the "products" directories.

If you have a package, which isn't in the "Products" namespace and
still want its initialize to be called, you need to add some bits to
your configure.zcml:



> Yeah, but it's setuptools namespace packages magic that makes sure __path__,
> which the old Zope 2 code iterates over, is set up correctly, right?

Sure.

Hanno
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Baiju M
On Wed, Aug 4, 2010 at 2:45 PM, Chris Withers  wrote:
> Baiju M wrote:
>>>
>>> zcml = simplistix.MailTemplates to your instance configuration and you're
>>> good.
>>
>> There is an assumption that plone.recipe.zope2instance [1] is used
>> to create instances from Buildout.
>
> yes, which it isn't for me, since it's evil and I'm not using Plone ;-)

The plone.recipe.zope2instance is not Plone specific.  It works well for us.

BTW, there is related recipe: http://pypi.python.org/pypi/plone.recipe.zeoserver

Regards,
Baiju M
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Chris Withers
Baiju M wrote:
>> zcml = simplistix.MailTemplates to your instance configuration and you're
>> good.
> 
> There is an assumption that plone.recipe.zope2instance [1] is used
> to create instances from Buildout.

yes, which it isn't for me, since it's evil and I'm not using Plone ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Chris Withers
Hanno Schlichting wrote:
> On Wed, Aug 4, 2010 at 10:55 AM, Chris Withers  wrote:
>> What does a "regular ZCML slug" look like?
> 
> My first Google hit is this
> http://worldcookery.com/files/ploneconf05-five/step2.html :)

yeah yeah...

Okay, but what about:



...causes Whatever/__init__.py's initialize method to get called?

>> Is this setuptools namespace package magic making things work or is there
>> explicit code in Zope that does this?
> 
> It's not really setuptools specific. It's just the same old code that
> does "import Products" and then iterates over everything it finds.

Yeah, but it's setuptools namespace packages magic that makes sure 
__path__, which the old Zope 2 code iterates over, is set up correctly, 
right?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Baiju M
On Wed, Aug 4, 2010 at 2:33 PM, Charlie Clark
 wrote:
> Am 04.08.2010, 10:56 Uhr, schrieb Jens Vagelpohl :
>
>> In essence: If your egg is in the "Products" namespace you don't need to
>> do anything after adding it e.g. to the list of eggs for a Zope instance
>> in your buildout.cfg. The product will be recognized, installed, and any
>> configure.zcml in the root picked up automatically.
>
> ie. in buildout just putting
> eggs = Products.MailTemplates
>
> should work fine. As will pip install Products.MailTemplates (just tested
> against Products.CMFDefault)
>
>> That's one reason I stick to that namespace for anything that is indeed
>> a Zope 2 Product.
>
> OTOH if you don't want to stick with Products. you will need to add
> something like
>
> zcml = simplistix.MailTemplates to your instance configuration and you're
> good.

There is an assumption that plone.recipe.zope2instance [1] is used
to create instances from Buildout.

 [1] http://pypi.python.org/pypi/plone.recipe.zope2instance

Regards,
Baiju M
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 10:57 , Adam GROSZER wrote:
> Hello Jens,
> 
>   Something is wrong with the automatic update of
>   http://docs.zope.org/zopetoolkit/
> 
>   Recent changes don't seem to show up.

I rebuilt it now. There's a check in a shell script to see if the
Subversion code is newer than the checked-out code, but it doesn't seem
to be reliable. I'll have to watch it.

If someone could code up something more reliable I'd be very happy.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZLmYACgkQRAx5nvEhZLLwmgCeMIl0fZf4Qu91XQ4BtmyspoCk
hFUAn3CjfLXtbtJVjrQ8qcKxLMRkDOTU
=O5Cl
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Hanno Schlichting
On Wed, Aug 4, 2010 at 10:55 AM, Chris Withers  wrote:
> What does a "regular ZCML slug" look like?

My first Google hit is this
http://worldcookery.com/files/ploneconf05-five/step2.html :)

> Is this setuptools namespace package magic making things work or is there
> explicit code in Zope that does this?

It's not really setuptools specific. It's just the same old code that
does "import Products" and then iterates over everything it finds.

Hanno
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Charlie Clark
Am 04.08.2010, 10:56 Uhr, schrieb Jens Vagelpohl :

> In essence: If your egg is in the "Products" namespace you don't need to
> do anything after adding it e.g. to the list of eggs for a Zope instance
> in your buildout.cfg. The product will be recognized, installed, and any
> configure.zcml in the root picked up automatically.

ie. in buildout just putting
eggs = Products.MailTemplates

should work fine. As will pip install Products.MailTemplates (just tested  
against Products.CMFDefault)

> That's one reason I stick to that namespace for anything that is indeed
> a Zope 2 Product.

OTOH if you don't want to stick with Products. you will need to add  
something like

zcml = simplistix.MailTemplates to your instance configuration and you're  
good.

Hope this idiot's guide helps.

Charlie
-- 
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] docs.zope.org

2010-08-04 Thread Adam GROSZER
Hello Jens,

  Something is wrong with the automatic update of
  http://docs.zope.org/zopetoolkit/

  Recent changes don't seem to show up.

-- 
Best regards,
 Adam GROSZER  mailto:agros...@gmail.com
--
Quote of the day:
For happiness one needs security, but joy can spring like a flower even from 
the cliffs of despair. 
- Anne Morrow Lindbergh 

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 10:52 , Hanno Schlichting wrote:
> Hi.
> 
> On Wed, Aug 4, 2010 at 10:31 AM, Chris Withers  wrote:
>> I'm in the process of egg-ifying some Zope 2 Products of mine (first up
>> is MailTemplates) and I'm curious as to how add-in products work in an
>> egg-based Zope setup.
>>
>> Do I need to include anything in zope.conf or some zcml somewhere?

> If your package is a namespace package in the 'Products' namespace,
> then it will be picked up automatically, once added to the PYTHONPATH.

In essence: If your egg is in the "Products" namespace you don't need to
do anything after adding it e.g. to the list of eggs for a Zope instance
in your buildout.cfg. The product will be recognized, installed, and any
configure.zcml in the root picked up automatically.

That's one reason I stick to that namespace for anything that is indeed
a Zope 2 Product.

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZKzQACgkQRAx5nvEhZLK7TgCeI2n6Y+xjagXyPZHeNuEII2V3
xMUAoIJHoErxjlAjZRWYPME8tEPM1S2O
=IYFz
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Chris Withers
Hanno Schlichting wrote:
> For a general Python package to be picked up, you would need to add a
> regular ZCML slug into the etc/package-includes directory of your
> instance.

What does a "regular ZCML slug" look like?

> If your package is a namespace package in the 'Products' namespace,
> then it will be picked up automatically, once added to the PYTHONPATH.

Is this setuptools namespace package magic making things work or is 
there explicit code in Zope that does this?

> This is triggered by the "five:loadProducts" and
> "five:loadProductsOverrides" directives in your instances site.zcml.
> The code for those directives is either in Products.Five or OFS
> depending on which version of Zope2 you use.

Thanks for this!

Chris

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org automation

2010-08-04 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Chris,


> I've just been doing some build and release tools for a customer that
> involve this sort of stuff, I resorted to:


Yikes. Maybe the subshell isn't so bad after all :-P

jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkxZKkQACgkQRAx5nvEhZLKQWACgmwW7mgXSQdj4W64aMXXq/PY9
Z2wAoKHgZs6uYAdvDdoR9MzcegrOm6er
=EbE3
-END PGP SIGNATURE-
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Hanno Schlichting
Hi.

On Wed, Aug 4, 2010 at 10:31 AM, Chris Withers  wrote:
> I'm in the process of egg-ifying some Zope 2 Products of mine (first up
> is MailTemplates) and I'm curious as to how add-in products work in an
> egg-based Zope setup.
>
> Do I need to include anything in zope.conf or some zcml somewhere?

For a general Python package to be picked up, you would need to add a
regular ZCML slug into the etc/package-includes directory of your
instance.

If your package is a namespace package in the 'Products' namespace,
then it will be picked up automatically, once added to the PYTHONPATH.
This is triggered by the "five:loadProducts" and
"five:loadProductsOverrides" directives in your instances site.zcml.
The code for those directives is either in Products.Five or OFS
depending on which version of Zope2 you use.

Hanno
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] docs.zope.org automation

2010-08-04 Thread Chris Withers
Jens Vagelpohl wrote:
> I understand that. But it must be possible to do that programatically in
> my code. I mean, "setup.py --long-description" obviously executes Python
> code, which I may be able to execute myself in my current interpreter
> session by importing and executing stuff from setuptools.

Yeah, this is why setup.py sucks ;-)

I've just been doing some build and release tools for a customer that 
involve this sort of stuff, I resorted to:

 with nested(Replacer(),OutputCapture()) as (r,o):
 r.replace('sys.argv',['X','egg_info'])
 try:
 sys.path.insert(0,path)
 curdir = os.getcwd()
 os.chdir(path)
 # yuk, but setup.py is yuk anyway!
 if 'setup' in sys.modules:
 del sys.modules['setup']
 import setup
 finally:
 os.chdir(curdir)
 sys.path.pop(0)

..in my tests, the del from sys.modules is to allow this to by done 
multiple times in one process.

Replacer is 
http://packages.python.org/testfixtures/mocking.html#the-context-manager

OutputCapture looks like:

class OutputCapture:

 def __enter__(self):
 self.original_stdout = sys.stdout
 self.original_stderr = sys.stderr
 self.output = sys.stdout = sys.stderr = StringIO()
 return self

 def __exit__(self,*args):
 sys.stdout = self.original_stdout
 sys.stderr = self.original_stderr

 def compare(self,expected):
 compare(expected.strip(),self.output.getvalue().strip())

 > Having to
> invoke another Python interpreter in a subshell because that's too
> complicated to do any other way is awful.

Yeah, I do resort to this for some things too ;-)

http://packages.python.org/execute/use.html

cheers,

Chris


___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Products in Zope 2.12+

2010-08-04 Thread Chris Withers
Hi All,

I'm in the process of egg-ifying some Zope 2 Products of mine (first up 
is MailTemplates) and I'm curious as to how add-in products work in an 
egg-based Zope setup.

Do I need to include anything in zope.conf or some zcml somewhere?

If not how are products picked up? Where can I find that code that does 
this?

Oh, and more in passing that actual hope, are there any docs anywhere on 
this? :-)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )