Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch45 committed Dec 15, 2014
1 parent 3fa629a commit 352e16f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sorbic/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get(self, key, id_=None, meta=False, count=None, **kwargs):
if count:
ret = []
for index_entry in entries['data']:
meta_entries = {'table': entries['table'],'data': index_entry}
meta_entries = {'table': entries['table'], 'data': index_entry}
stor_ret = self._get_storage(meta_entries, **kwargs)
if meta:
ret.append({'data': stor_ret, 'meta': index_entry})
Expand Down
6 changes: 3 additions & 3 deletions sorbic/ind/hdht.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def get_table_entry(self, key, c_key):
comps = struct.unpack(table['fmt'], bucket)
if comps[0] == '\0' * self.key_size:
comps = (None, None, -1)
except Exception:
except struct.error:
comps = (None, None, -1)
ret = self._table_map(comps, table['fmt_map'])
ret['pos'] = pos
Expand Down Expand Up @@ -298,7 +298,7 @@ def _get_table_entries(self, fn_):
comps = struct.unpack(table['fmt'], bucket)
if comps[0] == '\0' * self.key_size:
comps = (None, None, -1)
except Exception:
except struct.error:
comps = (None, None, -1)
if not comps[0]:
continue
Expand Down Expand Up @@ -371,7 +371,7 @@ def rmdir(self, d_key):

def listdir(self, d_key):
'''
Return a list of the keys
Return a list of the keys
'''
fn_root = self.root
ret = []
Expand Down
1 change: 1 addition & 0 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

# Import python libs
from __future__ import print_function
import os
import sys

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tempfile

try:
import libnacl.blake
import libnacl.blake # pylint: disable=W0611
HAS_BLAKE = True
except ImportError:
HAS_BLAKE = False
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_rand.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_rand_hex_strs(self):
Test rand hex strings
'''
rands = []
for _ in range(0,100):
for _ in range(0, 100):
r_1 = sorbic.utils.rand.rand_hex_str(24)
self.assertEqual(24, len(r_1))
rands.append(r_1)
Expand All @@ -31,7 +31,7 @@ def test_rand_raw_strs(self):
Test rand raw strings
'''
rands = []
for _ in range(0,100):
for _ in range(0, 100):
r_1 = sorbic.utils.rand.rand_raw_str(24)
self.assertEqual(24, len(r_1))
rands.append(r_1)
Expand All @@ -46,7 +46,7 @@ def test_id(self):
Test id creation
'''
rands = []
for _ in range(0,1000):
for _ in range(0, 1000):
r_1 = sorbic.utils.rand.gen_id()
rands.append(r_1)
for n_1 in range(0, 1000):
Expand All @@ -60,7 +60,7 @@ def _test_id_too_many(self):
Test way too much id creation
'''
rands = []
for _ in range(0,10000000):
for _ in range(0, 10000000):
r_1 = sorbic.utils.rand.gen_id()
rands.append(r_1)
for n_1 in range(0, 10000000):
Expand Down

0 comments on commit 352e16f

Please sign in to comment.