Ñò
+z2Wc @ sf d Z d d k Z d d k Z d Z d „ Z d e f d „ ƒ YZ d e e f d „ ƒ YZ d Z d S(
sÀ
Transactions of attributes by inheriting the Transaction class
Basic Usage:
class Test(Transaction):
pass
a = Test()
a.test = "old state"
a.commit()
a.test = "bad state, roll me back"
a.rollback()
assert(a.test == "old state")
See also: http://www.harald-hoyer.de/linux/pythontransactionclass
Copyright (C) 2008 Harald Hoyer
Copyright (C) 2008 Red Hat, Inc.
iÿÿÿÿNi c C s# | | j o t S| i | ƒ t S( s" checks and sets the obj id in seen( t Truet addt False( t whatt seen( ( s: /usr/share/system-config-network/netconfpkg/transaction.pyt
_checksetseen+ s
t Transactionc B s2 e Z d Z d „ Z d „ Z d „ Z d „ Z RS( sn
This class allows sub-classes to commit changes to an instance to a
history, and rollback to previous states.
Because the class only stores attributes in self.__dict__ sub-classes
need to use the methods __getstate__ and __setstate__ to provide additional
state information. See the Transactionlist below for an example usage.
c K sC t i t d | i i ƒ | i d t ƒ ƒ } t t | ƒ | ƒ o d S| i d t ƒ } t
ƒ } xŸ | i i ƒ D]Ž \ } } t
| t ƒ o) | | | <| o | i d | ƒ qqt | d j o | | |