本文整理汇总了Python中sublime.get_clipboard方法的典型用法代码示例。如果您正苦于以下问题:Python sublime.get_clipboard方法的具体用法?Python sublime.get_clipboard怎么用?Python sublime.get_clipboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sublime
的用法示例。
在下文中一共展示了sublime.get_clipboard方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def run(self, edit, bracketed=False):
# Lookup the sublime buffer instance for this view
sub_buffer = SublimeBufferManager.load_from_id(self.view.id())
keypress_cb = sub_buffer.keypress_callback()
if not keypress_cb:
return
# Check if bracketed paste mode is enabled
bracketed = bracketed or sub_buffer.terminal_emulator().bracketed_paste_mode_enabled()
if bracketed:
keypress_cb("bracketed_paste_mode_start")
copied = sublime.get_clipboard()
copied = copied.replace("\r\n", "\n")
for char in copied:
if char == "\n" or char == "\r":
keypress_cb("enter")
elif char == "\t":
keypress_cb("tab")
else:
keypress_cb(char)
if bracketed:
keypress_cb("bracketed_paste_mode_end")
示例2: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def run(self, edit, bracketed=False):
view = self.view
terminal = Terminal.from_id(view.id())
if not terminal:
return
bracketed = bracketed or terminal.bracketed_paste_mode_enabled()
if bracketed:
terminal.send_key("bracketed_paste_mode_start")
copied = sublime.get_clipboard()
# self.view.run_command("terminus_render")
self.view.run_command("terminus_show_cursor")
terminal.send_string(copied)
if bracketed:
terminal.send_key("bracketed_paste_mode_end")
示例3: clear_clipboard
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def clear_clipboard(view, password):
if sublime.get_clipboard() == password:
sublime.set_clipboard('')
view.window().status_message('Network Tech: Password cleared from clipboard')
示例4: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def run(self, edit):
insert_import_command(
view=self.view,
name=sublime.get_clipboard(),
notify=True,
entry_modules=SOURCE_MODULES + NODE_MODULES,
typescript_paths=TYPESCRIPT_PATHS,
)
示例5: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def run(self):
sublime.active_window ().run_command ("copy")
sublime.set_clipboard (re.sub (r"^\s*[0-9]+.", "",
sublime.get_clipboard (), flags=re.MULTILINE))
示例6: on_post_text_command
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def on_post_text_command(self, view, name, args):
if view.settings().get('is_widget'):
return
if name == 'copy' or name == 'cut':
g_clipboard_history.push_text(sublime.get_clipboard())
示例7: on_post_text_command
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def on_post_text_command(self, view, name, args):
"""
help panel terminal to capture copied text
"""
if not view.settings().get('terminus_view'):
return
if name == 'terminus_copy':
g_clipboard_history.push_text(sublime.get_clipboard())
示例8: set_clipboard
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import get_clipboard [as 别名]
def set_clipboard(self, cmd):
if not self.thread:
self.cb = sublime.get_clipboard()
else:
self.thread.cancel()
self.thread = None
sublime.set_clipboard(cmd)