本文整理汇总了Python中globaleaks.settings.GLSettings.log_debug方法的典型用法代码示例。如果您正苦于以下问题:Python GLSettings.log_debug方法的具体用法?Python GLSettings.log_debug怎么用?Python GLSettings.log_debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类globaleaks.settings.GLSettings
的用法示例。
在下文中一共展示了GLSettings.log_debug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _wrap
# 需要导入模块: from globaleaks.settings import GLSettings [as 别名]
# 或者: from globaleaks.settings.GLSettings import log_debug [as 别名]
def _wrap(self, function, *args, **kwargs):
"""
Wrap provided function calling it inside a thread and
passing the store to it.
"""
self.store = self.get_store()
try:
if self.instance:
result = function(self.instance, self.store, *args, **kwargs)
else:
result = function(self.store, *args, **kwargs)
except exceptions.DisconnectionError as e:
transaction.abort()
# we print the exception here because we do not propagate it
GLSettings.log_debug(e)
result = None
except exceptions.IntegrityError as e:
transaction.abort()
raise DatabaseIntegrityError(str(e))
except HTTPError as excep:
transaction.abort()
raise excep
except:
transaction.abort()
self.store.close()
# propagate the exception
raise
else:
if not self.readonly:
self.store.commit()
else:
self.store.flush()
self.store.invalidate()
finally:
self.store.close()
return result