From 4cf536e7ad14e76de5bb9ffc383cf1d96a3200e0 Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Wed, 4 Feb 2015 10:40:57 -0800 Subject: [PATCH] Don't use pylint disable and update alpha PyPI info. --- gcloud/credentials.py | 6 ++++-- gcloud/datastore/_implicit_environ.py | 5 ++++- gcloud/storage/blob.py | 7 +++++-- gcloud/storage/connection.py | 7 +++++-- tox.ini | 12 ++++++------ 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/gcloud/credentials.py b/gcloud/credentials.py index 582537f324cc4..09c4bff4000bd 100644 --- a/gcloud/credentials.py +++ b/gcloud/credentials.py @@ -18,7 +18,6 @@ import calendar import datetime import six -from six.moves.urllib.parse import urlencode # pylint: disable=F0401 from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA @@ -29,6 +28,9 @@ import pytz +URLENCODE = six.moves.urllib.parse.urlencode + + def get_credentials(): """Gets credentials implicitly from the current environment. @@ -260,4 +262,4 @@ def generate_signed_url(credentials, resource, expiration, # Return the built URL. return '{endpoint}{resource}?{querystring}'.format( endpoint=api_access_endpoint, resource=resource, - querystring=urlencode(query_params)) + querystring=URLENCODE(query_params)) diff --git a/gcloud/datastore/_implicit_environ.py b/gcloud/datastore/_implicit_environ.py index 504cd4c8942d7..d3a2aa2cf5493 100644 --- a/gcloud/datastore/_implicit_environ.py +++ b/gcloud/datastore/_implicit_environ.py @@ -20,7 +20,7 @@ import socket -from six.moves.http_client import HTTPConnection # pylint: disable=F0401 +import six try: from google.appengine.api import app_identity @@ -28,6 +28,9 @@ app_identity = None +HTTPConnection = six.moves.http_client.HTTPConnection + + DATASET_ID = None """Module global to allow persistent implied dataset ID from enviroment.""" diff --git a/gcloud/storage/blob.py b/gcloud/storage/blob.py index 4528b6f2a6659..9d0a328cd5a17 100644 --- a/gcloud/storage/blob.py +++ b/gcloud/storage/blob.py @@ -20,9 +20,8 @@ import time import datetime from io import BytesIO - import six -from six.moves.urllib.parse import quote # pylint: disable=F0401 +import urllib from _gcloud_vendor.apitools.base.py import http_wrapper from _gcloud_vendor.apitools.base.py import transfer @@ -33,6 +32,10 @@ from gcloud.storage.acl import ObjectACL +try: + quote = urllib.quote +except AttributeError: # pragma: NO COVER Py3K + quote = urllib.parse.quote _API_ACCESS_ENDPOINT = 'https://storage.googleapis.com' diff --git a/gcloud/storage/connection.py b/gcloud/storage/connection.py index 666f07e6acd7e..1ef33fe7cb0af 100644 --- a/gcloud/storage/connection.py +++ b/gcloud/storage/connection.py @@ -16,7 +16,7 @@ import json -from six.moves.urllib.parse import urlencode # pylint: disable=F0401 +import six from gcloud.connection import Connection as _Base from gcloud.exceptions import make_exception @@ -25,6 +25,9 @@ from gcloud.storage.iterator import Iterator +URLENCODE = six.moves.urllib.parse.urlencode + + class Connection(_Base): """A connection to Google Cloud Storage via the JSON REST API. @@ -127,7 +130,7 @@ def build_api_url(self, path, query_params=None, api_base_url=None, query_params = query_params or {} query_params.update({'project': self.project}) - url += '?' + urlencode(query_params) + url += '?' + URLENCODE(query_params) return url diff --git a/tox.ini b/tox.ini index 32d71ee68bf7e..574c1218025ee 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ commands = deps = nose unittest2 - protobuf==3.0.0-alpha1 + protobuf==3.0.0-alpha-1 [testenv] install_command = @@ -18,7 +18,7 @@ commands = deps = nose unittest2 - protobuf==3.0.0-alpha1 + protobuf==3.0.0-alpha-1 [testenv:cover] basepython = @@ -28,7 +28,7 @@ commands = deps = nose unittest2 - protobuf==3.0.0-alpha1 + protobuf==3.0.0-alpha-1 coverage nosexcover @@ -64,7 +64,7 @@ deps = pep8 pylint unittest2 - protobuf==3.0.0-alpha1 + protobuf==3.0.0-alpha-1 [testenv:regression] basepython = @@ -73,7 +73,7 @@ commands = {toxinidir}/scripts/run_regression.sh deps = unittest2 - protobuf==3.0.0-alpha1 + protobuf==3.0.0-alpha-1 [testenv:regression3] basepython = @@ -82,4 +82,4 @@ commands = {toxinidir}/scripts/run_regression.sh deps = unittest2 - protobuf==3.0.0-alpha1 + protobuf==3.0.0-alpha-1