Skip to content

Commit 589a867

Browse files
committed
PEP-8
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 932bfe5 commit 589a867

File tree

11 files changed

+21
-6
lines changed

11 files changed

+21
-6
lines changed

bpython/clipboard.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
import platform
2626
from locale import getpreferredencoding
2727

28+
2829
class CopyFailed(Exception):
2930
pass
3031

32+
3133
class XClipboard(object):
3234
"""Manage clipboard with xclip."""
3335

@@ -38,6 +40,7 @@ def copy(self, content):
3840
if process.returncode != 0:
3941
raise CopyFailed()
4042

43+
4144
class OSXClipboard(object):
4245
"""Manage clipboard with pbcopy."""
4346

@@ -47,13 +50,15 @@ def copy(self, content):
4750
if process.returncode != 0:
4851
raise CopyFailed()
4952

53+
5054
def command_exists(command):
5155
process = subprocess.Popen(['which', command], stderr=subprocess.STDOUT,
5256
stdout=subprocess.PIPE)
5357
process.communicate()
5458

5559
return process.returncode == 0
5660

61+
5762
def get_clipboard():
5863
"""Get best clipboard handling implemention for current system."""
5964

bpython/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ def can_encode(c):
3030
except UnicodeEncodeError:
3131
return False
3232

33+
3334
def supports_box_chars():
3435
"""Check if the encoding suppors Unicode box characters."""
3536
return all(map(can_encode, u'│─└┘┌┐'))
3637

38+
3739
def get_config_home():
3840
"""Returns the base directory for bpython's configuration files."""
3941
xdg_config_home = os.environ.get('XDG_CONFIG_HOME', '~/.config')
4042
return os.path.join(xdg_config_home, 'bpython')
4143

44+
4245
def default_config_path():
4346
"""Returns bpython's default configuration file path."""
4447
return os.path.join(get_config_home(), 'config')

bpython/formatter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626

2727
from pygments.formatter import Formatter
2828
from pygments.token import Keyword, Name, Comment, String, Error, \
29-
Number, Operator, Token, Whitespace, Literal, Punctuation
29+
Number, Operator, Token, Whitespace, Literal, \
30+
Punctuation
3031
from six import iteritems
3132

3233
"""These format strings are pretty ugly.

bpython/inspection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):
9898
setattr(type_, '__getattr__', __getattr__)
9999
# /Dark magic
100100

101+
101102
class _Repr(object):
102103
"""
103104
Helper for `fixlongargs()`: Returns the given value in `__repr__()`.
@@ -111,6 +112,7 @@ def __repr__(self):
111112

112113
__str__ = __repr__
113114

115+
114116
def parsekeywordpairs(signature):
115117
tokens = PythonLexer().get_tokens(signature)
116118
preamble = True

bpython/keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __setitem__(self, key, value):
5454
# fill dispatch with letters
5555
for c in string.ascii_lowercase:
5656
cli_key_dispatch['C-%s' % c] = (chr(string.ascii_lowercase.index(c) + 1),
57-
'^%s' % c.upper())
57+
'^%s' % c.upper())
5858

5959
for c in string.ascii_lowercase:
6060
urwid_key_dispatch['C-%s' % c] = 'ctrl %s' % c

bpython/pager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import sys
3030
import shlex
3131

32+
3233
def get_pager_command(default='less -rf'):
3334
command = shlex.split(os.environ.get('PAGER', default))
3435
return command

bpython/test/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from bpython.translations import init
1111
from bpython._py3compat import py3
1212

13+
1314
class FixLanguageTestCase(unittest.TestCase):
1415

1516
@classmethod

bpython/test/test_args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
except ImportError:
99
import unittest
1010

11+
1112
class TestExecArgs(unittest.TestCase):
1213
def test_exec_dunder_file(self):
1314
with tempfile.NamedTemporaryFile(mode="w") as f:

bpython/test/test_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
TEST_THEME_PATH = os.path.join(os.path.dirname(__file__), "test.theme")
1313

14+
1415
class TestConfig(unittest.TestCase):
1516
def load_temp_config(self, content, struct=None):
1617
"""Write config to a temporary file and load it."""
@@ -35,7 +36,8 @@ def test_load_theme(self):
3536

3637
defaults = {"name": "c"}
3738
expected.update(defaults)
38-
config.load_theme(struct, TEST_THEME_PATH, struct.color_scheme, defaults)
39+
config.load_theme(struct, TEST_THEME_PATH, struct.color_scheme,
40+
defaults)
3941
self.assertEquals(struct.color_scheme, expected)
4042

4143
def test_keybindings_default_contains_no_duplicates(self):
@@ -90,4 +92,3 @@ def test_keybindings_unused(self):
9092
"""))
9193

9294
self.assertEqual(struct.help_key, 'F4')
93-

bpython/test/test_history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from bpython.history import History
77

8+
89
class TestHistory(unittest.TestCase):
910
def setUp(self):
1011
self.history = History('#%d' % x for x in range(1000))
@@ -74,7 +75,6 @@ def test_enter_2(self):
7475
self.assertEqual(self.history.back(), '#508')
7576
self.assertEqual(self.history.forward(), '#509')
7677

77-
7878
def test_reset(self):
7979
self.history.enter('#lastnumber!')
8080
self.history.reset()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
with open(version_file, 'w') as vf:
6868
vf.write('# Auto-generated file, do not edit!\n')
69-
vf.write('__version__=\'%s\'\n' % (version, ))
69+
vf.write('__version__ = \'%s\'\n' % (version, ))
7070

7171
class install(_install):
7272
"""Force install to run build target."""

0 commit comments

Comments
 (0)