10000 Flake8 fixes · sharang/influxdb-python@f0f0d47 · GitHub
[go: up one dir, main page]

Skip to content

Commit f0f0d47

Browse files
committed
Flake8 fixes
1 parent 2f1b8c9 commit f0f0d47

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

influxdb/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ def grant_privilege(self, privilege, database, username):
714714
:type username: str
715715
"""
716716
text = "GRANT {0} ON {1} TO {2}".format(privilege,
717-
database,
718-
username)
717+
database,
718+
username)
719719
self.query(text)
720720

721721
def revoke_privilege(self, privilege, database, username):
@@ -730,8 +730,8 @@ def revoke_privilege(self, privilege, database, username):
730730
:type username: str
731731
"""
732732
text = "REVOKE {0} ON {1} FROM {2}".format(privilege,
733-
database,
734-
username)
733+
database,
734+
username)
735735
self.query(text)
736736

737737
def send_packet(self, packet):
@@ -862,8 +862,8 @@ def _make_func(self, orig_func):
862862
def func(*args, **kwargs):
863863
now = time.time()
864864
with self._hosts_lock:
865-
if (self.bad_hosts
866-
and self._last_healing + self.healing_delay < now):
865+
if (self.bad_hosts and
866+
self._last_healing + self.healing_delay < now):
867867
h = self.bad_hosts.pop(0)
868868
self.hosts.append(h)
869869
self._last_healing = now

influxdb/tests/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# -*- coding: utf-8 -*-
2+
23
import sys
4+
import os
35
if sys.version_info < (2, 7):
46
import unittest2 as unittest
57
else:
68
import unittest
7-
import os
89

910
using_pypy = hasattr(sys, "pypy_version_info")
1011
skipIfPYpy = unittest.skipIf(using_pypy, "Skipping this test on pypy.")

influxdb/tests/chunked_json_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# -*- coding: utf-8 -*-
22

33
import sys
4+
5+
from influxdb import chunked_json
6+
47
if sys.version_info < (2, 7):
58
import unittest2 as unittest
69
else:
710
import unittest
811

9-
from influxdb import chunked_json
10-
1112

1213
class TestChunkJson(unittest.TestCase):
1314

@@ -23,7 +24,7 @@ def test_load(self):
2324
'{"results": [{"series": [{"measurement": "sdfsdfsdf", ' \
2425
'"columns": ["time", "value"], "values": ' \
2526
'[["2009-11-10T23:00:00Z", 0.64]]}]}, {"series": ' \
26-
'[{"measurement": "cpu_load_short", "columns": ["time", "value"], ' \
27+
'[{"measurement": "cpu_load_short", "columns": ["time", "value"],'\
2728
'"values": [["2009-11-10T23:00:00Z", 0.64]]}]}]}'
2829

2930
res = list(chunked_json.loads(example_response))

influxdb/tests/server_tests/influxdb_instance.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
from influxdb.tests.misc import is_port_open, get_free_ports
1919

2020
# hack in check_output if it's not defined, like for python 2.6
21-
if "check_output" not in dir( subprocess ):
21+
if "check_output" not in dir(subprocess):
2222
def f(*popenargs, **kwargs):
2323
if 'stdout' in kwargs:
24-
raise ValueError('stdout argument not allowed, it will be overridden.')
25-
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
24+
raise ValueError(
25+
'stdout argument not allowed, it will be overridden.'
26+
)
27+
process = subprocess.Popen(stdout=subprocess.PIPE,
28+
*popenargs,
29+
**kwargs)
2630
output, unused_err = process.communicate()
2731
retcode = process.poll()
2832
if retcode:
@@ -120,8 +124,8 @@ def _start_server(self, conf_template, udp_enabled):
120124
# or you run a 286 @ 1Mhz ?
121125
try:
122126
while time.time() < timeout:
123-
if (is_port_open(self.http_port)
124-
and is_port_open(self.admin_port)):
127+
if (is_port_open(self.http_port) and
128+
is_port_open(self.admin_port)):
125129
# it's hard to check if a UDP port is open..
126130
if udp_enabled:
127131
# so let's just sleep 0.5 sec in this case

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ deps = -r{toxinidir}/requirements.txt
3232
commands = sphinx-build -b html docs/source docs/build
3333

3434
[flake8]
35-
ignore = N802,F821
35+
ignore = N802,F821,E402
36+
# E402: module level import not at top of file
3637
# N802: nosetests's setUp function
3738
# F821: False positive in intluxdb/dataframe_client.py

0 commit comments

Comments
 (0)
0