[Zope-dev] Re: [Zope3-dev] ZScheduler
Hi Nikolay, Alan I also did some work done while and after the Rotterdam Sprint in Dez. 2002. The packages didn't get refactored since before NameGeddon and are not at all usable with a current cvs-checkout. The overall design (Interfaces, Structure) and the implementation of the Schedule/Task might be of interest, allthough one might use utitlities instead of Services to . I attached the sources of the prototype that worked with Zope3 early 2003 for refactoring or as example if anyone is interested. i'm online as [EMAIL PROTECTED]/#zope3-dev for any questions about the prototype. cheers Ulrich On Thu, 2004-04-01 at 06:29, Nikolay Kim wrote: Hi Alan, i'm author of ZopeScheduler product, lets coordinate our work ___ Zope3-dev mailing list [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope3-dev Zope3TasksPrototype.tgz Description: application/compressed-tar ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Unexpected result
Hi I try to validate a formulator object with a python script If an error was submitted the python script would acquire again the zope page template that render the formulator with the error messages My problem is than when I try to return the ZPT render Zope process the return and convert , and to the lt; gt; and amp; I try to conver these codes, change the content-type and so on but the problem persists How can I solve these question? TIA ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] RE: Zopeservice and sitecutomize
Hi, On Thu, 2004-04-01 at 04:57, Sakesun Roykiattisak wrote: Glad it work for you. Recently I've found another issue with zopeservice.py. The zopeservice.InstanceService class use win32process.TerminateProcess() to terminate Zope process, which leave no room for Zope to perform normal exit process (I've found in the source-code that Zope have to do many things before exit). I'm worried if this could put ZODB at risk. I also wonder why they choose to spawn another pythonw.exe process to start Zope rather than run Zope in the zopeservice's python interpreter. By the way, my 5 Zope instances is still working perfectly so far. And so do my Subversion services, which also terminate svn.exe process with TerminateProcess() ( I'm too lazy to do anything fancier :) ) Ok, this seems pretty windows typical. I'm using the apache batik library for my project here, and it requires a java vm running. (I use spawn for that). Whenever the Zope server goes down, the java process stays up and the lockfile for Zope remains under the control of this process. (Read: need to kill java before you can start zope again). I'm not sure if this is because of zope beeing terminated instead of shut down in a clean way. Christian -- Christian Theune, gocept gmbh co. kg http://www.gocept.com - [EMAIL PROTECTED] fon: 03496 3099112 fax: 03496 3099118 mobile: 0179 7808366 signature.asc Description: This is a digitally signed message part ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Threads, Locks, Volatility, and Angst
On Thu, 2004-04-01 at 00:25, Ian Beatty wrote: I thought Okay, no problem. I'll just make the lock variable volatile, since I don't really care whether it persists when Zope shuts down. So I renamed the lock to begin with '_v_'. That solves my UnpickleableError problem nicely. Unfortunately, it introduces a different problem: the code that calls acquire() on the lock now throws AttributeError: 'NoneType' object has no attribute 'acquire'. I'm sure I initialize that variable to a threading.Lock() in the object's __init__ method. So now I'm worried that Zope is doing all kinds of pickling-unpickling activity behind the scenes, and anything I have that's volatile can disappear without warning. I'm not sure about this right now, but iirc _v_ attributes are not stored until zope shutdown but until the object is reloaded from the ZODB (for whatever reason it went out of the cache). This basically means no availability longer than until the end of one request can be guaranteed. Christian -- Christian Theune, gocept gmbh co. kg http://www.gocept.com - [EMAIL PROTECTED] fon: 03496 3099112 fax: 03496 3099118 mobile: 0179 7808366 signature.asc Description: This is a digitally signed message part ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Re: Threads, Locks, Volatility, and Angst
Christian Theune wrote: On Thu, 2004-04-01 at 00:25, Ian Beatty wrote: I thought Okay, no problem. I'll just make the lock variable volatile, since I don't really care whether it persists when Zope shuts down. So I renamed the lock to begin with '_v_'. That solves my UnpickleableError problem nicely. Unfortunately, it introduces a different problem: the code that calls acquire() on the lock now throws AttributeError: 'NoneType' object has no attribute 'acquire'. I'm sure I initialize that variable to a threading.Lock() in the object's __init__ method. So now I'm worried that Zope is doing all kinds of pickling-unpickling activity behind the scenes, and anything I have that's volatile can disappear without warning. I'm not sure about this right now, but iirc _v_ attributes are not stored until zope shutdown but until the object is reloaded from the ZODB (for whatever reason it went out of the cache). This basically means no availability longer than until the end of one request can be guaranteed. '_v_' variablews are not stored *at all* in the ZODB; they are only useful for caching an expensive computed value. In fact, the ZODB does not even guarantee that volatile won't go away during a single request, although objects are not normally ghosted until the end of a transaction. Any use of volatiles needs careful thought. An example:; class Bar: def __init__( self ): do something really expensive here. class Foo( Persistent ): _v_bar = None def _getBar( self ): result = self._v_bar if result is None: result = self._v_bar = Bar() return result # Always use self._getBar() instead of self._v_bar. I don't think volatility is a good match for locks, which are tasked with ensuring consistency. Tres. -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation Zope Dealers http://www.zope.com ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Re: ZPT for CSS, anyone?
Shane Hathaway wrote: BTW instead of TAL, it should be called SAL, Style Attribute Language. TAL needs a sister. :-) Arg! No more languages! :'( Still, maybe a TALES-in-plain-text thing has some merits, but then you want defines, a repeats, and you end up with TAL. *grunt* still, I suppose: template= p { color: %(color)s; background-color: %(bgcolor)s; } preferences = context.getProperty('preferences',{}) dict = { 'color':preferences.get('color','gray'), 'bgcolor':preferences.get('bgcolor'white'), } return template % dict ...does the job in the correct fashion... Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Re: ZPT for CSS, anyone?
Chris Withers wrote: Shane Hathaway wrote: BTW instead of TAL, it should be called SAL, Style Attribute Language. TAL needs a sister. :-) Arg! No more languages! :'( I think it would be pretty neat. :-) Still, maybe a TALES-in-plain-text thing has some merits, but then you want defines, a repeats, and you end up with TAL. Repeats wouldn't make sense in this language. Conditions would, but they would apply to the whole rule, not individual attributes. template= p { color: %(color)s; background-color: %(bgcolor)s; } preferences = context.getProperty('preferences',{}) dict = { 'color':preferences.get('color','gray'), 'bgcolor':preferences.get('bgcolor'white'), } return template % dict That's a mess. Shane ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Unexpected result
Garito wrote: I try to validate a formulator object with a python script If an error was submitted the python script would acquire again the zope page template that render the formulator with the error messages This question is probably better suited to the [EMAIL PROTECTED] list... My problem is than when I try to return the ZPT render Zope process the return and convert , and to the lt; gt; and amp; I try to conver these codes, change the content-type and so on but the problem persists How can I solve these question? Look at the documentation for TAL, study the 'structure' keyword and apply it as appropriate ;-) Chris -- Simplistix - Content Management, Zope Python Consulting - http://www.simplistix.co.uk ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Re: [ZODB-Dev] Schema migration, rename class
Syver Enstad wrote at 2004-4-1 10:36 +0200: ... I am not really interested in changing the class. I am interested in renaming it. Are there any resources on schema evolution/migration with ZODB, I have googled quite a bit but so far haven't come up with anything other than the link above which only seems to work with pickles. Evolution is not that difficult -- unlike moving/renaming of modules/classes. I use the __module_aliases__ feature (examples e.g. in Products.PythonsScripts.__init__) to support module moving/renaming. When I need to move a class, I let a proxy at the original place. -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )