From 9148578223743dc7db49b7bbee36b05ee62e6516 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sun, 21 Feb 2016 17:03:29 +0100 Subject: [PATCH] [WIP] NAS: dlc module is PEP8 compliant --- other/dlc.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/other/dlc.py b/other/dlc.py index f163d7c..f04cefd 100644 --- a/other/dlc.py +++ b/other/dlc.py @@ -69,11 +69,17 @@ def filter_list(data, attr1=None, attr2=None, attr3=None, # Nothing to filter, just return the input data return data - nc = lambda a, b: (a is None or a == b) - attrs = lambda data: (len(data) == 6 and nc(attr1, data[2]) and - nc(attr2, data[3]) and nc(attr3, data[4])) - output = filter(lambda line: attrs(line.split("\t")), - data.splitlines()) + def attrs(data): + """Filter attrs.""" + def nc(a, b): + """Filter nc.""" + return a is None or a == b + return \ + len(data) == 6 and \ + nc(attr1, data[2]) and \ + nc(attr2, data[3]) and \ + nc(attr3, data[4]) + output = filter(lambda line: attrs(line.split("\t")), data.splitlines()) if offset is not None: output = output[offset:]