Created
May 28, 2014 22:00
-
-
Save boris-42/2b41363b22596f6fc453 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PersistanceContextManager(object): | |
def create(): | |
# prepare list_of_ctx | |
# self._create(list) | |
created_ctxt = [] | |
try: | |
for ctx in list_of_ctx: | |
created_ctxt.append(ctx) | |
ctx.setup() | |
except: | |
for ctx in reverse(created_ctx): | |
try: | |
ctx.clenaup() | |
except: | |
pass | |
raise exceptions.ContextFailedToCreate() | |
def cleanup(): | |
pass | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment