Make PEP8 cleanup of line spaces and character distances as well as indents

This commit is contained in:
Griatch 2017-08-19 23:16:36 +02:00
parent 7ff783fea1
commit b278337172
189 changed files with 2039 additions and 1583 deletions

View file

@ -44,7 +44,7 @@ _SCREEN_HEIGHT = settings.CLIENT_DEFAULT_HEIGHT
# text
_DISPLAY = \
"""{text}
"""{text}
(|wmore|n [{pageno}/{pagemax}] retur|wn|n|||wb|nack|||wt|nop|||we|nnd|||wq|nuit)"""
@ -82,6 +82,7 @@ class CmdMore(Command):
# return or n, next
more.page_next()
class CmdMoreLook(Command):
"""
Override look to display window and prevent OOCLook from firing
@ -89,6 +90,7 @@ class CmdMoreLook(Command):
key = "look"
aliases = ["l"]
auto_help = False
def func(self):
"""
Implement the command
@ -118,8 +120,9 @@ class EvMore(object):
"""
The main pager object
"""
def __init__(self, caller, text, always_page=False, session=None,
justify_kwargs=None, exit_on_lastpage=False, **kwargs):
justify_kwargs=None, exit_on_lastpage=False, **kwargs):
"""
Initialization of the text handler.
@ -159,8 +162,8 @@ class EvMore(object):
self._session = session
# set up individual pages for different sessions
height = max(4, session.protocol_flags.get("SCREENHEIGHT", {0:_SCREEN_HEIGHT})[0] - 4)
width = session.protocol_flags.get("SCREENWIDTH", {0:_SCREEN_WIDTH})[0]
height = max(4, session.protocol_flags.get("SCREENHEIGHT", {0: _SCREEN_HEIGHT})[0] - 4)
width = session.protocol_flags.get("SCREENWIDTH", {0: _SCREEN_WIDTH})[0]
if justify_kwargs is False:
# no justification. Simple division by line
@ -183,7 +186,7 @@ class EvMore(object):
# always limit number of chars to 10 000 per page
height = min(10000 // max(1, width), height)
self._pages = ["\n".join(lines[i:i+height]) for i in range(0, len(lines), height)]
self._pages = ["\n".join(lines[i:i + height]) for i in range(0, len(lines), height)]
self._npages = len(self._pages)
self._npos = 0
@ -246,7 +249,6 @@ class EvMore(object):
if self.exit_on_lastpage and self._pos == self._pos >= self._npages - 1:
self.page_quit()
def page_back(self):
"""
Scroll the text back up, at the most to the top.
@ -283,5 +285,4 @@ def msg(caller, text="", always_page=False, session=None, justify_kwargs=None, *
"""
EvMore(caller, text, always_page=always_page, session=session,
justify_kwargs=justify_kwargs, **kwargs)
justify_kwargs=justify_kwargs, **kwargs)