From bd19ee45d8ab88e4abe153a9f5395f015aeea342 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Mon, 19 Dec 2016 22:18:27 +0100 Subject: [PATCH] Stylefix for new bugbear update --- tests/test_sync.py | 2 +- tests/utils/test_vobject.py | 2 +- vdirsyncer/cli/tasks.py | 2 +- vdirsyncer/storage/dav.py | 4 ++-- vdirsyncer/storage/memory.py | 2 +- vdirsyncer/storage/remotestorage.py | 2 +- vdirsyncer/utils/vobject.py | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_sync.py b/tests/test_sync.py index 7245e2c..816bda2 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -211,7 +211,7 @@ def test_already_synced(): a.update = b.update = a.upload = b.upload = \ lambda *a, **kw: pytest.fail('Method shouldn\'t have been called.') - for i in (1, 2): + for _ in (1, 2): sync(a, b, status) assert status == old_status assert items(a) == items(b) == {item.raw} diff --git a/tests/utils/test_vobject.py b/tests/utils/test_vobject.py index 31d1018..0cc8350 100644 --- a/tests/utils/test_vobject.py +++ b/tests/utils/test_vobject.py @@ -131,7 +131,7 @@ def test_split_contacts(): bare = '\r\n'.join([VCARD_TEMPLATE.format(r=x, uid=x) for x in range(4)]) with_wrapper = 'BEGIN:VADDRESSBOOK\r\n' + bare + '\nEND:VADDRESSBOOK\r\n' - for x in (bare, with_wrapper): + for _ in (bare, with_wrapper): split = list(vobject.split_collection(bare)) assert len(split) == 4 assert vobject.join_collection(split).splitlines() == \ diff --git a/vdirsyncer/cli/tasks.py b/vdirsyncer/cli/tasks.py index 4cde106..3c8f767 100644 --- a/vdirsyncer/cli/tasks.py +++ b/vdirsyncer/cli/tasks.py @@ -38,7 +38,7 @@ def prepare_pair(wq, pair_name, collections, config, callback, **kwargs): wq.put(functools.partial(callback, collection=collection, general=config.general, **kwargs)) - for i in range(new_workers): + for _ in range(new_workers): wq.spawn_worker() diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index 65b7993..905c8d0 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -601,7 +601,7 @@ class DAVStorage(Storage): root = _parse_xml(response.content) rv = self._parse_prop_responses(root) - for href, etag, prop in rv: + for href, etag, _prop in rv: yield href, etag def get_meta(self, key): @@ -817,7 +817,7 @@ class CalDAVStorage(DAVStorage): headers=headers) root = _parse_xml(response.content) rv = self._parse_prop_responses(root) - for href, etag, prop in rv: + for href, etag, _prop in rv: yield href, etag diff --git a/vdirsyncer/storage/memory.py b/vdirsyncer/storage/memory.py index 3232d22..0d7b515 100644 --- a/vdirsyncer/storage/memory.py +++ b/vdirsyncer/storage/memory.py @@ -30,7 +30,7 @@ class MemoryStorage(Storage): return item.ident + self.fileext def list(self): - for href, (etag, item) in self.items.items(): + for href, (etag, _item) in self.items.items(): yield href, etag def get(self, href): diff --git a/vdirsyncer/storage/remotestorage.py b/vdirsyncer/storage/remotestorage.py index 1325d38..e454188 100644 --- a/vdirsyncer/storage/remotestorage.py +++ b/vdirsyncer/storage/remotestorage.py @@ -150,7 +150,7 @@ class RemoteStorage(Storage): except exceptions.NotFoundError: return - for name, info in _iter_listing(r.json()): + for name, _info in _iter_listing(r.json()): if not name.endswith('/'): continue # not a folder diff --git a/vdirsyncer/utils/vobject.py b/vdirsyncer/utils/vobject.py index 3755630..e407fa5 100644 --- a/vdirsyncer/utils/vobject.py +++ b/vdirsyncer/utils/vobject.py @@ -256,7 +256,7 @@ class _Component(object): stack = [] rv = [] try: - for i, line in enumerate(lines): + for _i, line in enumerate(lines): if line.startswith(u'BEGIN:'): c_name = line[len(u'BEGIN:'):].strip().upper() stack.append(cls(c_name, [], [])) @@ -271,7 +271,7 @@ class _Component(object): stack[-1].props.append(line) except IndexError: raise ValueError('Parsing error at line {}. Check the debug log ' - 'for more information.'.format(i + 1)) + 'for more information.'.format(_i + 1)) if multiple: return rv