本文整理汇总了Python中helper.H.is_number方法的典型用法代码示例。如果您正苦于以下问题:Python H.is_number方法的具体用法?Python H.is_number怎么用?Python H.is_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.H
的用法示例。
在下文中一共展示了H.is_number方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import is_number [as 别名]
def init(self):
if not is_connected():
return
# Connection initialization
init = S.SESSION.read()
# More detailed internal information on properties
S.SESSION.send(dbgp.FEATURE_SET, n='show_hidden', v=1)
S.SESSION.read()
# Set max children limit
max_children = get_value(S.KEY_MAX_CHILDREN)
if max_children is not False and max_children is not True and (H.is_number(max_children) or H.is_digit(max_children)):
S.SESSION.send(dbgp.FEATURE_SET, n=dbgp.FEATURE_NAME_MAX_CHILDREN, v=max_children)
S.SESSION.read()
# Set max data limit
max_data = get_value(S.KEY_MAX_DATA)
if max_data is not False and max_data is not True and (H.is_number(max_data) or H.is_digit(max_data)):
S.SESSION.send(dbgp.FEATURE_SET, n=dbgp.FEATURE_NAME_MAX_DATA, v=max_data)
S.SESSION.read()
# Set max depth limit
max_depth = get_value(S.KEY_MAX_DEPTH)
if max_depth is not False and max_depth is not True and (H.is_number(max_depth) or H.is_digit(max_depth)):
S.SESSION.send(dbgp.FEATURE_SET, n=dbgp.FEATURE_NAME_MAX_DEPTH, v=max_depth)
S.SESSION.read()
# Set breakpoints for files
for filename, breakpoint_data in S.BREAKPOINT.items():
if breakpoint_data:
for lineno, bp in breakpoint_data.items():
if bp['enabled']:
self.set_breakpoint(filename, lineno, bp['expression'])
debug('breakpoint_set: ' + filename + ':' + lineno)
# Set breakpoints for exceptions
break_on_exception = get_value(S.KEY_BREAK_ON_EXCEPTION)
if isinstance(break_on_exception, list):
for exception_name in break_on_exception:
self.set_exception(exception_name)
# Determine if client should break at first line on connect
if get_value(S.KEY_BREAK_ON_START):
# Get init attribute values
fileuri = init.get(dbgp.INIT_FILEURI)
filename = get_real_path(fileuri)
# Show debug/status output
self.status_message('Xdebug: Break on start')
info('Break on start: ' + filename)
# Store line number of breakpoint for displaying region marker
S.BREAKPOINT_ROW = {'filename': filename, 'lineno': 1}
# Focus/Open file window view
self.timeout(lambda: show_file(filename, 1))
# Context variables
context = self.get_context_values()
self.timeout(lambda: show_content(DATA_CONTEXT, context))
# Stack history
stack = self.get_stack_values()
if not stack:
stack = H.unicode_string('[{level}] {filename}.{where}:{lineno}\n'
.format(level=0, where='{main}', lineno=1, filename=fileuri))
self.timeout(lambda: show_content(DATA_STACK, stack))
# Watch expressions
self.watch_expression()
else:
# Tell script to run it's process
self.run_command('xdebug_execute', {'command': 'run'})