Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
retab Python scripts according to PEP8
Recent Vim sets sts=4 for Python files by default. Might as well follow it already, I guess. Use `git show -w` for this one.
- Loading branch information
Showing
46 changed files
with
5,536 additions
and
5,559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import sys | ||
|
||
def warn(*args): | ||
print("\033[1;33mwarning:\033[m", *args, file=sys.stderr) | ||
print("\033[1;33mwarning:\033[m", *args, file=sys.stderr) | ||
|
||
def err(*args): | ||
print("\033[1;31merror:\033[m", *args, file=sys.stderr) | ||
print("\033[1;31merror:\033[m", *args, file=sys.stderr) | ||
|
||
def die(*args): | ||
err(*args) | ||
sys.exit(1) | ||
err(*args) | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import sys | ||
|
||
def get(): | ||
if sys.platform == "win32": | ||
import win32clipboard as clip | ||
clip.OpenClipboard() | ||
# TODO: what type does this return? | ||
data = clip.GetClipboardData(clip.CF_UNICODETEXT) | ||
#print("clipboard.get =", repr(data)) | ||
clip.CloseClipboard() | ||
return data | ||
else: | ||
raise RuntimeError("Unsupported platform") | ||
if sys.platform == "win32": | ||
import win32clipboard as clip | ||
clip.OpenClipboard() | ||
# TODO: what type does this return? | ||
data = clip.GetClipboardData(clip.CF_UNICODETEXT) | ||
#print("clipboard.get =", repr(data)) | ||
clip.CloseClipboard() | ||
return data | ||
else: | ||
raise RuntimeError("Unsupported platform") | ||
|
||
def put(data): | ||
if sys.platform == "win32": | ||
import win32clipboard as clip | ||
clip.OpenClipboard() | ||
clip.EmptyClipboard() | ||
clip.SetClipboardText(data, clip.CF_UNICODETEXT) | ||
clip.CloseClipboard() | ||
elif sys.platform.startswith("linux"): | ||
import subprocess | ||
proc = subprocess.Popen(("xsel", "-i", "-b", "-l", "/dev/null"), | ||
stdin=subprocess.PIPE) | ||
proc.stdin.write(data.encode("utf-8")) | ||
proc.stdin.close() | ||
proc.wait() | ||
else: | ||
raise RuntimeError("Unsupported platform") | ||
if sys.platform == "win32": | ||
import win32clipboard as clip | ||
clip.OpenClipboard() | ||
clip.EmptyClipboard() | ||
clip.SetClipboardText(data, clip.CF_UNICODETEXT) | ||
clip.CloseClipboard() | ||
elif sys.platform.startswith("linux"): | ||
import subprocess | ||
proc = subprocess.Popen(("xsel", "-i", "-b", "-l", "/dev/null"), | ||
stdin=subprocess.PIPE) | ||
proc.stdin.write(data.encode("utf-8")) | ||
proc.stdin.close() | ||
proc.wait() | ||
else: | ||
raise RuntimeError("Unsupported platform") |
Oops, something went wrong.