From a824ab9b33f10adcfd3fa022108507e60b7723fb Mon Sep 17 00:00:00 2001 From: Andy Boughton Date: Wed, 24 May 2017 15:26:08 -0400 Subject: [PATCH] "Every major open-source project has its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that project." [#SVCS-351] --- setup.cfg | 2 +- waterbutler/core/path.py | 5 +++-- waterbutler/core/provider.py | 20 +++++++++---------- waterbutler/providers/box/provider.py | 13 +++++------- waterbutler/providers/dropbox/provider.py | 7 +++---- waterbutler/providers/googledrive/provider.py | 10 +++++----- 6 files changed, 26 insertions(+), 31 deletions(-) diff --git a/setup.cfg b/setup.cfg index 3a08dc22f..a7a4ac7a2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ [flake8] ignore = E501,E731,E127,E128 max-line-length = 100 -exclude = .ropeproject,tests/*,src/* +exclude = .ropeproject,tests/*,src/*,env/,venv/ [mypy] # These default options are aimed at a newly converted codebase. See: diff --git a/waterbutler/core/path.py b/waterbutler/core/path.py index 58af05153..e7bec0a65 100644 --- a/waterbutler/core/path.py +++ b/waterbutler/core/path.py @@ -1,8 +1,9 @@ -import itertools import os +import itertools import typing # noqa -from waterbutler.core import exceptions, metadata +from waterbutler.core import metadata +from waterbutler.core import exceptions class WaterButlerPathPart: diff --git a/waterbutler/core/provider.py b/waterbutler/core/provider.py index c32ae32dc..b19b6ab5e 100644 --- a/waterbutler/core/provider.py +++ b/waterbutler/core/provider.py @@ -1,26 +1,24 @@ import abc -import asyncio -import functools -import itertools -import logging import time import typing +import asyncio +import logging import weakref - +import functools +import itertools from urllib import parse -import aiohttp import furl +import aiohttp -from waterbutler import settings as wb_settings - +from waterbutler.core import streams from waterbutler.core import exceptions -from waterbutler.core import metadata as wb_metadata from waterbutler.core import path as wb_path -from waterbutler.core import streams +from waterbutler import settings as wb_settings from waterbutler.core.metrics import MetricsRecord -from waterbutler.core.utils import RequestHandlerContext +from waterbutler.core import metadata as wb_metadata from waterbutler.core.utils import ZipStreamGenerator +from waterbutler.core.utils import RequestHandlerContext logger = logging.getLogger(__name__) diff --git a/waterbutler/providers/box/provider.py b/waterbutler/providers/box/provider.py index ab3a73812..2fe11a14d 100644 --- a/waterbutler/providers/box/provider.py +++ b/waterbutler/providers/box/provider.py @@ -1,16 +1,13 @@ -import aiohttp -from http import HTTPStatus -import json import os +import json import typing +import aiohttp +from http import HTTPStatus - -from waterbutler.core import exceptions -from waterbutler.core import provider from waterbutler.core import streams - +from waterbutler.core import provider +from waterbutler.core import exceptions from waterbutler.core import path as wb_path - from waterbutler.providers.box import settings from waterbutler.providers.box.metadata import (BaseBoxMetadata, BoxFileMetadata, diff --git a/waterbutler/providers/dropbox/provider.py b/waterbutler/providers/dropbox/provider.py index b8b7524ed..18b646417 100644 --- a/waterbutler/providers/dropbox/provider.py +++ b/waterbutler/providers/dropbox/provider.py @@ -1,11 +1,10 @@ -from http import HTTPStatus import json import typing +from http import HTTPStatus -from waterbutler.core import exceptions -from waterbutler.core import provider from waterbutler.core import streams - +from waterbutler.core import provider +from waterbutler.core import exceptions from waterbutler.core.path import WaterButlerPath from waterbutler.providers.dropbox import settings diff --git a/waterbutler/providers/googledrive/provider.py b/waterbutler/providers/googledrive/provider.py index 01533404c..4b51adb35 100644 --- a/waterbutler/providers/googledrive/provider.py +++ b/waterbutler/providers/googledrive/provider.py @@ -1,16 +1,16 @@ -import functools -from http import HTTPStatus -import json import os +import json import typing +import functools from urllib import parse +from http import HTTPStatus import furl +from waterbutler.core import streams +from waterbutler.core import provider from waterbutler.core import exceptions from waterbutler.core import path as wb_path -from waterbutler.core import provider -from waterbutler.core import streams from waterbutler.providers.googledrive import settings from waterbutler.providers.googledrive import utils as drive_utils