Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
some more static analysis
  • Loading branch information
jquast committed Jan 19, 2015
1 parent f86fac5 commit 4ca7883
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions x84/default/nua.py
Expand Up @@ -122,8 +122,8 @@
])


def validate_handle(user, handle):
""" Validate setting ``handle`` for ``user``. """
def validate_handle(_, handle):
""" Validate user ``handle``. """
errmsg = None
if find_user(handle):
errmsg = u'User by this name already exists.'
Expand Down
8 changes: 4 additions & 4 deletions x84/default/ol.py
Expand Up @@ -234,7 +234,7 @@ def maybe_expunge_records():
_sorted = sorted(
((value, key) for (key, value) in contents.items()),
key=lambda _valkey: keysort_by_datetime(_valkey[0]))
for expunged, (value, key) in enumerate(
for expunged, (_, key) in enumerate(
_sorted[len(udb) - MAX_HISTORY:]):
del udb[key]
if expunged:
Expand Down Expand Up @@ -432,8 +432,8 @@ def do_prompt(term, session):
dirty = -1
top_margin = bot_margin = 0
offset = 0
quit = False
while not quit:
do_quit = False
while not do_quit:
if dirty == -1:
# re-display entire screen on-load, only. there
# should never be any need to re-draw the art here-forward.
Expand Down Expand Up @@ -497,7 +497,7 @@ def do_prompt(term, session):
dirty = 2
elif inp.lower() in (u'n', u'q'):
echo(inp + u'\r\n')
quit = True
do_quit = True
break

elif len(inp):
Expand Down
16 changes: 7 additions & 9 deletions x84/default/online.py
Expand Up @@ -48,7 +48,7 @@ def describe(sessions):
term.yellow((attrs.get('activity', u''))
if attrs.get('sid') != session.sid else
term.yellow(session.activity)),
)) for node, (_sid, attrs) in get_nodes(sessions)]))
)) for node, (_, attrs) in get_nodes(sessions)]))

return text + '\r\n'

Expand All @@ -58,11 +58,9 @@ def get_nodes(sessions):
return enumerate(sorted(sessions.items()))


def heading(sessions):
"""
Given an array of sessions, return string suitable for display heading.
"""
from x84.bbs import getterminal, ini, showart
def heading():
""" Return string suitable for display heading. """
from x84.bbs import getterminal, showart
import os
term = getterminal()
bar = ''
Expand Down Expand Up @@ -119,7 +117,7 @@ def get_node(sessions):
echo(invalid)
return (None, None)

for tgt_node, (_sid, attrs) in get_nodes(sessions):
for tgt_node, (_, attrs) in get_nodes(sessions):
if tgt_node == node:
return (tgt_node, attrs)

Expand All @@ -145,7 +143,7 @@ def chat(sessions):
"""
from x84.bbs import gosub, getsession
session = getsession()
(node, tgt_session) = get_node(sessions)
(_, tgt_session) = get_node(sessions)
if tgt_session and tgt_session != session:
gosub('chat', dial=tgt_session['handle'],
other_sid=tgt_session['sid'])
Expand Down Expand Up @@ -298,7 +296,7 @@ def broadcast_ayt(last_update):
olen = len(otxt.splitlines())
if 0 == cur_row or (cur_row + olen) >= term.height:
otxt_b = banner()
otxt_h = heading(sessions)
otxt_h = heading()
cur_row = len(otxt_b.splitlines()) + len(otxt_h.splitlines())
echo(u''.join((otxt_b, '\r\n', otxt_h, u'\r\n', otxt)))
else:
Expand Down
2 changes: 1 addition & 1 deletion x84/default/pwreset.py
Expand Up @@ -159,7 +159,7 @@ def make_match(guess, actual):
echo(term.move_up())

guess = get_garbage()
for idx in range(0, animation_length):
for _ in range(0, animation_length):
# check for screen resize
if session.poll_event('refresh'):
# remove artifacts, get new center
Expand Down
2 changes: 1 addition & 1 deletion x84/default/readmsgs.py
Expand Up @@ -413,7 +413,7 @@ def head(msg, depth=0, maxdepth=reply_depth):
msg_list.append((head(msg), idx, row_txt, subj))
msg_list.sort(reverse=True)
return [(idx, _row_txt + thread_indent(depth) + subj)
for (_threadid, depth), idx, _row_txt, subj in msg_list]
for (_, depth), idx, _row_txt, subj in msg_list]

def get_selector(mailbox, prev_sel=None):
"""
Expand Down
2 changes: 2 additions & 0 deletions x84/default/sesame.py
Expand Up @@ -133,6 +133,8 @@ def main(name):
echo(syncterm_setfont(syncterm_font))
echo(term.move_x(0) + term.clear_eol)

# pylint: disable=W0212
# Access to a protected member {_columns, _rows} of a client class
store_columns, store_rows = term._columns, term._rows
prompt_resize_term(session, term, name)

Expand Down
4 changes: 2 additions & 2 deletions x84/default/si.py
Expand Up @@ -19,7 +19,7 @@ def main():
# pylint: disable=W0633
# Attempting to unpack a non-sequence defined at line 1160 of
# platform
system, _node, release, _version, machine, _processor = platform.uname()
system, _, release, _, machine, _ = platform.uname()

body = [u'authors:',
u'Johannes Lundberg',
Expand Down Expand Up @@ -156,7 +156,7 @@ def iter_star(char, xloc, yloc):
def erase(star_idx):
""" erase old star before moving .. """
if show_star:
_char, xloc, yloc = stars[star_idx]
_, xloc, yloc = stars[star_idx]
echo(u''.join((term.move(int(yloc), int(xloc)), term.normal,
char_at_pos(int(yloc), int(xloc), txt_y, txt_x),)))

Expand Down

0 comments on commit 4ca7883

Please sign in to comment.