Re: [Zope-dev] Manuel Beta

2009-06-25 Thread Thomas Lotze
Benji York wrote:

 I've just released the first beta of Manuel, my next-generation doctest
 project.

Many thanks for the ideas and work you put in manuel!

 I'm interested in any feedback and/or questions you may have be it
 technical, documentation, or marketing (i.e., how do I describe what
 Manuel does and what benefits it has).

I have a technical comment: If you want to use manuel for writing some
test logic that works region by region (which I suspect is a rather
standard use case), you have to do some boilerplate wiring that involves
iterating over region and making sure that you really only evaluate
matching regions and format your own results. It would be nice to have a
way to create a Manuel object from just some matching expressions and code
that applies to a single example.

To see what I mean, you might take a look at tl.testing (the cairo
module). The code there is split up into testing logic that compares cairo
surfaces to images of the expectations (the Test and Result classes) and a
Manuel class that just ties it all up. To have something like that Manuel
class provided by the manuel package would be quite helpful.

That module also defines its own doc file suite, mainly in order to have a
test suite factory with all the features of the standard (or rather,
zope.testing) doc test suite. To have a more elaborate doc file suite
available from manuel would also be good.

-- 
Thomas



___
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] z3c.saconfig engine creation configuration

2009-06-25 Thread Malthe Borch

Laurence Rowe wrote:
I would rather we did not hardcode the defaults from SQLAlchemy into the 
engine directive (I guess they could change in future). Instead use a 
default of None and only supply the parameter if the config option is set.


Sounds right to me. Attached is an update patch.

\malthe
Index: src/z3c/saconfig/zcml.py
===
--- src/z3c/saconfig/zcml.py(revision 101264)
+++ src/z3c/saconfig/zcml.py(working copy)
@@ -27,13 +27,28 @@
 required=False,
 default=False)
 
+pool_size = zope.schema.Int(
+title=uPool size,
+description=uNumber of connections to keep open inside the connection 
pool.,
+required=False)
+
+pool_recycle = zope.schema.Int(
+title=uPool recycle,
+description=uRecycle connections after the given number of seconds 
have passed.,
+required=False)
+
+pool_timeout = zope.schema.Int(
+title=uPool timeout,
+description=uNumber of seconds to wait before giving up on getting a 
connection from the pool.,
+required=False)
+
 setup = zope.schema.BytesLine(
 title=u'After engine creation hook',
 description=u'Callback for creating mappers etc. One argument is 
passed, the engine',
 required=False,
 default=None)
+
 
-
 class ISessionDirective(zope.interface.Interface):
 Registers a database scoped session
 
@@ -62,16 +77,27 @@
 default=z3c.saconfig.utility.GloballyScopedSession)
 
 
-def engine(_context, url, name=u, echo=False, setup=None, twophase=False):
-factory = utility.EngineFactory(url, echo=echo)
-
+def engine(_context, url, name=u, echo=False, setup=None, twophase=False,
+   pool_size=None, pool_recycle=None, pool_timeout=None):
+# to avoid overriding defaults, we only provide pool configuration
+# parameters if set
+kwargs = {}
+if pool_size is not None:
+kwargs['pool_size'] = pool_size
+if pool_recycle is not None:
+kwargs['pool_recycle'] = pool_recycle
+if pool_timeout is not None:
+kwargs['pool_timeout'] = pool_timeout
+
+factory = utility.EngineFactory(url, echo=echo, **kwargs)
+
 zope.component.zcml.utility(
 _context,
 provides=interfaces.IEngineFactory,
 component=factory,
 permission=zope.component.zcml.PublicPermission,
 name=name)
-
+
 if setup:
 if _context.package is None:
 callback = resolve(setup)
___
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] zc.async: cron replacement?

2009-06-25 Thread Reinout van Rees
On 2009-06-24, Gary Poster gary.pos...@gmail.com wrote:

 zc.async can be used to do cron-like activities by starting a job,
 to be performed after a certain time, that has a callback that
 reschedules another job when desired.

 This has the advantage over cron-like behavior because it does not
 reschedule until the first job is done.

Well, for a task that runs a couple of seconds once a day or once a
week...  My first thought was if something goes wrong, the chain is
broken and no new jobs will be scheduled anymore.  From the
documentation, it seems zc.async is pretty robust so this is probably
not something I have to worry about.

I'd put a short paragraph in the readme that this is how you can do
cron jobs.  Helps with the google for zope cron, too :-)

 Other zc.async competitors have cron implemented more directly, but
 I found it to be very easy and flexible to do what I wanted using
 the zc.async approach.

Thanks for the info.  I'll see if I can get a basic cron-with-pack
setup in one instance running.


Reinout

-- 
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Software developer at http://www.thehealthagency.com
Military engineers build missiles. Civil engineers build targets

___
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] zc.async: cron replacement?

2009-06-25 Thread Hermann Himmelbauer
Am Mittwoch 24 Juni 2009 19:19:17 schrieb Reinout van Rees:
 Hi all,

 In messages like
 http://www.mail-archive.com/zope3-...@zope.org/msg05964.html, zc.async is
 mentioned as the solution for cron-like functionality in zope. Effectively
 you would not need zope2's clockserver.

 Reading zc.async's docs, I cannot find how to do a given task regularly. 
 For example a weekly pack.  Or a daily call of one method that archives
 older items.  That sort of stuff. Many things can be handled by cronjobs,
 but you tend to get a lot of them.  And you don't want to embed the
 password everywhere.

 Anyway: I cannot find the word cron anywhere in the zc.async source.  Or
 repetitive or regular.  Is zc.async not intended for this kind of
 usage?

I personally recommend to also look at lovely.remotetask, as this does have 
direct cronjob functionality and is relatively simple to implement. 
I personally use it, however, I'm still a bit sceptic if it's really robust 
and scales well, moreover, I'm unsure if it is actively maintained.

Best Regards,
Hermann

-- 
herm...@qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
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 )


[Zope-dev] Zope Tests: 8 OK

2009-06-25 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Wed Jun 24 12:00:00 2009 UTC to Thu Jun 25 12:00:00 2009 UTC.
There were 8 messages: 8 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Jun 24 21:11:44 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012019.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Jun 24 21:13:49 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012020.html

Subject: OK : Zope-trunk Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Jun 24 21:15:49 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012021.html

Subject: OK : Zope-trunk Python-2.5.4 : Linux
From: Zope Tests
Date: Wed Jun 24 21:17:50 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012022.html

Subject: OK : Zope-trunk Python-2.6.1 : Linux
From: Zope Tests
Date: Wed Jun 24 21:19:57 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012023.html

Subject: OK : Zope-trunk-alltests Python-2.4.6 : Linux
From: Zope Tests
Date: Wed Jun 24 21:21:57 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012024.html

Subject: OK : Zope-trunk-alltests Python-2.5.4 : Linux
From: Zope Tests
Date: Wed Jun 24 21:23:57 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012025.html

Subject: OK : Zope-trunk-alltests Python-2.6.1 : Linux
From: Zope Tests
Date: Wed Jun 24 21:25:57 EDT 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-June/012026.html

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