From 50c93b0b65901bd60e3eba10db7daf7e9fe97735 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Fri, 16 Dec 2016 16:50:12 -0800 Subject: [PATCH 01/17] Make docs a submodule of the gh-pages branch, add docs target in main Makefile to generate docs there --- .gitignore | 29 +++++++++++++------------ .gitmodules | 4 ++++ Makefile | 10 ++++++++- docs | 1 + {docs => docsrc}/Makefile | 0 {docs => docsrc}/_templates/layout.html | 0 {docs => docsrc}/advanced.rst | 0 {docs => docsrc}/bucket.rst | 0 {docs => docsrc}/client.rst | 0 {docs => docsrc}/conf.py | 0 {docs => docsrc}/datatypes.rst | 0 {docs => docsrc}/index.rst | 0 {docs => docsrc}/make.bat | 0 {docs => docsrc}/object.rst | 0 {docs => docsrc}/query.rst | 0 {docs => docsrc}/security.rst | 0 16 files changed, 29 insertions(+), 15 deletions(-) create mode 160000 docs rename {docs => docsrc}/Makefile (100%) rename {docs => docsrc}/_templates/layout.html (100%) rename {docs => docsrc}/advanced.rst (100%) rename {docs => docsrc}/bucket.rst (100%) rename {docs => docsrc}/client.rst (100%) rename {docs => docsrc}/conf.py (100%) rename {docs => docsrc}/datatypes.rst (100%) rename {docs => docsrc}/index.rst (100%) rename {docs => docsrc}/make.bat (100%) rename {docs => docsrc}/object.rst (100%) rename {docs => docsrc}/query.rst (100%) rename {docs => docsrc}/security.rst (100%) diff --git a/.gitignore b/.gitignore index 5cc03116..8d2441d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,20 @@ -README.rst -*.pyc -.python-version -__pycache__/ -.tox/ -docs/_build -.*.swp -.coverage -riak-*/ -py-build/ +*~ +#*# +_build/ build/ +.coverage dist/ -riak.egg-info/ +docsrc/doctrees/ *.egg .eggs/ -#*# -*~ -.idea/ envs/ +.idea/ +py-build/ +*.pyc +__pycache__/ +.python-version +README.rst +riak-*/ +riak.egg-info/ +.*.swp +.tox/ diff --git a/.gitmodules b/.gitmodules index df75a761..510fba6e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,7 @@ [submodule "tools"] path = tools url = git://github.com/basho/riak-client-tools.git +[submodule "docs"] + path = docs + url = https://github.com/basho/riak-python-client.git + branch = gh-pages diff --git a/Makefile b/Makefile index 735bacfe..316389e4 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,10 @@ unexport LC_TIME PANDOC_VERSION := $(shell pandoc --version) PROTOC_VERSION := $(shell protoc --version) -PROJDIR = $(realpath $(CURDIR)) +PROJDIR := $(realpath $(CURDIR)) +DOCSRC := $(PROJDIR)/docsrc +DOCTREES := $(DOCSRC)/doctrees +DOCSDIR := $(PROJDIR)/docs PYPI_REPOSITORY ?= pypi @@ -23,6 +26,11 @@ PYPI_REPOSITORY ?= pypi lint: $(PROJDIR)/.runner lint +.PHONY: docs +docs: + sphinx-build -b html -d $(DOCTREES) $(DOCSRC) $(DOCSDIR) + @echo "The HTML pages are in $(DOCSDIR)" + .PHONY: pb_clean pb_clean: @echo "==> Python (clean)" diff --git a/docs b/docs new file mode 160000 index 00000000..f8f1ae3b --- /dev/null +++ b/docs @@ -0,0 +1 @@ +Subproject commit f8f1ae3b2b8258ed494dec9530683fe29b381cf9 diff --git a/docs/Makefile b/docsrc/Makefile similarity index 100% rename from docs/Makefile rename to docsrc/Makefile diff --git a/docs/_templates/layout.html b/docsrc/_templates/layout.html similarity index 100% rename from docs/_templates/layout.html rename to docsrc/_templates/layout.html diff --git a/docs/advanced.rst b/docsrc/advanced.rst similarity index 100% rename from docs/advanced.rst rename to docsrc/advanced.rst diff --git a/docs/bucket.rst b/docsrc/bucket.rst similarity index 100% rename from docs/bucket.rst rename to docsrc/bucket.rst diff --git a/docs/client.rst b/docsrc/client.rst similarity index 100% rename from docs/client.rst rename to docsrc/client.rst diff --git a/docs/conf.py b/docsrc/conf.py similarity index 100% rename from docs/conf.py rename to docsrc/conf.py diff --git a/docs/datatypes.rst b/docsrc/datatypes.rst similarity index 100% rename from docs/datatypes.rst rename to docsrc/datatypes.rst diff --git a/docs/index.rst b/docsrc/index.rst similarity index 100% rename from docs/index.rst rename to docsrc/index.rst diff --git a/docs/make.bat b/docsrc/make.bat similarity index 100% rename from docs/make.bat rename to docsrc/make.bat diff --git a/docs/object.rst b/docsrc/object.rst similarity index 100% rename from docs/object.rst rename to docsrc/object.rst diff --git a/docs/query.rst b/docsrc/query.rst similarity index 100% rename from docs/query.rst rename to docsrc/query.rst diff --git a/docs/security.rst b/docsrc/security.rst similarity index 100% rename from docs/security.rst rename to docsrc/security.rst From f370367f11ff46b3aba9ebce1aa8f7a5803eda8d Mon Sep 17 00:00:00 2001 From: Alex Moore Date: Sat, 17 Dec 2016 23:34:56 -0500 Subject: [PATCH 02/17] Fix ts listkeys input of either Table object or table name as string --- riak/client/operations.py | 7 +++++-- riak/tests/test_timeseries_pbuf.py | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/riak/client/operations.py b/riak/client/operations.py index bc6d4568..3bc9e06d 100644 --- a/riak/client/operations.py +++ b/riak/client/operations.py @@ -659,15 +659,18 @@ def ts_stream_keys(self, table, timeout=None): stream.close() :param table: the table from which to stream keys - :type table: Table + :type table: string or :class:`Table ` :param timeout: a timeout value in milliseconds :type timeout: int :rtype: iterator """ + t = table + if isinstance(t, six.string_types): + t = Table(self, table) _validate_timeout(timeout) resource = self._acquire() transport = resource.object - stream = transport.ts_stream_keys(table, timeout) + stream = transport.ts_stream_keys(t, timeout) stream.attach(resource) try: for keylist in stream: diff --git a/riak/tests/test_timeseries_pbuf.py b/riak/tests/test_timeseries_pbuf.py index 51257a0b..8956dd98 100644 --- a/riak/tests/test_timeseries_pbuf.py +++ b/riak/tests/test_timeseries_pbuf.py @@ -436,16 +436,25 @@ def test_stream_keys(self): table = Table(self.client, table_name) streamed_keys = [] for keylist in table.stream_keys(): - self.assertNotEqual([], keylist) - streamed_keys += keylist - for key in keylist: - self.assertIsInstance(key, list) - self.assertEqual(len(key), 3) - self.assertEqual(bytes_to_str(key[0]), 'hash1') - self.assertEqual(bytes_to_str(key[1]), 'user2') - self.assertIsInstance(key[2], datetime.datetime) + self.validate_keylist(streamed_keys, keylist) self.assertGreater(len(streamed_keys), 0) + def test_stream_keys_from_string_table(self): + streamed_keys = [] + for keylist in self.client.ts_stream_keys(table_name): + self.validate_keylist(streamed_keys, keylist) + self.assertGreater(len(streamed_keys), 0) + + def validate_keylist(self, streamed_keys, keylist): + self.assertNotEqual([], keylist) + streamed_keys += keylist + for key in keylist: + self.assertIsInstance(key, list) + self.assertEqual(len(key), 3) + self.assertEqual(bytes_to_str(key[0]), 'hash1') + self.assertEqual(bytes_to_str(key[1]), 'user2') + self.assertIsInstance(key[2], datetime.datetime) + def test_delete_single_value(self): key = ['hash1', 'user2', self.twentyFiveMinsAgo] rslt = self.client.ts_delete(table_name, key) From b403e2c86108e7e2214100f0251e455471e5f9a6 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Tue, 10 Jan 2017 11:12:33 -0800 Subject: [PATCH 03/17] Add per-file headers --- NOTICE | 2 ++ commands.py | 14 ++++++++++++++ docsrc/conf.py | 14 ++++++++++++++ riak/__init__.py | 14 ++++++++++++++ riak/benchmark.py | 14 ++++++++++++++ riak/benchmarks/multiget.py | 14 ++++++++++++++ riak/benchmarks/timeseries.py | 14 ++++++++++++++ riak/bucket.py | 14 ++++++++++++++ riak/client/__init__.py | 14 ++++++++++++++ riak/client/index_page.py | 14 ++++++++++++++ riak/client/multi.py | 14 ++++++++++++++ riak/client/operations.py | 14 ++++++++++++++ riak/client/transport.py | 14 ++++++++++++++ riak/codecs/__init__.py | 14 ++++++++++++++ riak/codecs/http.py | 14 ++++++++++++++ riak/codecs/pbuf.py | 14 ++++++++++++++ riak/codecs/ttb.py | 14 ++++++++++++++ riak/codecs/util.py | 14 ++++++++++++++ riak/content.py | 14 ++++++++++++++ riak/datatypes/__init__.py | 14 ++++++++++++++ riak/datatypes/counter.py | 14 ++++++++++++++ riak/datatypes/datatype.py | 14 ++++++++++++++ riak/datatypes/errors.py | 14 ++++++++++++++ riak/datatypes/flag.py | 14 ++++++++++++++ riak/datatypes/hll.py | 14 ++++++++++++++ riak/datatypes/map.py | 14 ++++++++++++++ riak/datatypes/register.py | 14 ++++++++++++++ riak/datatypes/set.py | 14 ++++++++++++++ riak/datatypes/types.py | 14 ++++++++++++++ riak/mapreduce.py | 14 ++++++++++++++ riak/multidict.py | 14 ++++++++++++++ riak/node.py | 14 ++++++++++++++ riak/pb/__init__.py | 14 ++++++++++++++ riak/pb/messages.py | 14 ++++++++++++++ riak/pb/riak_dt_pb2.py | 14 ++++++++++++++ riak/pb/riak_kv_pb2.py | 14 ++++++++++++++ riak/pb/riak_pb2.py | 14 ++++++++++++++ riak/pb/riak_search_pb2.py | 14 ++++++++++++++ riak/pb/riak_ts_pb2.py | 14 ++++++++++++++ riak/pb/riak_yokozuna_pb2.py | 14 ++++++++++++++ riak/resolver.py | 14 ++++++++++++++ riak/riak_error.py | 14 ++++++++++++++ riak/riak_object.py | 14 ++++++++++++++ riak/security.py | 14 ++++++++++++++ riak/table.py | 14 ++++++++++++++ riak/test_server.py | 14 ++++++++++++++ riak/tests/__init__.py | 14 ++++++++++++++ riak/tests/base.py | 14 ++++++++++++++ riak/tests/comparison.py | 14 ++++++++++++++ riak/tests/suite.py | 14 ++++++++++++++ riak/tests/test_2i.py | 14 ++++++++++++++ riak/tests/test_btypes.py | 14 ++++++++++++++ riak/tests/test_client.py | 14 ++++++++++++++ riak/tests/test_comparison.py | 14 ++++++++++++++ riak/tests/test_datatypes.py | 14 ++++++++++++++ riak/tests/test_datetime.py | 14 ++++++++++++++ riak/tests/test_feature_detection.py | 14 ++++++++++++++ riak/tests/test_filters.py | 14 ++++++++++++++ riak/tests/test_kv.py | 14 ++++++++++++++ riak/tests/test_mapreduce.py | 14 ++++++++++++++ riak/tests/test_misc.py | 14 ++++++++++++++ riak/tests/test_pool.py | 14 ++++++++++++++ riak/tests/test_search.py | 14 ++++++++++++++ riak/tests/test_security.py | 14 ++++++++++++++ riak/tests/test_server_test.py | 14 ++++++++++++++ riak/tests/test_timeseries_pbuf.py | 14 ++++++++++++++ riak/tests/test_timeseries_ttb.py | 14 ++++++++++++++ riak/tests/test_util.py | 14 ++++++++++++++ riak/tests/test_yokozuna.py | 14 ++++++++++++++ riak/tests/yz_setup.py | 14 ++++++++++++++ riak/transports/__init__.py | 13 +++++++++++++ riak/transports/feature_detect.py | 14 ++++++++++++++ riak/transports/http/__init__.py | 14 ++++++++++++++ riak/transports/http/connection.py | 14 ++++++++++++++ riak/transports/http/resources.py | 14 ++++++++++++++ riak/transports/http/search.py | 15 +++++++++++++++ riak/transports/http/stream.py | 14 ++++++++++++++ riak/transports/http/transport.py | 14 ++++++++++++++ riak/transports/pool.py | 14 ++++++++++++++ riak/transports/security.py | 14 ++++++++++++++ riak/transports/tcp/__init__.py | 14 ++++++++++++++ riak/transports/tcp/connection.py | 14 ++++++++++++++ riak/transports/tcp/stream.py | 14 ++++++++++++++ riak/transports/tcp/transport.py | 14 ++++++++++++++ riak/transports/transport.py | 14 ++++++++++++++ riak/ts_object.py | 14 ++++++++++++++ riak/tz.py | 14 ++++++++++++++ riak/util.py | 14 ++++++++++++++ version.py | 14 +++++++++++++- 89 files changed, 1233 insertions(+), 1 deletion(-) create mode 100644 NOTICE diff --git a/NOTICE b/NOTICE new file mode 100644 index 00000000..37c556ce --- /dev/null +++ b/NOTICE @@ -0,0 +1,2 @@ +Riak Python Client +Copyright 2010-present Basho Technologies, Inc. diff --git a/commands.py b/commands.py index 3d1e13c0..a20557ab 100644 --- a/commands.py +++ b/commands.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import csv import os import os.path diff --git a/docsrc/conf.py b/docsrc/conf.py index 57d39b2e..7b5cb000 100644 --- a/docsrc/conf.py +++ b/docsrc/conf.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- # # Riak (Python binding) documentation build configuration file, created by diff --git a/riak/__init__.py b/riak/__init__.py index 9e761a91..de68354a 100644 --- a/riak/__init__.py +++ b/riak/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ The Riak API for Python allows you to connect to a Riak instance, create, modify, and delete Riak objects, add and remove links from diff --git a/riak/benchmark.py b/riak/benchmark.py index cfb220c1..e1f3e55c 100644 --- a/riak/benchmark.py +++ b/riak/benchmark.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 __future__ import print_function import os diff --git a/riak/benchmarks/multiget.py b/riak/benchmarks/multiget.py index 22c01c8b..87a97a6a 100644 --- a/riak/benchmarks/multiget.py +++ b/riak/benchmarks/multiget.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import binascii import os diff --git a/riak/benchmarks/timeseries.py b/riak/benchmarks/timeseries.py index 84960962..5d0f89c3 100644 --- a/riak/benchmarks/timeseries.py +++ b/riak/benchmarks/timeseries.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import datetime import random import sys diff --git a/riak/bucket.py b/riak/bucket.py index 70340f08..3379fa8e 100644 --- a/riak/bucket.py +++ b/riak/bucket.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2010 Rusty Klophaus Copyright 2010 Justin Sheehy diff --git a/riak/client/__init__.py b/riak/client/__init__.py index f7e61446..ac33f8f2 100644 --- a/riak/client/__init__.py +++ b/riak/client/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + try: import simplejson as json except ImportError: diff --git a/riak/client/index_page.py b/riak/client/index_page.py index 3d273e4b..9014d6c4 100644 --- a/riak/client/index_page.py +++ b/riak/client/index_page.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2013 Basho Technologies, Inc. diff --git a/riak/client/multi.py b/riak/client/multi.py index b7a1e11a..681d3ec3 100644 --- a/riak/client/multi.py +++ b/riak/client/multi.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 __future__ import print_function from collections import namedtuple from threading import Thread, Lock, Event diff --git a/riak/client/operations.py b/riak/client/operations.py index 3bc9e06d..1acf06e1 100644 --- a/riak/client/operations.py +++ b/riak/client/operations.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import six import riak.client.multi diff --git a/riak/client/transport.py b/riak/client/transport.py index 4010f165..ffc705e4 100644 --- a/riak/client/transport.py +++ b/riak/client/transport.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 contextlib import contextmanager from riak.transports.pool import BadResource, ConnectionClosed from riak.transports.tcp import is_retryable as is_tcp_retryable diff --git a/riak/codecs/__init__.py b/riak/codecs/__init__.py index b155bdff..00324f14 100644 --- a/riak/codecs/__init__.py +++ b/riak/codecs/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import collections import riak.pb.messages diff --git a/riak/codecs/http.py b/riak/codecs/http.py index 84fed2a7..bfc91f2c 100644 --- a/riak/codecs/http.py +++ b/riak/codecs/http.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import re import csv import six diff --git a/riak/codecs/pbuf.py b/riak/codecs/pbuf.py index 9a21aaa5..fe34ee15 100644 --- a/riak/codecs/pbuf.py +++ b/riak/codecs/pbuf.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import datetime import six diff --git a/riak/codecs/ttb.py b/riak/codecs/ttb.py index 5cec7038..70a8b6fc 100644 --- a/riak/codecs/ttb.py +++ b/riak/codecs/ttb.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import datetime import six diff --git a/riak/codecs/util.py b/riak/codecs/util.py index 52aecb9f..1fa492bb 100644 --- a/riak/codecs/util.py +++ b/riak/codecs/util.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import riak.pb.messages diff --git a/riak/content.py b/riak/content.py index 6b3f080d..87b35594 100644 --- a/riak/content.py +++ b/riak/content.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2013 Basho Technologies, Inc. diff --git a/riak/datatypes/__init__.py b/riak/datatypes/__init__.py index 90d114e9..87062a74 100644 --- a/riak/datatypes/__init__.py +++ b/riak/datatypes/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/datatypes/counter.py b/riak/datatypes/counter.py index 33c69f81..d8c8fd24 100644 --- a/riak/datatypes/counter.py +++ b/riak/datatypes/counter.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import six from riak.datatypes.datatype import Datatype diff --git a/riak/datatypes/datatype.py b/riak/datatypes/datatype.py index 192b815e..bad20d2c 100644 --- a/riak/datatypes/datatype.py +++ b/riak/datatypes/datatype.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/datatypes/errors.py b/riak/datatypes/errors.py index 71353f8f..16be5589 100644 --- a/riak/datatypes/errors.py +++ b/riak/datatypes/errors.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 riak import RiakError diff --git a/riak/datatypes/flag.py b/riak/datatypes/flag.py index 494dd799..3ce78c81 100644 --- a/riak/datatypes/flag.py +++ b/riak/datatypes/flag.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/datatypes/hll.py b/riak/datatypes/hll.py index 16d006f0..1d962731 100644 --- a/riak/datatypes/hll.py +++ b/riak/datatypes/hll.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import six from .datatype import Datatype diff --git a/riak/datatypes/map.py b/riak/datatypes/map.py index a2bbdf2b..31d6aa22 100644 --- a/riak/datatypes/map.py +++ b/riak/datatypes/map.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/datatypes/register.py b/riak/datatypes/register.py index 1d6813b8..c8402743 100644 --- a/riak/datatypes/register.py +++ b/riak/datatypes/register.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/datatypes/set.py b/riak/datatypes/set.py index e0797ab8..19829cf3 100644 --- a/riak/datatypes/set.py +++ b/riak/datatypes/set.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import collections from .datatype import Datatype diff --git a/riak/datatypes/types.py b/riak/datatypes/types.py index f349de25..79b969fb 100644 --- a/riak/datatypes/types.py +++ b/riak/datatypes/types.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/mapreduce.py b/riak/mapreduce.py index fe8cd6e4..5e4e6cfc 100644 --- a/riak/mapreduce.py +++ b/riak/mapreduce.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2010 Rusty Klophaus Copyright 2010 Justin Sheehy diff --git a/riak/multidict.py b/riak/multidict.py index b13a65b2..0df28f80 100644 --- a/riak/multidict.py +++ b/riak/multidict.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # (c) 2005 Ian Bicking and contributors; written for Paste # (http://pythonpaste.org) Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php diff --git a/riak/node.py b/riak/node.py index 9a999ece..eecffe69 100644 --- a/riak/node.py +++ b/riak/node.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import math import time diff --git a/riak/pb/__init__.py b/riak/pb/__init__.py index e69de29b..9b867bc5 100644 --- a/riak/pb/__init__.py +++ b/riak/pb/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + diff --git a/riak/pb/messages.py b/riak/pb/messages.py index 76c25e82..b8f1e91e 100644 --- a/riak/pb/messages.py +++ b/riak/pb/messages.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # This is a generated file. DO NOT EDIT. """ diff --git a/riak/pb/riak_dt_pb2.py b/riak/pb/riak_dt_pb2.py index 1b640499..ba9a590d 100644 --- a/riak/pb/riak_dt_pb2.py +++ b/riak/pb/riak_dt_pb2.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_dt.proto diff --git a/riak/pb/riak_kv_pb2.py b/riak/pb/riak_kv_pb2.py index 09797052..f1832df6 100644 --- a/riak/pb/riak_kv_pb2.py +++ b/riak/pb/riak_kv_pb2.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_kv.proto diff --git a/riak/pb/riak_pb2.py b/riak/pb/riak_pb2.py index 8f4ac076..72dba122 100644 --- a/riak/pb/riak_pb2.py +++ b/riak/pb/riak_pb2.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak.proto diff --git a/riak/pb/riak_search_pb2.py b/riak/pb/riak_search_pb2.py index 788b7cda..b20adbfc 100644 --- a/riak/pb/riak_search_pb2.py +++ b/riak/pb/riak_search_pb2.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_search.proto diff --git a/riak/pb/riak_ts_pb2.py b/riak/pb/riak_ts_pb2.py index 13a06a14..5033db67 100644 --- a/riak/pb/riak_ts_pb2.py +++ b/riak/pb/riak_ts_pb2.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_ts.proto diff --git a/riak/pb/riak_yokozuna_pb2.py b/riak/pb/riak_yokozuna_pb2.py index 1673f538..6cc20395 100644 --- a/riak/pb/riak_yokozuna_pb2.py +++ b/riak/pb/riak_yokozuna_pb2.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_yokozuna.proto diff --git a/riak/resolver.py b/riak/resolver.py index d56ae5f5..260740d6 100644 --- a/riak/resolver.py +++ b/riak/resolver.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2013 Basho Technologies, Inc. diff --git a/riak/riak_error.py b/riak/riak_error.py index b99eb7fe..ec70d54f 100644 --- a/riak/riak_error.py +++ b/riak/riak_error.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/riak_object.py b/riak/riak_object.py index 7657e2a4..ab9650ca 100644 --- a/riak/riak_object.py +++ b/riak/riak_object.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 riak import ConflictError from riak.content import RiakContent import base64 diff --git a/riak/security.py b/riak/security.py index d6adee91..d4dfdd1a 100644 --- a/riak/security.py +++ b/riak/security.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2014 Basho Technologies, Inc. diff --git a/riak/table.py b/riak/table.py index d026bf18..d4006503 100644 --- a/riak/table.py +++ b/riak/table.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 six import string_types, PY2 diff --git a/riak/test_server.py b/riak/test_server.py index 545f7e5e..99d68742 100644 --- a/riak/test_server.py +++ b/riak/test_server.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 __future__ import print_function import os.path import threading diff --git a/riak/tests/__init__.py b/riak/tests/__init__.py index 65aef57a..be547be6 100644 --- a/riak/tests/__init__.py +++ b/riak/tests/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import logging import os import socket diff --git a/riak/tests/base.py b/riak/tests/base.py index b2891b54..aa81c0da 100644 --- a/riak/tests/base.py +++ b/riak/tests/base.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import logging import random diff --git a/riak/tests/comparison.py b/riak/tests/comparison.py index 30cde091..aa1d21cc 100644 --- a/riak/tests/comparison.py +++ b/riak/tests/comparison.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- from six import PY2, PY3 import collections diff --git a/riak/tests/suite.py b/riak/tests/suite.py index e317213a..782be4a0 100644 --- a/riak/tests/suite.py +++ b/riak/tests/suite.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import os.path import unittest diff --git a/riak/tests/test_2i.py b/riak/tests/test_2i.py index 6db10602..01f02aee 100644 --- a/riak/tests/test_2i.py +++ b/riak/tests/test_2i.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest diff --git a/riak/tests/test_btypes.py b/riak/tests/test_btypes.py index ea427c4b..67cd6568 100644 --- a/riak/tests/test_btypes.py +++ b/riak/tests/test_btypes.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import unittest from riak import RiakError, RiakObject diff --git a/riak/tests/test_client.py b/riak/tests/test_client.py index fa506c29..001520d2 100644 --- a/riak/tests/test_client.py +++ b/riak/tests/test_client.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import unittest from six import PY2 diff --git a/riak/tests/test_comparison.py b/riak/tests/test_comparison.py index b73d4bf5..8aac4ef8 100644 --- a/riak/tests/test_comparison.py +++ b/riak/tests/test_comparison.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest diff --git a/riak/tests/test_datatypes.py b/riak/tests/test_datatypes.py index 2642837c..17aa4bf2 100644 --- a/riak/tests/test_datatypes.py +++ b/riak/tests/test_datatypes.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest import riak.datatypes as datatypes diff --git a/riak/tests/test_datetime.py b/riak/tests/test_datetime.py index a3640105..f3367179 100644 --- a/riak/tests/test_datetime.py +++ b/riak/tests/test_datetime.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import datetime import unittest diff --git a/riak/tests/test_feature_detection.py b/riak/tests/test_feature_detection.py index b0ac63a6..bf0c0c7b 100644 --- a/riak/tests/test_feature_detection.py +++ b/riak/tests/test_feature_detection.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest diff --git a/riak/tests/test_filters.py b/riak/tests/test_filters.py index e41eea6c..f4a77db0 100644 --- a/riak/tests/test_filters.py +++ b/riak/tests/test_filters.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index 7db30a08..f8ffb76a 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import copy import os diff --git a/riak/tests/test_mapreduce.py b/riak/tests/test_mapreduce.py index 4b531368..5f5c5ed0 100644 --- a/riak/tests/test_mapreduce.py +++ b/riak/tests/test_mapreduce.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- from __future__ import print_function diff --git a/riak/tests/test_misc.py b/riak/tests/test_misc.py index 15605114..3660720e 100644 --- a/riak/tests/test_misc.py +++ b/riak/tests/test_misc.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import unittest diff --git a/riak/tests/test_pool.py b/riak/tests/test_pool.py index 3825c23c..346b2645 100644 --- a/riak/tests/test_pool.py +++ b/riak/tests/test_pool.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest diff --git a/riak/tests/test_search.py b/riak/tests/test_search.py index 17e2ea6a..efc5aa65 100644 --- a/riak/tests/test_search.py +++ b/riak/tests/test_search.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- from __future__ import print_function diff --git a/riak/tests/test_security.py b/riak/tests/test_security.py index 8a3db8f7..d9e1ee10 100644 --- a/riak/tests/test_security.py +++ b/riak/tests/test_security.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import sys import unittest diff --git a/riak/tests/test_server_test.py b/riak/tests/test_server_test.py index 45dcbd55..2b5cfc48 100644 --- a/riak/tests/test_server_test.py +++ b/riak/tests/test_server_test.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import sys import unittest diff --git a/riak/tests/test_timeseries_pbuf.py b/riak/tests/test_timeseries_pbuf.py index 8956dd98..862911c2 100644 --- a/riak/tests/test_timeseries_pbuf.py +++ b/riak/tests/test_timeseries_pbuf.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import datetime import six diff --git a/riak/tests/test_timeseries_ttb.py b/riak/tests/test_timeseries_ttb.py index 765eba67..985ae3c5 100644 --- a/riak/tests/test_timeseries_ttb.py +++ b/riak/tests/test_timeseries_ttb.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import datetime import logging diff --git a/riak/tests/test_util.py b/riak/tests/test_util.py index f3415557..766c82fa 100644 --- a/riak/tests/test_util.py +++ b/riak/tests/test_util.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import datetime import unittest diff --git a/riak/tests/test_yokozuna.py b/riak/tests/test_yokozuna.py index 5d1adf53..08a891e6 100644 --- a/riak/tests/test_yokozuna.py +++ b/riak/tests/test_yokozuna.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + # -*- coding: utf-8 -*- import unittest diff --git a/riak/tests/yz_setup.py b/riak/tests/yz_setup.py index 668e2ba8..78c44755 100644 --- a/riak/tests/yz_setup.py +++ b/riak/tests/yz_setup.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import logging from riak import RiakError diff --git a/riak/transports/__init__.py b/riak/transports/__init__.py index e69de29b..056d414e 100644 --- a/riak/transports/__init__.py +++ b/riak/transports/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. diff --git a/riak/transports/feature_detect.py b/riak/transports/feature_detect.py index 87e30fbf..a133655e 100644 --- a/riak/transports/feature_detect.py +++ b/riak/transports/feature_detect.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 distutils.version import LooseVersion from riak.util import lazy_property diff --git a/riak/transports/http/__init__.py b/riak/transports/http/__init__.py index 69c7de8c..68797b7b 100644 --- a/riak/transports/http/__init__.py +++ b/riak/transports/http/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import socket import select diff --git a/riak/transports/http/connection.py b/riak/transports/http/connection.py index c6b3b9c5..d1c16281 100644 --- a/riak/transports/http/connection.py +++ b/riak/transports/http/connection.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import base64 from six import PY2 diff --git a/riak/transports/http/resources.py b/riak/transports/http/resources.py index 2017f420..2b53ae7c 100644 --- a/riak/transports/http/resources.py +++ b/riak/transports/http/resources.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import re from six import PY2 diff --git a/riak/transports/http/search.py b/riak/transports/http/search.py index 4e6c69e6..d43688f6 100644 --- a/riak/transports/http/search.py +++ b/riak/transports/http/search.py @@ -1,3 +1,18 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + + class XMLSearchResult(object): # Match tags that are document fields fieldtags = ['str', 'int', 'date'] diff --git a/riak/transports/http/stream.py b/riak/transports/http/stream.py index b5ec00d7..590565f2 100644 --- a/riak/transports/http/stream.py +++ b/riak/transports/http/stream.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import json import re diff --git a/riak/transports/http/transport.py b/riak/transports/http/transport.py index c2d7c6dc..7cba2681 100644 --- a/riak/transports/http/transport.py +++ b/riak/transports/http/transport.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + try: import simplejson as json except ImportError: diff --git a/riak/transports/pool.py b/riak/transports/pool.py index 63b9aa2d..38a87b43 100644 --- a/riak/transports/pool.py +++ b/riak/transports/pool.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 __future__ import print_function import threading diff --git a/riak/transports/security.py b/riak/transports/security.py index a2ac46d5..d7828b72 100644 --- a/riak/transports/security.py +++ b/riak/transports/security.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + """ Copyright 2015 Basho Technologies, Inc. diff --git a/riak/transports/tcp/__init__.py b/riak/transports/tcp/__init__.py index 32b0dbee..d58add2e 100644 --- a/riak/transports/tcp/__init__.py +++ b/riak/transports/tcp/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import errno import socket diff --git a/riak/transports/tcp/connection.py b/riak/transports/tcp/connection.py index 949999d3..13c02cf4 100644 --- a/riak/transports/tcp/connection.py +++ b/riak/transports/tcp/connection.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import errno import logging import socket diff --git a/riak/transports/tcp/stream.py b/riak/transports/tcp/stream.py index c73778bf..95436825 100644 --- a/riak/transports/tcp/stream.py +++ b/riak/transports/tcp/stream.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import json import riak.pb.messages diff --git a/riak/transports/tcp/transport.py b/riak/transports/tcp/transport.py index 39c0b456..5d3a1599 100644 --- a/riak/transports/tcp/transport.py +++ b/riak/transports/tcp/transport.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import six import riak.pb.messages diff --git a/riak/transports/transport.py b/riak/transports/transport.py index ba413865..258d24e8 100644 --- a/riak/transports/transport.py +++ b/riak/transports/transport.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import base64 import random import threading diff --git a/riak/ts_object.py b/riak/ts_object.py index 24eccbe1..2c7fddf5 100644 --- a/riak/ts_object.py +++ b/riak/ts_object.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. + import collections from riak import RiakError diff --git a/riak/tz.py b/riak/tz.py index b20054ee..fc44e32d 100644 --- a/riak/tz.py +++ b/riak/tz.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 datetime import tzinfo, timedelta ZERO = timedelta(0) diff --git a/riak/util.py b/riak/util.py index e3124612..9101275b 100644 --- a/riak/util.py +++ b/riak/util.py @@ -1,3 +1,17 @@ +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 __future__ import print_function import datetime diff --git a/version.py b/version.py index 6c802c58..ca6a019c 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,16 @@ -# This program is placed into the public domain. +# Copyright 2010-present Basho Technologies, Inc. +# +# 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. """ Gets the current version number. From f78cc64221e6a1dae475cc211fc036bf0b010902 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Tue, 10 Jan 2017 13:28:02 -0800 Subject: [PATCH 04/17] fix py2 --- riak/tests/test_kv.py | 2 +- riak/tests/test_mapreduce.py | 2 +- riak/tests/test_timeseries_pbuf.py | 2 +- riak/tests/test_timeseries_ttb.py | 2 +- riak/tests/test_yokozuna.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index f8ffb76a..56f55844 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import copy import os import sys diff --git a/riak/tests/test_mapreduce.py b/riak/tests/test_mapreduce.py index 5f5c5ed0..f8b90e98 100644 --- a/riak/tests/test_mapreduce.py +++ b/riak/tests/test_mapreduce.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- from __future__ import print_function import unittest diff --git a/riak/tests/test_timeseries_pbuf.py b/riak/tests/test_timeseries_pbuf.py index 862911c2..8cffa1c7 100644 --- a/riak/tests/test_timeseries_pbuf.py +++ b/riak/tests/test_timeseries_pbuf.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import datetime import six import unittest diff --git a/riak/tests/test_timeseries_ttb.py b/riak/tests/test_timeseries_ttb.py index 985ae3c5..d2434799 100644 --- a/riak/tests/test_timeseries_ttb.py +++ b/riak/tests/test_timeseries_ttb.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import datetime import logging import six diff --git a/riak/tests/test_yokozuna.py b/riak/tests/test_yokozuna.py index 08a891e6..a1823774 100644 --- a/riak/tests/test_yokozuna.py +++ b/riak/tests/test_yokozuna.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest from riak.tests import RUN_YZ From c096c4e573e1dc084ada42fb2a5ab74e01a01ca4 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Tue, 10 Jan 2017 14:54:48 -0800 Subject: [PATCH 05/17] clean up headers --- riak/bucket.py | 22 +++------------------- riak/client/index_page.py | 18 ------------------ riak/content.py | 17 ----------------- riak/datatypes/__init__.py | 18 ------------------ riak/datatypes/datatype.py | 19 ------------------- riak/datatypes/flag.py | 18 ------------------ riak/datatypes/map.py | 18 ------------------ riak/datatypes/register.py | 18 ------------------ riak/datatypes/types.py | 18 ------------------ riak/mapreduce.py | 23 +++-------------------- riak/resolver.py | 18 ------------------ riak/riak_error.py | 18 ------------------ riak/security.py | 18 ------------------ riak/tests/pool-grinder.py | 30 +++++++++++++----------------- riak/transports/security.py | 18 ------------------ 15 files changed, 19 insertions(+), 272 deletions(-) diff --git a/riak/bucket.py b/riak/bucket.py index 3379fa8e..7dde7351 100644 --- a/riak/bucket.py +++ b/riak/bucket.py @@ -1,3 +1,6 @@ +# Copyright 2010 Rusty Klophaus +# Copyright 2010 Justin Sheehy +# Copyright 2009 Jay Baird # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,25 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2010 Rusty Klophaus -Copyright 2010 Justin Sheehy -Copyright 2009 Jay Baird - -This file is provided to you 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 six import string_types, PY2 import mimetypes from riak.util import lazy_property diff --git a/riak/client/index_page.py b/riak/client/index_page.py index 9014d6c4..8e094a66 100644 --- a/riak/client/index_page.py +++ b/riak/client/index_page.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2013 Basho Technologies, Inc. - -This file is provided to you 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 collections import namedtuple, Sequence diff --git a/riak/content.py b/riak/content.py index 87b35594..6eb9e7df 100644 --- a/riak/content.py +++ b/riak/content.py @@ -12,23 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2013 Basho Technologies, Inc. - -This file is provided to you 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 riak import RiakError from six import string_types diff --git a/riak/datatypes/__init__.py b/riak/datatypes/__init__.py index 87062a74..87575a33 100644 --- a/riak/datatypes/__init__.py +++ b/riak/datatypes/__init__.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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 .types import TYPES from .datatype import Datatype from .counter import Counter diff --git a/riak/datatypes/datatype.py b/riak/datatypes/datatype.py index bad20d2c..2303dba7 100644 --- a/riak/datatypes/datatype.py +++ b/riak/datatypes/datatype.py @@ -12,25 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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 .errors import ContextRequired from . import TYPES diff --git a/riak/datatypes/flag.py b/riak/datatypes/flag.py index 3ce78c81..bfb869a2 100644 --- a/riak/datatypes/flag.py +++ b/riak/datatypes/flag.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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 riak.datatypes.datatype import Datatype from riak.datatypes import TYPES diff --git a/riak/datatypes/map.py b/riak/datatypes/map.py index 31d6aa22..b5b790bf 100644 --- a/riak/datatypes/map.py +++ b/riak/datatypes/map.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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 collections import Mapping from riak.util import lazy_property from .datatype import Datatype diff --git a/riak/datatypes/register.py b/riak/datatypes/register.py index c8402743..247a2a52 100644 --- a/riak/datatypes/register.py +++ b/riak/datatypes/register.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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 collections import Sized from riak.datatypes.datatype import Datatype from six import string_types diff --git a/riak/datatypes/types.py b/riak/datatypes/types.py index 79b969fb..b9761294 100644 --- a/riak/datatypes/types.py +++ b/riak/datatypes/types.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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. -""" - #: A dict from :attr:`type names ` to the #: class that implements them. This is used inside :class:`Map` to #: initialize new values. diff --git a/riak/mapreduce.py b/riak/mapreduce.py index 5e4e6cfc..7d2f690e 100644 --- a/riak/mapreduce.py +++ b/riak/mapreduce.py @@ -1,3 +1,6 @@ +# Copyright 2010 Rusty Klophaus +# Copyright 2010 Justin Sheehy +# Copyright 2009 Jay Baird # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,26 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2010 Rusty Klophaus -Copyright 2010 Justin Sheehy -Copyright 2009 Jay Baird - -This file is provided to you 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 __future__ import print_function from collections import Iterable, namedtuple from riak import RiakError diff --git a/riak/resolver.py b/riak/resolver.py index 260740d6..6e245ff3 100644 --- a/riak/resolver.py +++ b/riak/resolver.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2013 Basho Technologies, Inc. - -This file is provided to you 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. -""" - def default_resolver(riak_object): """ diff --git a/riak/riak_error.py b/riak/riak_error.py index ec70d54f..97d0878c 100644 --- a/riak/riak_error.py +++ b/riak/riak_error.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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. -""" - class RiakError(Exception): """ diff --git a/riak/security.py b/riak/security.py index d4dfdd1a..d048f008 100644 --- a/riak/security.py +++ b/riak/security.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2014 Basho Technologies, Inc. - -This file is provided to you 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. -""" - import ssl import warnings from riak import RiakError diff --git a/riak/tests/pool-grinder.py b/riak/tests/pool-grinder.py index 4e39ead3..19cb71d7 100755 --- a/riak/tests/pool-grinder.py +++ b/riak/tests/pool-grinder.py @@ -1,21 +1,17 @@ #!/usr/bin/env python -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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. -""" +# Copyright 2010-present Basho Technologies, Inc. +# +# 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 __future__ import print_function from six import PY2 diff --git a/riak/transports/security.py b/riak/transports/security.py index d7828b72..01cf6315 100644 --- a/riak/transports/security.py +++ b/riak/transports/security.py @@ -12,24 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" -Copyright 2015 Basho Technologies, Inc. - -This file is provided to you 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. -""" - import socket from riak.security import SecurityError, USE_STDLIB_SSL if USE_STDLIB_SSL: From 0f360924fc9260571d10c42f02d21f630973bbda Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Thu, 19 Jan 2017 08:41:39 -0800 Subject: [PATCH 06/17] Add Python 3.6 to the mix --- .travis.yml | 1 + build/pyenv-setup | 4 ++-- tools | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2013cbe3..90f86d41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ python: - '3.3' - '3.4' - '3.5' + - '3.6' - nightly addons: hosts: diff --git a/build/pyenv-setup b/build/pyenv-setup index 84657872..7759d45a 100755 --- a/build/pyenv-setup +++ b/build/pyenv-setup @@ -51,7 +51,7 @@ fi do_pip_upgrades='false' # NB: 2.7.8 is special-cased -for pyver in 2.7 3.3 3.4 3.5 +for pyver in 2.7 3.3 3.4 3.5 3.6 do riak_py_alias="riak_$pyver" if ! pyenv versions | fgrep -v 'riak_2.7.8' | fgrep -q "$riak_py_alias" @@ -78,7 +78,7 @@ then fi pushd $PROJDIR -pyenv local 'riak_3.5' 'riak_3.4' 'riak_3.3' 'riak_2.7' 'riak_2.7.8' +pyenv local 'riak_3.6' 'riak_3.5' 'riak_3.4' 'riak_3.3' 'riak_2.7' 'riak_2.7.8' pyenv rehash diff --git a/tools b/tools index 1fa90702..1f54803c 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit 1fa9070257c3443f04337e7e37ef083ed7ca2fe4 +Subproject commit 1f54803ca7912a41a0ec47c0028c259b97475e1f From 488c22b9492cda4870999acedd2c28d9341e5c3b Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Fri, 27 Jan 2017 08:25:58 -0800 Subject: [PATCH 07/17] Add global disable_list_exceptions variable to disable exceptions thrown during expensive operations. Raise ListError if mapreduce over a bucket is attempted --- Makefile | 2 ++ riak/__init__.py | 12 +++++++++--- riak/client/operations.py | 23 +++++++++++++++++++++-- riak/mapreduce.py | 17 ++++++++++------- riak/riak_error.py | 11 +++++++++++ riak/tests/base.py | 3 +++ riak/tests/test_kv.py | 34 ++++++++++++++++++++++++++++++++-- riak/tests/test_mapreduce.py | 9 ++++++++- riak/tests/yz_setup.py | 4 ++++ 9 files changed, 100 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 316389e4..166e4007 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,8 @@ DOCSDIR := $(PROJDIR)/docs PYPI_REPOSITORY ?= pypi +all: lint test + .PHONY: lint lint: $(PROJDIR)/.runner lint diff --git a/riak/__init__.py b/riak/__init__.py index de68354a..306cf7a0 100644 --- a/riak/__init__.py +++ b/riak/__init__.py @@ -19,7 +19,7 @@ operations, and run Linkwalking operations. """ -from riak.riak_error import RiakError, ConflictError +from riak.riak_error import RiakError, ConflictError, ListError from riak.client import RiakClient from riak.bucket import RiakBucket, BucketType from riak.table import Table @@ -30,11 +30,17 @@ __all__ = ['RiakBucket', 'Table', 'BucketType', 'RiakNode', 'RiakObject', 'RiakClient', 'RiakMapReduce', 'RiakKeyFilter', - 'RiakLink', 'RiakError', 'ConflictError', - 'ONE', 'ALL', 'QUORUM', 'key_filter'] + 'RiakLink', 'RiakError', 'ConflictError', 'ListError', + 'ONE', 'ALL', 'QUORUM', 'key_filter', + 'disable_list_exceptions'] ONE = "one" ALL = "all" QUORUM = "quorum" key_filter = RiakKeyFilter() + +""" +Set to true to allow listing operations +""" +disable_list_exceptions = False diff --git a/riak/client/operations.py b/riak/client/operations.py index 1acf06e1..0d507f12 100644 --- a/riak/client/operations.py +++ b/riak/client/operations.py @@ -13,11 +13,11 @@ # limitations under the License. import six - import riak.client.multi +from riak import ListError from riak.client.transport import RiakClientTransport, \ - retryable, retryableHttpOnly + retryable, retryableHttpOnly from riak.client.index_page import IndexPage from riak.datatypes import TYPES from riak.table import Table @@ -55,7 +55,11 @@ def get_buckets(self, transport, bucket_type=None, timeout=None): :rtype: list of :class:`RiakBucket ` instances """ + if not riak.disable_list_exceptions: + raise ListError() + _validate_timeout(timeout) + if bucket_type: bucketfn = self._bucket_type_bucket_builder else: @@ -100,6 +104,9 @@ def stream_buckets(self, bucket_type=None, timeout=None): ` instances """ + if not riak.disable_list_exceptions: + raise ListError() + _validate_timeout(timeout) if bucket_type: @@ -467,7 +474,11 @@ def get_keys(self, transport, bucket, timeout=None): :type timeout: int :rtype: list """ + if not riak.disable_list_exceptions: + raise ListError() + _validate_timeout(timeout) + return transport.get_keys(bucket, timeout=timeout) def stream_keys(self, bucket, timeout=None): @@ -503,6 +514,9 @@ def stream_keys(self, bucket, timeout=None): :type timeout: int :rtype: iterator """ + if not riak.disable_list_exceptions: + raise ListError() + _validate_timeout(timeout) def make_op(transport): @@ -678,10 +692,15 @@ def ts_stream_keys(self, table, timeout=None): :type timeout: int :rtype: iterator """ + if not riak.disable_list_exceptions: + raise ListError() + t = table if isinstance(t, six.string_types): t = Table(self, table) + _validate_timeout(timeout) + resource = self._acquire() transport = resource.object stream = transport.ts_stream_keys(t, timeout) diff --git a/riak/mapreduce.py b/riak/mapreduce.py index 7d2f690e..1b604663 100644 --- a/riak/mapreduce.py +++ b/riak/mapreduce.py @@ -17,9 +17,9 @@ from __future__ import print_function from collections import Iterable, namedtuple -from riak import RiakError from six import string_types, PY2 -from riak.bucket import RiakBucket + +import riak #: Links are just bucket/key/tag tuples, this class provides a @@ -128,8 +128,10 @@ def add_bucket(self, bucket, bucket_type=None): :type bucket_type: string, None :rtype: :class:`RiakMapReduce` """ + if not riak.disable_list_exceptions: + raise riak.ListError() self._input_mode = 'bucket' - if isinstance(bucket, RiakBucket): + if isinstance(bucket, riak.RiakBucket): if bucket.bucket_type.is_default(): self._inputs = {'bucket': bucket.name} else: @@ -308,14 +310,15 @@ def run(self, timeout=None): try: result = self._client.mapred(self._inputs, query, timeout) - except RiakError as e: + except riak.RiakError as e: if 'worker_startup_failed' in e.value: for phase in self._phases: if phase._language == 'erlang': if type(phase._function) is str: - raise RiakError('May have tried erlang strfun ' - 'when not allowed\n' - 'original error: ' + e.value) + raise riak.RiakError( + 'May have tried erlang strfun ' + 'when not allowed\n' + 'original error: ' + e.value) raise e # If the last phase is NOT a link phase, then return the result. diff --git a/riak/riak_error.py b/riak/riak_error.py index 97d0878c..4fe0ce05 100644 --- a/riak/riak_error.py +++ b/riak/riak_error.py @@ -36,3 +36,14 @@ class ConflictError(RiakError): """ def __init__(self, message='Object in conflict'): super(ConflictError, self).__init__(message) + + +class ListError(RiakError): + """ + Raised when a list operation is attempted and + riak.disable_list_exceptions is false. + """ + def __init__(self, message='Bucket and key list operations ' + 'are expensive and should not be ' + 'used in production.'): + super(ListError, self).__init__(message) diff --git a/riak/tests/base.py b/riak/tests/base.py index aa81c0da..9aaf4e69 100644 --- a/riak/tests/base.py +++ b/riak/tests/base.py @@ -15,6 +15,7 @@ # -*- coding: utf-8 -*- import logging import random +import riak from riak.client import RiakClient from riak.tests import HOST, PROTOCOL, PB_PORT, HTTP_PORT, SECURITY_CREDS @@ -70,9 +71,11 @@ def create_client(cls, host=None, http_port=None, pb_port=None, **kwargs) def setUp(self): + riak.disable_list_exceptions = True self.bucket_name = self.randname() self.key_name = self.randname() self.client = self.create_client() def tearDown(self): + riak.disable_list_exceptions = False self.client.close() diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index 56f55844..63206c95 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -20,7 +20,8 @@ from six import string_types, PY2, PY3 from time import sleep -from riak import ConflictError, RiakBucket, RiakError +from riak import ConflictError, RiakError, ListError +from riak import RiakClient, RiakBucket, BucketType from riak.resolver import default_resolver, last_written_resolver from riak.tests import RUN_KV, RUN_RESOLVE, PROTOCOL from riak.tests.base import IntegrationTestBase @@ -63,7 +64,6 @@ def tearDownModule(): class NotJsonSerializable(object): - def __init__(self, *args, **kwargs): self.args = list(args) self.kwargs = kwargs @@ -86,6 +86,36 @@ def __eq__(self, other): return True +class KVUnitTests(unittest.TestCase): + def test_list_keys_exception(self): + c = RiakClient() + bt = BucketType(c, 'test') + b = RiakBucket(c, 'test', bt) + with self.assertRaises(ListError): + b.get_keys() + + def test_stream_buckets_exception(self): + c = RiakClient() + with self.assertRaises(ListError): + bs = [] + for bl in c.stream_buckets(): + bs.extend(bl) + + def test_stream_keys_exception(self): + c = RiakClient() + with self.assertRaises(ListError): + ks = [] + for kl in c.stream_keys('test'): + ks.extend(kl) + + def test_ts_stream_keys_exception(self): + c = RiakClient() + with self.assertRaises(ListError): + ks = [] + for kl in c.ts_stream_keys('test'): + ks.extend(kl) + + @unittest.skipUnless(RUN_KV, 'RUN_KV is 0') class BasicKVTests(IntegrationTestBase, unittest.TestCase, Comparison): def test_no_returnbody(self): diff --git a/riak/tests/test_mapreduce.py b/riak/tests/test_mapreduce.py index f8b90e98..bfdfc7dd 100644 --- a/riak/tests/test_mapreduce.py +++ b/riak/tests/test_mapreduce.py @@ -19,7 +19,7 @@ from six import PY2 from riak.mapreduce import RiakMapReduce -from riak import key_filter, RiakError +from riak import key_filter, RiakClient, RiakError, ListError from riak.tests import RUN_MAPREDUCE, RUN_SECURITY, RUN_YZ from riak.tests.base import IntegrationTestBase from riak.tests.test_yokozuna import wait_for_yz_index @@ -39,6 +39,13 @@ def tearDownModule(): yzTearDown(testrun_yz_mr) +class MapReduceUnitTests(unittest.TestCase): + def test_mapred_bucket_exception(self): + c = RiakClient() + with self.assertRaises(ListError): + c.add('bucket') + + @unittest.skipUnless(RUN_MAPREDUCE, 'RUN_MAPREDUCE is 0') class LinkTests(IntegrationTestBase, unittest.TestCase): def test_store_and_get_links(self): diff --git a/riak/tests/yz_setup.py b/riak/tests/yz_setup.py index 78c44755..88a7daee 100644 --- a/riak/tests/yz_setup.py +++ b/riak/tests/yz_setup.py @@ -13,6 +13,7 @@ # limitations under the License. import logging +import riak from riak import RiakError from riak.tests import RUN_YZ @@ -21,6 +22,7 @@ def yzSetUp(*yzdata): if RUN_YZ: + riak.disable_list_exceptions = True c = IntegrationTestBase.create_client() for yz in yzdata: logging.debug("yzSetUp: %s", yz) @@ -43,6 +45,7 @@ def yzSetUp(*yzdata): def yzTearDown(c, *yzdata): if RUN_YZ: + riak.disable_list_exceptions = True c = IntegrationTestBase.create_client() for yz in yzdata: logging.debug("yzTearDown: %s", yz) @@ -57,3 +60,4 @@ def yzTearDown(c, *yzdata): for key in keys: b.delete(key) c.close() + riak.disable_list_exceptions = False From 4fee03a6c0fd51a368c0364adcc5408dafe9c003 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Thu, 9 Feb 2017 08:43:56 -0800 Subject: [PATCH 08/17] Add note about exceptions being raised for list operations --- RELNOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELNOTES.md b/RELNOTES.md index bd567fde..0cc58993 100644 --- a/RELNOTES.md +++ b/RELNOTES.md @@ -1,5 +1,9 @@ # Riak Python Client Release Notes +## [`2.8.0` Release](https://github.com/basho/riak-python-client/issues?q=milestone%3Ariak-python-client-2.8.0) + +* [Running expensive operations *now raise exceptions*](https://github.com/basho/riak-python-client/pull/518). You can disable these exceptions for development purposes but should not do so in production. + ## [`2.7.0` Release](https://github.com/basho/riak-python-client/issues?q=milestone%3Ariak-python-client-2.7.0) * Riak TS 1.5 support * Support for `head` parameter From b27163d4526fd6c8894e225e61f8d9de27223034 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Mon, 27 Feb 2017 12:54:35 -0800 Subject: [PATCH 09/17] Add a workaround for Python bug 19542 --- riak/client/__init__.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/riak/client/__init__.py b/riak/client/__init__.py index ac33f8f2..7015b48f 100644 --- a/riak/client/__init__.py +++ b/riak/client/__init__.py @@ -275,8 +275,9 @@ def bucket(self, name, bucket_type='default'): raise TypeError('bucket_type must be a string ' 'or riak.bucket.BucketType') - return self._buckets.setdefault((bucket_type, name), - RiakBucket(self, name, bucket_type)) + b = RiakBucket(self, name, bucket_type) + return self._setdefault_handle_none( + self._buckets, (bucket_type, name), b) def bucket_type(self, name): """ @@ -291,12 +292,9 @@ def bucket_type(self, name): if not isinstance(name, string_types): raise TypeError('BucketType name must be a string') - if name in self._bucket_types: - return self._bucket_types[name] - else: - btype = BucketType(self, name) - self._bucket_types[name] = btype - return btype + btype = BucketType(self, name) + return self._setdefault_handle_none( + self._bucket_types, name, btype) def table(self, name): """ @@ -390,6 +388,16 @@ def _error_rate(node): else: return random.choice(good) + def _setdefault_handle_none(self, wvdict, key, value): + # TODO FIXME FUTURE + # This is a workaround for Python issue 19542 + # http://bugs.python.org/issue19542 + rv = wvdict.setdefault(key, value) + if rv is None: + return value + else: + return rv + @lazy_property def _multiget_pool(self): if self._multiget_pool_size: From b0ee21aec32a584f07d2c377d904352e884b5cfe Mon Sep 17 00:00:00 2001 From: Ali Riza Keles Date: Tue, 21 Mar 2017 16:52:57 +0300 Subject: [PATCH 10/17] fix missing str to byte operation of fl params in encode_search_query method of codecs.pbuf module --- riak/codecs/pbuf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riak/codecs/pbuf.py b/riak/codecs/pbuf.py index fe34ee15..0b4de2a6 100644 --- a/riak/codecs/pbuf.py +++ b/riak/codecs/pbuf.py @@ -556,9 +556,9 @@ def encode_search_query(self, req, **kwargs): req.op = kwargs['q.op'] if 'fl' in kwargs: if isinstance(kwargs['fl'], list): - req.fl.extend(kwargs['fl']) + req.fl.extend([str_to_bytes(fl) for fl in kwargs['fl']]) else: - req.fl.append(kwargs['fl']) + req.fl.append(str_to_bytes(kwargs['fl'])) if 'presort' in kwargs: req.presort = kwargs['presort'] From a190e871eabf2f42df40c62e888282848b9b8505 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Mon, 27 Mar 2017 16:29:29 -0700 Subject: [PATCH 11/17] 2.8.0 release is actually 3.0.0 --- RELNOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELNOTES.md b/RELNOTES.md index 0cc58993..6722c3ec 100644 --- a/RELNOTES.md +++ b/RELNOTES.md @@ -1,6 +1,6 @@ # Riak Python Client Release Notes -## [`2.8.0` Release](https://github.com/basho/riak-python-client/issues?q=milestone%3Ariak-python-client-2.8.0) +## [`3.0.0` Release](https://github.com/basho/riak-python-client/issues?q=milestone%3Ariak-python-client-3.0.0) * [Running expensive operations *now raise exceptions*](https://github.com/basho/riak-python-client/pull/518). You can disable these exceptions for development purposes but should not do so in production. From 2c01ebb72c76b8f27ec4d2965f59a7a7165f2bf2 Mon Sep 17 00:00:00 2001 From: Steven Joseph Date: Sat, 28 Oct 2017 11:53:33 +1100 Subject: [PATCH 12/17] Expose facet_counts in riak http results --- riak/codecs/http.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/riak/codecs/http.py b/riak/codecs/http.py index bfc91f2c..5da99961 100644 --- a/riak/codecs/http.py +++ b/riak/codecs/http.py @@ -229,6 +229,8 @@ def _normalize_json_search_response(self, json): if u'response' in json: result['num_found'] = json[u'response'][u'numFound'] result['max_score'] = float(json[u'response'][u'maxScore']) + if 'facet_counts' in json: + result['facet_counts'] = json[u'facet_counts'] docs = [] for doc in json[u'response'][u'docs']: resdoc = {} From 648f9056d47332df890232e85d497623608e2964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20A=2E=20Ceccon?= Date: Mon, 19 Mar 2018 15:05:41 +0100 Subject: [PATCH 13/17] Do not use deprecated argument `verbose` in namedtuple Argument `verbose` to nametuple constructor was deprecated in Python 3.3, and was removed in Python 3.7. --- riak/codecs/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/riak/codecs/__init__.py b/riak/codecs/__init__.py index 00324f14..b824fcc0 100644 --- a/riak/codecs/__init__.py +++ b/riak/codecs/__init__.py @@ -21,8 +21,7 @@ from riak.util import bytes_to_str Msg = collections.namedtuple('Msg', - ['msg_code', 'data', 'resp_code'], - verbose=False) + ['msg_code', 'data', 'resp_code']) class Codec(object): From 95e61a03ce6e51289aa184a618f7462ff7fd602f Mon Sep 17 00:00:00 2001 From: bryanhuntesl <31992054+bryanhuntesl@users.noreply.github.com> Date: Mon, 19 Mar 2018 18:25:02 +0000 Subject: [PATCH 14/17] disable spurious flake8 python style warnings --- .travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.sh b/.travis.sh index 497de259..40518170 100755 --- a/.travis.sh +++ b/.travis.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o errexit -flake8 --exclude=riak/pb riak *.py +flake8 --ignore E722,E741 --exclude=riak/pb riak *.py sudo riak-admin security disable From c52b745a96115426205d7c8a6245902cf2441b3b Mon Sep 17 00:00:00 2001 From: bryanhuntesl <31992054+bryanhuntesl@users.noreply.github.com> Date: Mon, 19 Mar 2018 18:43:41 +0000 Subject: [PATCH 15/17] and again... add more exclusions.. --- .travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.sh b/.travis.sh index 40518170..739c66cd 100755 --- a/.travis.sh +++ b/.travis.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -o errexit -flake8 --ignore E722,E741 --exclude=riak/pb riak *.py +flake8 --ignore E123,E126,E226,E722,E741 --exclude=riak/pb riak *.py sudo riak-admin security disable From b3a7d2d2c2621efc3cbf7a339a2341ff4da882bd Mon Sep 17 00:00:00 2001 From: bryanhuntesl <31992054+bryanhuntesl@users.noreply.github.com> Date: Mon, 19 Mar 2018 18:54:49 +0000 Subject: [PATCH 16/17] Reduce test time - test only 2.7, 3.6, and nightly test only 2.7 (stable), 3.6 (3 series stable) and nightly - the matrix was too big - 3.2, 3.3, 3.4, and 3.5 are the least used. --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90f86d41..7c46a5cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,6 @@ dist: trusty language: python python: - '2.7' - - '3.3' - - '3.4' - - '3.5' - '3.6' - nightly addons: From 3a2bf990db0792a3ba00719db5fa1651c89ce758 Mon Sep 17 00:00:00 2001 From: Steven Joseph Date: Tue, 20 Mar 2018 10:11:43 +1100 Subject: [PATCH 17/17] Expose more result types from solr results --- riak/codecs/http.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/riak/codecs/http.py b/riak/codecs/http.py index 5da99961..b981b77a 100644 --- a/riak/codecs/http.py +++ b/riak/codecs/http.py @@ -226,11 +226,15 @@ def _normalize_json_search_response(self, json): same return value """ result = {} + if 'facet_counts' in json: + result['facet_counts'] = json[u'facet_counts'] + if 'grouped' in json: + result['grouped'] = json[u'grouped'] + if 'stats' in json: + result['stats'] = json[u'stats'] if u'response' in json: result['num_found'] = json[u'response'][u'numFound'] result['max_score'] = float(json[u'response'][u'maxScore']) - if 'facet_counts' in json: - result['facet_counts'] = json[u'facet_counts'] docs = [] for doc in json[u'response'][u'docs']: resdoc = {}