[z3-five] Re: Five's bbb/transaction.py

Philipp von Weitershausen philipp at weitershausen.de
Tue Jul 19 17:37:37 CEST 2005


Tarek Ziadé wrote:
> Tarek Ziadé wrote:
> 
> 
>>Hello,
>>
>>My application under five uses zope.app.mail.delivery wich does imports
>>on z3's transactions.py
>>so I have a collision with Five's bbb/transaction.py
>>
>>Since it's just for Monkey patching and local use can we rename it or
>>change it ?
>>so oher parts of z3 transaction are available.
>>
>>Regards,
>>
>>Tarek
>> 
>>
> 
> I have changed bbb/transaction.py to bbb/transaction_patch.py
> and changed monkey.py :
> 
> ===================================================================
> --- monkey.py   (revision 14762)
> +++ monkey.py   (working copy)
> @@ -53,5 +53,9 @@
>          import Zope2
>      except ImportError:
>          import sys
> -        from Products.Five.bbb import transaction
> -        sys.modules['transaction'] = transaction
> +        import transaction
> +        from Products.Five.bbb import transaction_patch
> +        transaction.begin = transaction_patch.begin
> +        transaction.commit = transaction_patch.commit
> +        transaction.abort = transaction_patch.abort
> 
> It seems to work fine for me (didn't add any extra test within Five
> though) . Do you think this looks ok ?

To inform the rest of the world:

<tarek>	does anyone have a feedback on the mail I sent on the ML ?
<mexiKON>	tarek, just thinkng about it
<tarek>	:)
<mexiKON>	tarek, i guess your proposed solution is the most feasible one 
i can think of. just make sure you aren't forgetting to patch 
transaction.get, transaction.get_transaction
<mexiKON>	tarek, and make sure the tests pass on both zope 2.7 and zope 2.8
<tarek>	mexiKON: ok i'll do that


More information about the z3-five mailing list