本文整理汇总了Python中helper.H.data_write方法的典型用法代码示例。如果您正苦于以下问题:Python H.data_write方法的具体用法?Python H.data_write怎么用?Python H.data_write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.H
的用法示例。
在下文中一共展示了H.data_write方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_write [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)
示例2: save_watch_data
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_write [as 别名]
def save_watch_data():
data_path = os.path.join(sublime.packages_path(), 'User', S.FILE_WATCH_DATA)
with open(data_path, 'wb') as data:
data.write(H.data_write(json.dumps(S.WATCH)))
示例3: save_breakpoint_data
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import data_write [as 别名]
def save_breakpoint_data():
data_path = os.path.join(sublime.packages_path(), 'User', S.FILE_BREAKPOINT_DATA)
with open(data_path, 'wb') as data:
data.write(H.data_write(json.dumps(S.BREAKPOINT)))