diff options
author | Masood Malekghassemi <soltanmm@users.noreply.github.com> | 2015-03-17 18:26:48 -0700 |
---|---|---|
committer | Masood Malekghassemi <soltanmm@users.noreply.github.com> | 2015-03-17 18:54:24 -0700 |
commit | 89905ac55d986878b338406a298ee513c15b68be (patch) | |
tree | a868c20c603989c011d5f1fbf1d110ccdebf16bd /src/python | |
parent | acfcd03f06f45bc008c0ac80d2ab54948042b63e (diff) |
Factor out interface-specific early_adopter code
Refactors early_adopter such that interface-specific code is located in
the framework module as a submodule `alpha`.
Diffstat (limited to 'src/python')
-rw-r--r-- | src/python/interop/interop/methods.py | 2 | ||||
-rw-r--r-- | src/python/src/grpc/early_adopter/implementations.py | 6 | ||||
-rw-r--r-- | src/python/src/grpc/early_adopter/implementations_test.py | 2 | ||||
-rw-r--r-- | src/python/src/grpc/framework/alpha/__init__.py | 28 | ||||
-rw-r--r-- | src/python/src/grpc/framework/alpha/_face_utilities.py (renamed from src/python/src/grpc/early_adopter/_face_utilities.py) | 4 | ||||
-rw-r--r-- | src/python/src/grpc/framework/alpha/_reexport.py (renamed from src/python/src/grpc/early_adopter/_reexport.py) | 4 | ||||
-rw-r--r-- | src/python/src/grpc/framework/alpha/exceptions.py (renamed from src/python/src/grpc/early_adopter/exceptions.py) | 0 | ||||
-rw-r--r-- | src/python/src/grpc/framework/alpha/interfaces.py (renamed from src/python/src/grpc/early_adopter/interfaces.py) | 2 | ||||
-rw-r--r-- | src/python/src/grpc/framework/alpha/utilities.py (renamed from src/python/src/grpc/early_adopter/utilities.py) | 2 | ||||
-rw-r--r-- | src/python/src/setup.py | 1 |
10 files changed, 40 insertions, 11 deletions
diff --git a/src/python/interop/interop/methods.py b/src/python/interop/interop/methods.py index 4f83ccc085..79550a3789 100644 --- a/src/python/interop/interop/methods.py +++ b/src/python/interop/interop/methods.py @@ -32,7 +32,7 @@ import enum import threading -from grpc.early_adopter import utilities +from grpc.framework.alpha import utilities from interop import empty_pb2 from interop import messages_pb2 diff --git a/src/python/src/grpc/early_adopter/implementations.py b/src/python/src/grpc/early_adopter/implementations.py index 9cadb58d0f..cc0b8ec9e8 100644 --- a/src/python/src/grpc/early_adopter/implementations.py +++ b/src/python/src/grpc/early_adopter/implementations.py @@ -33,9 +33,9 @@ import threading from grpc._adapter import fore as _fore from grpc._adapter import rear as _rear -from grpc.early_adopter import _face_utilities -from grpc.early_adopter import _reexport -from grpc.early_adopter import interfaces +from grpc.framework.alpha import _face_utilities +from grpc.framework.alpha import _reexport +from grpc.framework.alpha import interfaces from grpc.framework.base import implementations as _base_implementations from grpc.framework.base import util as _base_utilities from grpc.framework.face import implementations as _face_implementations diff --git a/src/python/src/grpc/early_adopter/implementations_test.py b/src/python/src/grpc/early_adopter/implementations_test.py index 949d3def3d..ae4adad90f 100644 --- a/src/python/src/grpc/early_adopter/implementations_test.py +++ b/src/python/src/grpc/early_adopter/implementations_test.py @@ -34,7 +34,7 @@ import unittest from grpc.early_adopter import implementations -from grpc.early_adopter import utilities +from grpc.framework.alpha import utilities from grpc._junkdrawer import math_pb2 SERVICE_NAME = 'math.Math' diff --git a/src/python/src/grpc/framework/alpha/__init__.py b/src/python/src/grpc/framework/alpha/__init__.py new file mode 100644 index 0000000000..b89398809f --- /dev/null +++ b/src/python/src/grpc/framework/alpha/__init__.py @@ -0,0 +1,28 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/python/src/grpc/early_adopter/_face_utilities.py b/src/python/src/grpc/framework/alpha/_face_utilities.py index ce099fc22f..fb0cfe426d 100644 --- a/src/python/src/grpc/early_adopter/_face_utilities.py +++ b/src/python/src/grpc/framework/alpha/_face_utilities.py @@ -34,8 +34,8 @@ import collections from grpc.framework.common import cardinality from grpc.framework.face import interfaces as face_interfaces # pylint: disable=unused-import from grpc.framework.face import utilities as face_utilities -from grpc.early_adopter import _reexport -from grpc.early_adopter import interfaces +from grpc.framework.alpha import _reexport +from grpc.framework.alpha import interfaces def _qualified_name(service_name, method_name): diff --git a/src/python/src/grpc/early_adopter/_reexport.py b/src/python/src/grpc/framework/alpha/_reexport.py index 49bc38e203..198cb95ad5 100644 --- a/src/python/src/grpc/early_adopter/_reexport.py +++ b/src/python/src/grpc/framework/alpha/_reexport.py @@ -31,8 +31,8 @@ from grpc.framework.common import cardinality from grpc.framework.face import exceptions as face_exceptions from grpc.framework.face import interfaces as face_interfaces from grpc.framework.foundation import future -from grpc.early_adopter import exceptions -from grpc.early_adopter import interfaces +from grpc.framework.alpha import exceptions +from grpc.framework.alpha import interfaces _EARLY_ADOPTER_CARDINALITY_TO_COMMON_CARDINALITY = { interfaces.Cardinality.UNARY_UNARY: cardinality.Cardinality.UNARY_UNARY, diff --git a/src/python/src/grpc/early_adopter/exceptions.py b/src/python/src/grpc/framework/alpha/exceptions.py index 5234d3b91c..5234d3b91c 100644 --- a/src/python/src/grpc/early_adopter/exceptions.py +++ b/src/python/src/grpc/framework/alpha/exceptions.py diff --git a/src/python/src/grpc/early_adopter/interfaces.py b/src/python/src/grpc/framework/alpha/interfaces.py index b733873c1c..8380567c97 100644 --- a/src/python/src/grpc/early_adopter/interfaces.py +++ b/src/python/src/grpc/framework/alpha/interfaces.py @@ -33,7 +33,7 @@ import abc import enum # exceptions is referenced from specification in this module. -from grpc.early_adopter import exceptions # pylint: disable=unused-import +from grpc.framework.alpha import exceptions # pylint: disable=unused-import from grpc.framework.foundation import activated from grpc.framework.foundation import future diff --git a/src/python/src/grpc/early_adopter/utilities.py b/src/python/src/grpc/framework/alpha/utilities.py index da8ef825aa..7d7f78f5e4 100644 --- a/src/python/src/grpc/early_adopter/utilities.py +++ b/src/python/src/grpc/framework/alpha/utilities.py @@ -29,7 +29,7 @@ """Utilities for use with GRPC.""" -from grpc.early_adopter import interfaces +from grpc.framework.alpha import interfaces class _RpcMethodDescription( diff --git a/src/python/src/setup.py b/src/python/src/setup.py index 63731212c7..bd70634b8f 100644 --- a/src/python/src/setup.py +++ b/src/python/src/setup.py @@ -64,6 +64,7 @@ _PACKAGES = ( 'grpc._junkdrawer', 'grpc.early_adopter', 'grpc.framework', + 'grpc.framework.alpha', 'grpc.framework.base', 'grpc.framework.common', 'grpc.framework.face', |