diff --git a/monascastatsd/__init__.py b/monascastatsd/__init__.py index 0f4e57e..fef5a04 100644 --- a/monascastatsd/__init__.py +++ b/monascastatsd/__init__.py @@ -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' +] diff --git a/monascastatsd/connection.py b/monascastatsd/connection.py index bf9c0a7..655c767 100644 --- a/monascastatsd/connection.py +++ b/monascastatsd/connection.py @@ -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): diff --git a/tox.ini b/tox.ini index d796d26..e51b967 100644 --- a/tox.ini +++ b/tox.ini @@ -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