Re: [Zope] Restart button in Control Panel
Jake wrote: You are starting it in Debug mode, which means it will not allow for the restart button. /etc/zope.conf (edit debug mode) Also, try running it with: /bin/zopectl start & I don't think that debug mode has anything to do with it. Rather, if you're using "runzope" it's not running in daemon mode, and so cannot restart. Run it as a service with 'zopectl start' and you'll have a "Restart" button. --jcc ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Both tal:on-error and error_log?
On Apr 18, 2005, at 20:51, Kirk Strauser wrote: On Monday 18 April 2005 13:35, Jens Vagelpohl wrote: I don't think that's possible. But you can test that very easily for yourself by putting code inside the on-error that provokes an error. I guess I should've prefaced my question by saying that I know on-error normally ends propagation of the exception. I guess I was wondering if there was some way to manually add the exception to an error_log object so that i can come back later to analyze that logfile, while still presenting a non-confusing error screen to my users. There is a method named "raising" on the SiteErrorLog object but I don't see a way to call it from a PageTemplate itself because it seems to need the actual exception object as its argument. jens ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Both tal:on-error and error_log?
On Monday 18 April 2005 13:35, Jens Vagelpohl wrote: > I don't think that's possible. But you can test that very easily for > yourself by putting code inside the on-error that provokes an error. I guess I should've prefaced my question by saying that I know on-error normally ends propagation of the exception. I guess I was wondering if there was some way to manually add the exception to an error_log object so that i can come back later to analyze that logfile, while still presenting a non-confusing error screen to my users. -- Kirk Strauser The Day Companies ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Both tal:on-error and error_log?
On Apr 18, 2005, at 20:20, Kirk Strauser wrote: Can I use a tal:on-error attribute in a page template to provide a user-friendly explanation of an exception while still recording the occurrence of that exception to error_log? I don't think that's possible. But you can test that very easily for yourself by putting code inside the on-error that provokes an error. jens ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Both tal:on-error and error_log?
Can I use a tal:on-error attribute in a page template to provide a user-friendly explanation of an exception while still recording the occurrence of that exception to error_log? -- Kirk Strauser The Day Companies ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
It's designed to be a counter and does automatic conflict resolution. It was mentionned a number of times in the past on the zope and zodb-dev lists. Thank you. I found detailed info in the mailing list archive, just like you said. -- Milos Prudek http://www.spoxdesign.com - your web usability testing ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
Probably not. If you had an SQL solution, and some client code said someArticle.NumberOfReaders += 1, how would you get that assignment to fire off your SQL code? I would have to "calculate" the key, so simple assignment would not work, that's true. -- Milos Prudek http://www.spoxdesign.com - your web usability testing ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
On Mon, Apr 18, 2005 at 06:29:49PM +0200, Milos Prudek wrote: > >from ZODB import PersistentList > > Interesting. I'll look at this idea. I never heard of this class. > > >You could then have NumberOfProperties become a ComputedAttribute > > >But AFAIK, ComputedAttributes don't support write methods. > > Um, are you saying that the solution would actually not work for my use > case? If your use case is that a writable attribute is part of your class' API, then yes I am saying that. If your count is always updated by methods of the class anyway, then you're fine. > >So client code can't write "someArticle.NumberOfReaders += 1". > >But then, you wouldn't be able to do that with a SQL-based > >solution either. > > Why not? It's easy to write ZSQL method to update data. Probably we do > not understand each other. Probably not. If you had an SQL solution, and some client code said someArticle.NumberOfReaders += 1, how would you get that assignment to fire off your SQL code? -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
Milos Prudek <[EMAIL PROTECTED]> wrote: > > A better candidate, rather than PersistentList, would be a BTrees.Length. > > Never heard about this. Why is it better? What does it do? Where can I > find more info about it? It's designed to be a counter and does automatic conflict resolution. It was mentionned a number of times in the past on the zope and zodb-dev lists. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
A better candidate, rather than PersistentList, would be a BTrees.Length. Never heard about this. Why is it better? What does it do? Where can I find more info about it? -- Milos Prudek http://www.spoxdesign.com - your web usability testing ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
from ZODB import PersistentList Interesting. I'll look at this idea. I never heard of this class. You could then have NumberOfProperties become a ComputedAttribute But AFAIK, ComputedAttributes don't support write methods. Um, are you saying that the solution would actually not work for my use case? So client code can't write "someArticle.NumberOfReaders += 1". But then, you wouldn't be able to do that with a SQL-based solution either. Why not? It's easy to write ZSQL method to update data. Probably we do not understand each other. -- Milos Prudek ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] tal:attributes and extra newline
Ok, silly question then... :) Let's stop this thread now. Thanks for the answers. Pascal -Message d'origine- De : Fred Drake [mailto:[EMAIL PROTECTED] Envoyé : lundi 18 avril 2005 18:04 À : Pascal Peregrina Cc : zope@zope.org Objet : Re: [Zope] tal:attributes and extra newline On 4/18/05, Pascal Peregrina <[EMAIL PROTECTED]> wrote: > So, just to know, why is the default value 60 ? I think just because Guido wrote it that way. I don't know that there's anything special about the value. -Fred -- Fred L. Drake, Jr. Zope Corporation ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tal:attributes and extra newline
On 4/18/05, Pascal Peregrina <[EMAIL PROTECTED]> wrote: > So, just to know, why is the default value 60 ? I think just because Guido wrote it that way. I don't know that there's anything special about the value. -Fred -- Fred L. Drake, Jr. Zope Corporation ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] tal:attributes and extra newline
--On Montag, 18. April 2005 17:55 Uhr +0200 Pascal Peregrina <[EMAIL PROTECTED]> wrote: Ok, it was TALInterpreter after all, but you need a long list of attributes (on a single line / single tal:attributes statement I mean)... It's because of the TAL.TALInterpreter.TALInterpreter.wrap value defaulting to 60 (see __init__) I managed, in my object that relies on PageTemplate, to set warp to 0 and I got no more extra newlines. So, just to know, why is the default value 60 ? It could be 42 or 120 or 800 :-) -aj pgp4qXCB85kuK.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] tal:attributes and extra newline
Ok, it was TALInterpreter after all, but you need a long list of attributes (on a single line / single tal:attributes statement I mean)... It's because of the TAL.TALInterpreter.TALInterpreter.wrap value defaulting to 60 (see __init__) I managed, in my object that relies on PageTemplate, to set warp to 0 and I got no more extra newlines. So, just to know, why is the default value 60 ? Pascal -Message d'origine- De : Andreas Jung [mailto:[EMAIL PROTECTED] Envoyé : lundi 18 avril 2005 16:57 À : Pascal Peregrina; 'zope@zope.org' Objet : Re: [Zope] tal:attributes and extra newline --On Montag, 18. April 2005 16:31 Uhr +0200 Pascal Peregrina <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know the reason why tal:attributes adds an extra newline > for each generated tag attribute. > This just makes generated HTML bigger... It generates *only newlines if *you* generate multiple attributes using a single tal:attributes statement on *multiple* lines...so it's your application.. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] tal:attributes and extra newline
Thanks for the quick answer, I will double check. Pascal -Message d'origine- De : Andreas Jung [mailto:[EMAIL PROTECTED] Envoyé : lundi 18 avril 2005 16:56 À : Pascal Peregrina; 'zope@zope.org' Objet : Re: [Zope] tal:attributes and extra newline --On Montag, 18. April 2005 16:31 Uhr +0200 Pascal Peregrina <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know the reason why tal:attributes adds an extra newline > for each generated tag attribute. > This just makes generated HTML bigger... It does not (for me) ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tal:attributes and extra newline
--On Montag, 18. April 2005 16:31 Uhr +0200 Pascal Peregrina <[EMAIL PROTECTED]> wrote: Hi, I would like to know the reason why tal:attributes adds an extra newline for each generated tag attribute. This just makes generated HTML bigger... It generates *only newlines if *you* generate multiple attributes using a single tal:attributes statement on *multiple* lines...so it's your application... -aj pgpFkPGB5PiNi.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] tal:attributes and extra newline
--On Montag, 18. April 2005 16:31 Uhr +0200 Pascal Peregrina <[EMAIL PROTECTED]> wrote: Hi, I would like to know the reason why tal:attributes adds an extra newline for each generated tag attribute. This just makes generated HTML bigger... It does not (for me). -aj pgphBuUYHeDzH.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] tal:attributes and extra newline
Hi, I would like to know the reason why tal:attributes adds an extra newline for each generated tag attribute. This just makes generated HTML bigger... Thanks. Pascal ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
Paul Winkler <[EMAIL PROTECTED]> wrote: > On Mon, Apr 18, 2005 at 02:38:01PM +0200, Milos Prudek wrote: > > I have a couple hundred Articles (class instances) in my ZODB. Most > > instances are 200 kB, some are much larger. One of the Article > > properties is Number of times the article was read. Any increment causes > > ZODB to grow by the size of the given instance, due to the fact that > > ZODB will append a new version of the whole 200 kB or 2MB instance just > > because a single byte was changed. > > > > Consequently ZODB grows several hundred MB in a single day even if no > > new article is added. > > > > This calls for some form of non-undoable storage. > > > > Is there an obvious elegant solution that I am missing? > > You might consider replacing the NumberOfReaders attribute with a > first-class persistent object. e.g. you could use a PersistentList or > IIBTree or some such. This would prevent Zope from saving the entire > Article object when that one attribute changes. You'd still get some > bloat from all the historical revisions of the attribute, but it would > be MUCH less. A better candidate, rather than PersistentList, would be a BTrees.Length. Florent -- Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D +33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] non-undoable storage
On Mon, Apr 18, 2005 at 02:38:01PM +0200, Milos Prudek wrote: > I have a couple hundred Articles (class instances) in my ZODB. Most > instances are 200 kB, some are much larger. One of the Article > properties is Number of times the article was read. Any increment causes > ZODB to grow by the size of the given instance, due to the fact that > ZODB will append a new version of the whole 200 kB or 2MB instance just > because a single byte was changed. > > Consequently ZODB grows several hundred MB in a single day even if no > new article is added. > > This calls for some form of non-undoable storage. > > One possibility is to move the "NumberOfReaders" attribute from ZODB to > my SQL server. Not a problem, but I'm not sure what is the best way to > maintain connection between ZODB instance (it can appear at different > places in ZODB directory structure and it can be moved from place to > place with Cut and Paste in ZMI) and SQL table. Connection means SQL key > column. Instance ids cannot be used as a SQL key, because they are > nonunique - each folder has a sequence of instances numbered 1...x. So > there are over ten instances named "1". Instance addresses = URLs could > be used but I would have to write my own methods / interfaces for moving > Articles in the directory structure to maintain the connection between > ZODB and SQL table. > > Is there an obvious elegant solution that I am missing? You might consider replacing the NumberOfReaders attribute with a first-class persistent object. e.g. you could use a PersistentList or IIBTree or some such. This would prevent Zope from saving the entire Article object when that one attribute changes. You'd still get some bloat from all the historical revisions of the attribute, but it would be MUCH less. e.g. something like: from ZODB import PersistentList class Article(...): def __init__(self): ... self._numberOfReaders = PersistentList([0]) def getNumberOfReaders(self): return self._numberOfReaders[0] def incrementNumberOfReaders(self): # do NOT set self._p_changed = 1 self._numberOfReaders[0] = += 1 You could then have NumberOfProperties become a ComputedAttribute to allow client code to keep accessing it as an attribute. (this is a read-only "property" in recent versions of Python, not to be confused with Zope's "properties"; but Zope doesn't support pythonic properties yet.) e.g.: NumberOfReaders= ComputedAttribute(getNumberOfReaders) But AFAIK, ComputedAttributes don't support write methods. So client code can't write "someArticle.NumberOfReaders += 1". But then, you wouldn't be able to do that with a SQL-based solution either. -- Paul Winkler http://www.slinkp.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] non-undoable storage
I have a couple hundred Articles (class instances) in my ZODB. Most instances are 200 kB, some are much larger. One of the Article properties is Number of times the article was read. Any increment causes ZODB to grow by the size of the given instance, due to the fact that ZODB will append a new version of the whole 200 kB or 2MB instance just because a single byte was changed. Consequently ZODB grows several hundred MB in a single day even if no new article is added. This calls for some form of non-undoable storage. One possibility is to move the "NumberOfReaders" attribute from ZODB to my SQL server. Not a problem, but I'm not sure what is the best way to maintain connection between ZODB instance (it can appear at different places in ZODB directory structure and it can be moved from place to place with Cut and Paste in ZMI) and SQL table. Connection means SQL key column. Instance ids cannot be used as a SQL key, because they are nonunique - each folder has a sequence of instances numbered 1...x. So there are over ten instances named "1". Instance addresses = URLs could be used but I would have to write my own methods / interfaces for moving Articles in the directory structure to maintain the connection between ZODB and SQL table. Is there an obvious elegant solution that I am missing? -- Milos Prudek ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Restart button in Control Panel
You are starting it in Debug mode, which means it will not allow for the restart button. /etc/zope.conf (edit debug mode) Also, try running it with: /bin/zopectl start & Jake -- http://www.ZopeZone.com Milos Prudek said: > Is it possible to have the "Restart" button in ZMI Control Panel? I only > have "Shutdown". What controls this? I start my Zope instance with > "instance/bin/runzope &". > > I use Zope 2.7.4. > > -- > Milos Prudek > http://www.spoxdesign.com - your web usability testing > ___ > Zope maillist - Zope@zope.org > http://mail.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://mail.zope.org/mailman/listinfo/zope-announce > http://mail.zope.org/mailman/listinfo/zope-dev ) > ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Restart button in Control Panel
Is it possible to have the "Restart" button in ZMI Control Panel? I only have "Shutdown". What controls this? I start my Zope instance with "instance/bin/runzope &". I use Zope 2.7.4. -- Milos Prudek http://www.spoxdesign.com - your web usability testing ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )