Skip to content

Commit d38c940

Browse files
committed
Better deprecation message
1 parent 8dd85a3 commit d38c940

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

watson_developer_cloud/document_conversion_v1.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from .watson_service import WatsonService
2121
import os
2222
import json
23+
DEPRECATION_MESSAGE = "Since Document Conversion Service was retired in October 2017, we have continued to improve document conversion capabilities within Watson Discovery. If you are a Document Conversion user, get started with Discovery today. Refer to the migration guide: https://console.bluemix.net/docs/services/discovery/migrate-dcs-rr.html"
2324

2425
class DocumentConversionV1(WatsonService):
2526
DEFAULT_URL = 'https://gateway.watsonplatform.net/document-conversion/api'
@@ -28,12 +29,12 @@ class DocumentConversionV1(WatsonService):
2829
NORMALIZED_TEXT = 'normalized_text'
2930
latest_version = '2016-02-10'
3031

31-
@deprecated("To continue using document conversion capabilities, please use Watson Discovery.")
32+
@deprecated(DEPRECATION_MESSAGE)
3233
def __init__(self, version, url=DEFAULT_URL, **kwargs):
3334
WatsonService.__init__(self, 'document_conversion', url, **kwargs)
3435
self.version = version
3536

36-
@deprecated("To continue using document conversion capabilities, please use Watson Discovery.")
37+
@deprecated(DEPRECATION_MESSAGE)
3738
def convert_document(self, document, config, media_type=None):
3839
params = {'version': self.version}
3940
filename = os.path.basename(document.name)
@@ -47,7 +48,7 @@ def convert_document(self, document, config, media_type=None):
4748
return self.request(method='POST', url='/v1/convert_document',
4849
files=files, params=params,
4950
accept_json=accept_json)
50-
@deprecated("To continue using document conversion capabilities, please use Watson Discovery.")
51+
@deprecated(DEPRECATION_MESSAGE)
5152
def index_document(self, config, document=None, metadata=None,
5253
media_type=None):
5354
if document is None and metadata is None:

0 commit comments

Comments
 (0)