From 9ded289924686d5d33490309ed90153e76ce81d3 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sun, 2 Jul 2017 01:55:51 -0500 Subject: [PATCH] fixed minor pylint -E errors --- gluon/newcron.py | 6 +++--- gluon/rocket.py | 9 ++++----- gluon/sqlhtml.py | 4 +++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gluon/newcron.py b/gluon/newcron.py index f7482fcb..d422f074 100644 --- a/gluon/newcron.py +++ b/gluon/newcron.py @@ -225,8 +225,8 @@ def parsecronline(line): params = line.strip().split(None, 6) if len(params) < 7: return None - daysofweek = {'sun': 0, 'mon': 1, 'tue': 2, 'wed': 3, 'thu': 4, - 'fri': 5, 'sat': 6} + daysofweek = {'sun': 0, 'mon': 1, 'tue': 2, 'wed': 3, + 'thu': 4, 'fri': 5, 'sat': 6} for (s, id) in zip(params[:5], ['min', 'hr', 'dom', 'mon', 'dow']): if not s in [None, '*']: task[id] = [] @@ -239,7 +239,7 @@ def parsecronline(line): elif val.isdigit() or val == '-1': task[id].append(int(val)) elif id == 'dow' and val[:3].lower() in daysofweek: - task[id].append(daysofweek(val[:3].lower())) + task[id].append(daysofweek[val[:3].lower()]) task['user'] = params[5] task['cmd'] = params[6] return task diff --git a/gluon/rocket.py b/gluon/rocket.py index ba13faac..e3faf0bd 100644 --- a/gluon/rocket.py +++ b/gluon/rocket.py @@ -307,13 +307,13 @@ try: except ImportError: has_futures = False - class Future: + class Future(object): pass - class ThreadPoolExecutor: + class ThreadPoolExecutor(object): pass - class _WorkItem: + class _WorkItem(object): pass @@ -784,8 +784,7 @@ class Rocket(object): the application developer. Please update your \ applications to no longer call rocket.stop(True)" try: - import warnings - raise warnings.DeprecationWarning(msg) + raise DeprecationWarning(msg) except ImportError: raise RuntimeError(msg) diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 310e61b1..59ebbeea 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -3152,7 +3152,9 @@ class SQLFORM(FORM): # if isinstance(linked_tables, dict): # linked_tables = linked_tables.get(table._tablename, []) if linked_tables is None or referee in linked_tables: - field.represent = lambda id, r=None, referee=referee, rep=field.represent: A(callable(rep) and rep(id) or id, cid=request.cid, _href=url(args=['view', referee, id])) + field.represent = (lambda id, r=None, referee=referee, rep=field.represent: + A(callable(rep) and rep(id) or id, + cid=request.cid, _href=url(args=['view', referee, id]))) except (KeyError, ValueError, TypeError): redirect(URL(args=table._tablename)) if nargs == len(args) + 1: