From f00d3f7e9e63617b7b583136220da363f615bc3f Mon Sep 17 00:00:00 2001 From: Jeffrey Stylos Date: Thu, 15 Dec 2016 15:05:16 -0500 Subject: [PATCH] pep8 style fixes --- examples/alchemy_language_v1.py | 4 +-- examples/discovery_v1.py | 1 - examples/language_translator_v2.py | 3 +- examples/text_to_speech_v1.py | 4 +-- setup.py | 48 +++++++++++++++++++----------- 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/examples/alchemy_language_v1.py b/examples/alchemy_language_v1.py index b11b521d3..878d198bd 100644 --- a/examples/alchemy_language_v1.py +++ b/examples/alchemy_language_v1.py @@ -38,8 +38,8 @@ combined_operations = ['page-image', 'entity', 'keyword', 'title', 'author', 'taxonomy', 'concept', 'doc-emotion'] print( -json.dumps(alchemy_language.combined(url=url, extract=combined_operations), - indent=2)) + json.dumps(alchemy_language.combined(url=url, extract=combined_operations), + indent=2)) # Get sentiment and emotion information results for detected entities/keywords: # print(json.dumps(alchemy_language.entities(url=url, sentiment=True, diff --git a/examples/discovery_v1.py b/examples/discovery_v1.py index 2087b5ae7..3d089bbe5 100644 --- a/examples/discovery_v1.py +++ b/examples/discovery_v1.py @@ -1,6 +1,5 @@ # coding=utf-8 import watson_developer_cloud -import os, json discovery = watson_developer_cloud.DiscoveryV1( '2016-11-07', diff --git a/examples/language_translator_v2.py b/examples/language_translator_v2.py index a532293a4..627db1009 100644 --- a/examples/language_translator_v2.py +++ b/examples/language_translator_v2.py @@ -16,7 +16,8 @@ print(json.dumps(language_translator.get_models(), indent=2)) print( -json.dumps(language_translator.get_model('en-es-conversational'), indent=2)) + json.dumps(language_translator.get_model('en-es-conversational'), + indent=2)) # delete custom model # print(json.dumps(language_translator.delete_model( diff --git a/examples/text_to_speech_v1.py b/examples/text_to_speech_v1.py index 19ffc6954..a7f88f7fe 100644 --- a/examples/text_to_speech_v1.py +++ b/examples/text_to_speech_v1.py @@ -17,8 +17,8 @@ voice="en-US_AllisonVoice")) print( -json.dumps(text_to_speech.pronunciation('Watson', pronunciation_format='spr'), - indent=2)) + json.dumps(text_to_speech.pronunciation( + 'Watson', pronunciation_format='spr'), indent=2)) print(json.dumps(text_to_speech.customizations(), indent=2)) diff --git a/setup.py b/setup.py index 53901d791..bce17dcfd 100644 --- a/setup.py +++ b/setup.py @@ -34,11 +34,18 @@ # Convert README.md to README.rst for pypi try: from pypandoc import convert - read_md = lambda f: convert(f, 'rst') + + def read_md(f): + return convert(f, 'rst') + + # read_md = lambda f: convert(f, 'rst') except ImportError: print('warning: pypandoc module not found, ' 'could not convert Markdown to RST') - read_md = lambda f: open(f, 'rb').read().decode(encoding='utf-8') + + def read_md(f): + return open(f, 'rb').read().decode(encoding='utf-8') + # read_md = lambda f: open(f, 'rb').read().decode(encoding='utf-8') class PyTest(TestCommand): @@ -52,6 +59,7 @@ def run_tests(self): errcode = pytest.main(self.test_args) sys.exit(errcode) + setup(name='watson-developer-cloud', version=__version__, description='Client library to use the IBM Watson Services', @@ -65,23 +73,27 @@ def run_tests(self): url='https://github.com/watson-developer-cloud/python-sdk', packages=['watson_developer_cloud'], keywords='alchemy datanews, language, vision, question and answer' + - ' tone_analyzer, natural language classifier, retrieve and rank,' + - ' tradeoff analytics, text to speech,' + - ' language translation, language identification,' + - ' concept expansion, machine translation, personality insights,' + - ' message resonance, watson developer cloud, wdc, watson, ibm,' + - ' dialog, user modeling, alchemyapi, alchemy, tone analyzer,' + - 'speech to text, visual recognition', + ' tone_analyzer, natural language classifier, retrieve and ' + 'rank,' + + ' tradeoff analytics, text to speech,' + + ' language translation, language identification,' + + ' concept expansion, machine translation, personality ' + 'insights,' + + ' message resonance, watson developer cloud, wdc, watson, ' + 'ibm,' + + ' dialog, user modeling, alchemyapi, alchemy, tone analyzer,' + + 'speech to text, visual recognition', classifiers=[ - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3', - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Software Development :: Libraries :: Application Frameworks', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Topic :: Software Development :: Libraries :: Python Modules', + 'Topic :: Software Development :: Libraries :: Application ' + 'Frameworks', ], zip_safe=True )