clipboard
module¶
Autogenerated docs for the clipboard¶
Let’s re-implement it as an abstract factory.
-
exception
ClipboardEmpty
[source][source]¶ Bases:
ValueError
-
class
WindowsClipboard
(_clipboard=None, *args, **kwargs)[source][source]¶ Bases:
prompt_toolkit.clipboard.base.Clipboard
Creates a prompt_toolkit compatible implementation of a _clipboard.
Notes
Requires Mark Hammond’s pywin32 extensions.
-
__init__
(_clipboard=None, *args, **kwargs)[source][source]¶ Open a _clipboard on windows with win32clipboard.OpenClipboard.
- Raises
TryNext – If win32clipboard can’t be imported.
-
win32_clipboard_get
()[source][source]¶ Get the current _clipboard’s text on Windows.
Runs
win_clip_pywin32()
and if there’s any exception attempts to run win32yank through a piped subprocess.- Returns
- Return type
Text as returned by win32clipboard.GetClipboardData or None.
-
-
tkinter_clipboard_get
()[source][source]¶ Get the _clipboard’s text using Tkinter.
This is the default on systems that are not Windows or OS X. It may interfere with other UI toolkits and should be replaced with an implementation that uses that toolkit.
Notes
Requires
tkinter
.- Raises
-
class
ClipboardMagics
(**kwargs)[source][source]¶ Bases:
IPython.core.magic.Magics
Haven’t seen it implemented in a different way than this.
-
__init__
(shell=None, *args, **kwargs)[source][source]¶ Bind the IPython instance and it’s config and parent attributes.
-
-
class
UsefulClipboard
(clipboard=None)[source][source]¶ Bases:
prompt_toolkit.clipboard.base.Clipboard
Clipboard class that can dynamically returns any Clipboard.
Uses more functionally applicable defaults and requires less boilerplate.