Skip to content

TYP: Autotyping #48191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 8, 2022
Prev Previous commit
Next Next commit
ignore vendored file
  • Loading branch information
twoertwein committed Aug 21, 2022
commit 6a1c70feb7fd2decd8aa55320f7b731fe0065b36
20 changes: 10 additions & 10 deletions pandas/io/clipboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _stringifyText(text) -> str:


def init_osx_pbcopy_clipboard():
def copy_osx_pbcopy(text) -> None:
def copy_osx_pbcopy(text):
text = _stringifyText(text) # Converts non-str values to str.
with subprocess.Popen(
["pbcopy", "w"], stdin=subprocess.PIPE, close_fds=True
Expand All @@ -125,7 +125,7 @@ def paste_osx_pbcopy():


def init_osx_pyobjc_clipboard():
def copy_osx_pyobjc(text) -> None:
def copy_osx_pyobjc(text):
"""Copy string argument to clipboard"""
text = _stringifyText(text) # Converts non-str values to str.
newStr = Foundation.NSString.stringWithString_(text).nsstring()
Expand Down Expand Up @@ -160,7 +160,7 @@ def init_qt_clipboard():
if app is None:
app = QApplication([])

def copy_qt(text) -> None:
def copy_qt(text):
text = _stringifyText(text) # Converts non-str values to str.
cb = app.clipboard()
cb.setText(text)
Expand All @@ -176,7 +176,7 @@ def init_xclip_clipboard():
DEFAULT_SELECTION = "c"
PRIMARY_SELECTION = "p"

def copy_xclip(text, primary=False) -> None:
def copy_xclip(text, primary=False):
text = _stringifyText(text) # Converts non-str values to str.
selection = DEFAULT_SELECTION
if primary:
Expand Down Expand Up @@ -207,7 +207,7 @@ def init_xsel_clipboard():
DEFAULT_SELECTION = "-b"
PRIMARY_SELECTION = "-p"

def copy_xsel(text, primary=False) -> None:
def copy_xsel(text, primary=False):
text = _stringifyText(text) # Converts non-str values to str.
selection_flag = DEFAULT_SELECTION
if primary:
Expand All @@ -231,7 +231,7 @@ def paste_xsel(primary=False):


def init_klipper_clipboard():
def copy_klipper(text) -> None:
def copy_klipper(text):
text = _stringifyText(text) # Converts non-str values to str.
with subprocess.Popen(
[
Expand Down Expand Up @@ -269,7 +269,7 @@ def paste_klipper():


def init_dev_clipboard_clipboard():
def copy_dev_clipboard(text) -> None:
def copy_dev_clipboard(text):
text = _stringifyText(text) # Converts non-str values to str.
if text == "":
warnings.warn(
Expand Down Expand Up @@ -316,7 +316,7 @@ def __call__(self, *args):
raise PyperclipWindowsException("Error calling " + self.f.__name__)
return ret

def __setattr__(self, key, value) -> None:
def __setattr__(self, key, value):
setattr(self.f, key, value)


Expand Down Expand Up @@ -439,7 +439,7 @@ def clipboard(hwnd):
finally:
safeCloseClipboard()

def copy_windows(text) -> None:
def copy_windows(text):
# This function is heavily based on
# http://msdn.com/ms649016#_win32_Copying_Information_to_the_Clipboard

Expand Down Expand Up @@ -487,7 +487,7 @@ def paste_windows():


def init_wsl_clipboard():
def copy_wsl(text) -> None:
def copy_wsl(text):
text = _stringifyText(text) # Converts non-str values to str.
with subprocess.Popen(["clip.exe"], stdin=subprocess.PIPE, close_fds=True) as p:
p.communicate(input=text.encode(ENCODING))
Expand Down