From f2f9452068ec3bea5564a4262e927a221ccb5bb9 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Mon, 23 Oct 2017 22:01:31 -0700 Subject: [PATCH] fix pep8 linting errors --- wakatime/compat.py | 2 +- wakatime/dependencies/templates.py | 16 ++++++++-------- wakatime/main.py | 10 +++++----- wakatime/projects/subversion.py | 1 - wakatime/session_cache.py | 3 --- wakatime/stats.py | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/wakatime/compat.py b/wakatime/compat.py index 857609f..c06a6b1 100644 --- a/wakatime/compat.py +++ b/wakatime/compat.py @@ -82,7 +82,7 @@ except ImportError: # pragma: nocover if name.startswith('.'): if not package: raise TypeError("relative imports require the 'package' " - + "argument") + "argument") level = 0 for character in name: if character != '.': diff --git a/wakatime/dependencies/templates.py b/wakatime/dependencies/templates.py index 6f449cc..422a971 100644 --- a/wakatime/dependencies/templates.py +++ b/wakatime/dependencies/templates.py @@ -20,7 +20,7 @@ KEYWORDS = [ '_', '$', 'angular', - 'assert', # probably mocha + 'assert', # probably mocha 'backbone', 'batman', 'c3', @@ -29,13 +29,13 @@ KEYWORDS = [ 'chai', 'chaplin', 'd3', - 'define', # probably require - 'describe', # mocha or jasmine + 'define', # probably require + 'describe', # mocha or jasmine 'eco', 'ember', 'espresso', - 'expect', # probably jasmine - 'exports', # probably npm + 'expect', # probably jasmine + 'exports', # probably npm 'express', 'gulp', 'handlebars', @@ -43,8 +43,8 @@ KEYWORDS = [ 'jasmine', 'jquery', 'jstz', - 'ko', # probably knockout - 'm', # probably mithril + 'ko', # probably knockout + 'm', # probably mithril 'marionette', 'meteor', 'moment', @@ -56,7 +56,7 @@ KEYWORDS = [ 'qunit', 'react', 'reactive', - 'require', # probably the commonjs spec + 'require', # probably the commonjs spec 'ripple', 'rivets', 'socketio', diff --git a/wakatime/main.py b/wakatime/main.py index 109bf7f..d33fb76 100644 --- a/wakatime/main.py +++ b/wakatime/main.py @@ -330,11 +330,11 @@ def process_heartbeat(args, configs, hostname, heartbeat): if heartbeat['entity_type'] != 'file' or os.path.isfile(heartbeat['entity']): stats = get_file_stats(heartbeat['entity'], - entity_type=heartbeat['entity_type'], - lineno=heartbeat.get('lineno'), - cursorpos=heartbeat.get('cursorpos'), - plugin=args.plugin, - language=heartbeat.get('language')) + entity_type=heartbeat['entity_type'], + lineno=heartbeat.get('lineno'), + cursorpos=heartbeat.get('cursorpos'), + plugin=args.plugin, + language=heartbeat.get('language')) project = heartbeat.get('project') or heartbeat.get('alternate_project') branch = None diff --git a/wakatime/projects/subversion.py b/wakatime/projects/subversion.py index 16935f0..3b0e32b 100644 --- a/wakatime/projects/subversion.py +++ b/wakatime/projects/subversion.py @@ -112,4 +112,3 @@ class Subversion(BaseProject): except: pass return False - diff --git a/wakatime/session_cache.py b/wakatime/session_cache.py index 686af88..7a2ff28 100644 --- a/wakatime/session_cache.py +++ b/wakatime/session_cache.py @@ -40,7 +40,6 @@ class SessionCache(object): ''') return (conn, c) - def save(self, session): """Saves a requests.Session object for the next heartbeat process. """ @@ -59,7 +58,6 @@ class SessionCache(object): except: # pragma: nocover log.traceback(logging.DEBUG) - def get(self): """Returns a requests.Session object. @@ -92,7 +90,6 @@ class SessionCache(object): return session if session is not None else requests.session() - def delete(self): """Clears all cached Session objects. """ diff --git a/wakatime/stats.py b/wakatime/stats.py index ac23ef8..9d889d4 100644 --- a/wakatime/stats.py +++ b/wakatime/stats.py @@ -102,7 +102,7 @@ def smart_guess_lexer(file_name): if lexer1: lexer = lexer1 if (lexer2 and accuracy2 and - (not accuracy1 or accuracy2 > accuracy1)): + (not accuracy1 or accuracy2 > accuracy1)): lexer = lexer2 return lexer