| Total Complexity | 5 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from plugin.core.database.wrapper.base import APSWBaseWrapper |
||
| 18 | class APSWCursorWrapper(object): |
||
| 19 | def __init__(self, connection, cursor): |
||
| 20 | self.__connection = connection |
||
| 21 | self.__cursor = cursor |
||
| 22 | |||
| 23 | def execute(self, *args, **kwargs): |
||
| 24 | try: |
||
| 25 | return self.__cursor.execute(*args, **kwargs) |
||
| 26 | except self.__connection.critical_errors: |
||
| 27 | self.__connection.on_exception(sys.exc_info()) |
||
| 28 | |||
| 29 | def __getattr__(self, key): |
||
| 30 | if key.startswith('_APSWCursorWrapper__'): |
||
| 31 | return getattr(self, key) |
||
| 32 | |||
| 33 | return getattr(self.__cursor, key) |
||
| 34 |