Skip to content

Commit

Permalink
Rename safe module to safe_search.
Browse files Browse the repository at this point in the history
  • Loading branch information
daspecster committed Jan 23, 2017
1 parent 4b54e1c commit 0aa5220
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/vision-safe-search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vision Safe Search
Safe Search Annotation
~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: google.cloud.vision.safe
.. automodule:: google.cloud.vision.safe_search
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion system_tests/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def tearDown(self):
value.delete()

def _assert_safe_search(self, safe_search):
from google.cloud.vision.safe import SafeSearchAnnotation
from google.cloud.vision.safe_search import SafeSearchAnnotation

self.assertIsInstance(safe_search, SafeSearchAnnotation)
self._assert_likelihood(safe_search.adult)
Expand Down
8 changes: 4 additions & 4 deletions vision/google/cloud/vision/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from google.cloud.vision.color import ImagePropertiesAnnotation
from google.cloud.vision.entity import EntityAnnotation
from google.cloud.vision.face import Face
from google.cloud.vision.safe import SafeSearchAnnotation
from google.cloud.vision.safe_search import SafeSearchAnnotation


_FACE_ANNOTATIONS = 'faceAnnotations'
Expand Down Expand Up @@ -61,7 +61,7 @@ class Annotations(object):
:type safe_searches: list
:param safe_searches:
List of :class:`~google.cloud.vision.safe.SafeSearchAnnotation`
List of :class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`
:type texts: list
:param texts: List of
Expand Down Expand Up @@ -179,7 +179,7 @@ def _make_safe_search_from_pb(safe_search):
image_annotator_pb2.SafeSearchAnnotation`
:param safe_search: Protobuf instance of ``SafeSearchAnnotation``.
:rtype: :class: `~google.cloud.vision.safe.SafeSearchAnnotation`
:rtype: :class: `~google.cloud.vision.safe_search.SafeSearchAnnotation`
:returns: Instance of ``SafeSearchAnnotation``.
"""
return SafeSearchAnnotation.from_pb(safe_search)
Expand All @@ -195,7 +195,7 @@ def _entity_from_response_type(feature_type, results):
or one of
:class:`~google.cloud.vision.safe.SafeSearchAnnotation`,
:class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`,
:class:`~google.cloud.vision.color.ImagePropertiesAnnotation`.
"""
detected_objects = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def from_api_repr(cls, response):
:param response: Dictionary response from Vision API with safe search
data.
:rtype: :class:`~google.cloud.vision.safe.SafeSearchAnnotation`
:rtype: :class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`
:returns: Instance of ``SafeSearchAnnotation``.
"""
adult_likelihood = Likelihood[response['adult']]
Expand All @@ -70,7 +70,7 @@ def from_pb(cls, image):
SafeSearchAnnotation`
:param image: Protobuf response from Vision API with safe search data.
:rtype: :class:`~google.cloud.vision.safe.SafeSearchAnnotation`
:rtype: :class:`~google.cloud.vision.safe_search.SafeSearchAnnotation`
:returns: Instance of ``SafeSearchAnnotation``.
"""
values = [image.adult, image.spoof, image.medical, image.violence]
Expand Down
2 changes: 1 addition & 1 deletion vision/unit_tests/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_ctor(self):

def test_from_pb(self):
from google.cloud.vision.likelihood import Likelihood
from google.cloud.vision.safe import SafeSearchAnnotation
from google.cloud.vision.safe_search import SafeSearchAnnotation
from google.cloud.grpc.vision.v1 import image_annotator_pb2

image_response = image_annotator_pb2.AnnotateImageResponse()
Expand Down
2 changes: 1 addition & 1 deletion vision/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def test_text_detection_from_source(self):

def test_safe_search_detection_from_source(self):
from google.cloud.vision.likelihood import Likelihood
from google.cloud.vision.safe import SafeSearchAnnotation
from google.cloud.vision.safe_search import SafeSearchAnnotation
from unit_tests._fixtures import SAFE_SEARCH_DETECTION_RESPONSE

RETURNED = SAFE_SEARCH_DETECTION_RESPONSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class TestSafeSearchAnnotation(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.vision.safe import SafeSearchAnnotation
from google.cloud.vision.safe_search import SafeSearchAnnotation
return SafeSearchAnnotation

def test_safe_search_annotation(self):
Expand Down

0 comments on commit 0aa5220

Please sign in to comment.