mirror of
https://github.com/OpenMTC/OpenMTC.git
synced 2025-02-24 10:04:55 +00:00
21 lines
376 B
Python
21 lines
376 B
Python
'''
|
|
Created on 14.07.2011
|
|
|
|
@author: kca
|
|
'''
|
|
from futile import ObjectProxy
|
|
|
|
class closing(ObjectProxy):
|
|
def __enter__(self):
|
|
return self._o
|
|
|
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
self._o.close()
|
|
|
|
|
|
class exiting(ObjectProxy):
|
|
def __enter__(self):
|
|
return self._o
|
|
|
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
self._o.__exit__(exc_type, exc_val, exc_tb) |