本文整理汇总了Python中helper.H.base64_encode方法的典型用法代码示例。如果您正苦于以下问题:Python H.base64_encode方法的具体用法?Python H.base64_encode怎么用?Python H.base64_encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.H
的用法示例。
在下文中一共展示了H.base64_encode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import base64_encode [as 别名]
def send(self, command, *args, **kwargs):
"""
Send command to the debugger engine according to DBGp protocol.
"""
# Expression is used for conditional and watch type breakpoints
expression = None
# Seperate 'expression' from kwargs
if 'expression' in kwargs:
expression = kwargs['expression']
del kwargs['expression']
# Generate unique Transaction ID
transaction_id = self.transaction_id
# Append command/arguments to build list
build_command = [command, '-i %i' % transaction_id]
if args:
build_command.extend(args)
if kwargs:
build_command.extend(['-%s %s' % pair for pair in kwargs.items()])
# Remove leading/trailing spaces and build command string
build_command = [part.strip() for part in build_command if part.strip()]
command = ' '.join(build_command)
if expression:
command += ' -- ' + H.base64_encode(expression)
# Show debug output
debug('[Send command] %s' % command)
# Send command to debugger engine
try:
self.socket.send(H.data_write(command + '\x00'))
except:
e = sys.exc_info()[1]
raise ProtocolConnectionException(e)