本文整理汇总了Python中helper.H.dictionary_keys方法的典型用法代码示例。如果您正苦于以下问题:Python H.dictionary_keys方法的具体用法?Python H.dictionary_keys怎么用?Python H.dictionary_keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper.H
的用法示例。
在下文中一共展示了H.dictionary_keys方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_layout
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import dictionary_keys [as 别名]
def set_layout(layout):
"""
Toggle between debug and default window layouts.
"""
# Get active window and set reference to active view
window = sublime.active_window()
previous_active = window.active_view()
# Do not set layout when disabled
if get_value(S.KEY_DISABLE_LAYOUT):
S.RESTORE_LAYOUT = window.get_layout()
set_window_value('restore_layout', S.RESTORE_LAYOUT)
S.RESTORE_INDEX = H.new_dictionary()
set_window_value('restore_index', S.RESTORE_INDEX)
return
# Show debug layout
if layout == 'debug':
debug_layout = get_value(S.KEY_DEBUG_LAYOUT, S.LAYOUT_DEBUG)
if window.get_layout() != debug_layout:
# Save current layout
S.RESTORE_LAYOUT = window.get_layout()
set_window_value('restore_layout', S.RESTORE_LAYOUT)
# Remember view indexes
S.RESTORE_INDEX = H.new_dictionary()
for view in window.views():
view_id = "%d" % view.id()
group, index = window.get_view_index(view)
S.RESTORE_INDEX[view_id] = { "group": group, "index": index }
set_window_value('restore_index', S.RESTORE_INDEX)
# Set debug layout
window.set_layout(S.LAYOUT_NORMAL)
window.set_layout(debug_layout)
# Show previous (single) layout
else:
# Get previous layout configuration
if S.RESTORE_LAYOUT is None:
S.RESTORE_LAYOUT = get_window_value('restore_layout', S.LAYOUT_NORMAL)
if S.RESTORE_INDEX is None:
S.RESTORE_INDEX = get_window_value('restore_index', {})
# Restore layout
window.set_layout(S.LAYOUT_NORMAL)
window.set_layout(S.RESTORE_LAYOUT)
for view in window.views():
view_id = "%d" % view.id()
# Set view indexes
if view_id in H.dictionary_keys(S.RESTORE_INDEX):
v = S.RESTORE_INDEX[view_id]
window.set_view_index(view, v["group"], v["index"])
# Restore focus to previous active view
if not previous_active is None:
window.focus_view(previous_active)
示例2: set_layout
# 需要导入模块: from helper import H [as 别名]
# 或者: from helper.H import dictionary_keys [as 别名]
def set_layout(layout):
"""
Toggle between debug and default window layouts.
"""
# Get active window and set reference to active view
window = sublime.active_window()
previous_active = window.active_view()
# Show debug layout
if layout == 'debug':
if window.get_layout() != S.LAYOUT_DEBUG:
# Save current layout
S.RESTORE_LAYOUT = window.get_layout()
S.set_window_value('restore_layout', S.RESTORE_LAYOUT)
# Remember view indexes
S.RESTORE_INDEX = H.new_dictionary()
for view in window.views():
view_id = "%d" % view.id()
group, index = window.get_view_index(view)
S.RESTORE_INDEX[view_id] = { "group": group, "index": index }
S.set_window_value('restore_index', S.RESTORE_INDEX)
# Set debug layout
window.set_layout(S.LAYOUT_NORMAL)
window.set_layout(S.LAYOUT_DEBUG)
# Show previous (single) layout
else:
# Get previous layout configuration
if S.RESTORE_LAYOUT is None:
S.RESTORE_LAYOUT = S.get_window_value('restore_layout', S.LAYOUT_NORMAL)
if S.RESTORE_INDEX is None:
S.RESTORE_INDEX = S.get_window_value('restore_index', {})
# Restore layout
window.set_layout(S.LAYOUT_NORMAL)
window.set_layout(S.RESTORE_LAYOUT)
for view in window.views():
view_id = "%d" % view.id()
# Set view indexes
if view_id in H.dictionary_keys(S.RESTORE_INDEX):
v = S.RESTORE_INDEX[view_id]
window.set_view_index(view, v["group"], v["index"])
# Close all debugging related windows
if view.name() == TITLE_WINDOW_BREAKPOINT or view.name() == TITLE_WINDOW_CONTEXT or view.name() == TITLE_WINDOW_STACK or view.name() == TITLE_WINDOW_WATCH:
window.focus_view(view)
window.run_command('close')
window.run_command('hide_panel', {"panel": 'output.xdebug'})
# Restore focus to previous active view
if not previous_active is None:
window.focus_view(previous_active)