Make monasca-statsd PEP8 compatible

Following change ensures that monasca-statsd
is fully compatible to PEP8.

Change-Id: I15e1be38b62ab029675b8e0aac2784a0ff3f9f56
This commit is contained in:
Tomasz Trębski 2016-12-07 07:26:38 +01:00
parent 7780447c2a
commit d123c80f49
3 changed files with 41 additions and 12 deletions

View File

@ -1,6 +1,36 @@
from monascastatsd.client import Client
from monascastatsd.connection import Connection
from monascastatsd.counter import Counter
from monascastatsd.gauge import Gauge
from monascastatsd.metricbase import MetricBase
from monascastatsd.timer import Timer
# Copyright 2016 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from monascastatsd import client
from monascastatsd import connection
from monascastatsd import counter
from monascastatsd import gauge
from monascastatsd import metricbase
from monascastatsd import timer
Client = client.Client
Connection = connection.Connection
Counter = counter.Counter
Gauge = gauge.Gauge
MetricBase = metricbase.MetricBase
Timer = timer.Timer
__all__ = [
'Client',
'Connection',
'Counter',
'Gauge',
'MetricBase',
'Timer'
]

View File

@ -1,4 +1,5 @@
# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
# Copyright 2016 FUJITSU LIMITED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -38,12 +39,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import six
import logging
import random
import socket
from six.moves import map
logging.basicConfig()
log = logging.getLogger(__name__)
@ -115,7 +116,7 @@ class Connection(object):
payload.extend(["|#"])
payload.append(dimensions)
encoded = "".join(map(str, payload))
encoded = "".join(six.moves.map(str, payload))
self._send(encoded)
def _send_to_server(self, packet):

View File

@ -1,5 +1,5 @@
[tox]
envlist = py35,py27,pep8
envlist = py27,py35,pep8
minversion = 1.6
skipsdist = True
@ -28,5 +28,3 @@ commands = {posargs}
show-source = True
exclude=.venv,.git,.tox,dist,*egg,build
max-line-length = 120
# F401 module imported but unused
ignore = F401