本文整理匯總了Python中quopri.b2a_qp方法的典型用法代碼示例。如果您正苦於以下問題:Python quopri.b2a_qp方法的具體用法?Python quopri.b2a_qp怎麽用?Python quopri.b2a_qp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類quopri
的用法示例。
在下文中一共展示了quopri.b2a_qp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: withpythonimplementation
# 需要導入模塊: import quopri [as 別名]
# 或者: from quopri import b2a_qp [as 別名]
def withpythonimplementation(testfunc):
def newtest(self):
# Test default implementation
testfunc(self)
# Test Python implementation
if quopri.b2a_qp is not None or quopri.a2b_qp is not None:
oldencode = quopri.b2a_qp
olddecode = quopri.a2b_qp
try:
quopri.b2a_qp = None
quopri.a2b_qp = None
testfunc(self)
finally:
quopri.b2a_qp = oldencode
quopri.a2b_qp = olddecode
newtest.__name__ = testfunc.__name__
return newtest