Skip to content

Commit 5de0fdc

Browse files
committed
fix(codacy): Fix codacy issues
1 parent feac01c commit 5de0fdc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

watson_developer_cloud/watson_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def set_username_and_password(self, username=None, password=None):
290290
def set_api_key(self, api_key):
291291
if api_key == 'YOUR API KEY':
292292
api_key = None
293-
if api_key.startswith(ICP_PREFIX):
293+
if api_key is not None and api_key.startswith(ICP_PREFIX):
294294
self.set_username_and_password(APIKEY, api_key)
295295
return
296296

watson_developer_cloud/websocket/recognize_listener.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,17 @@ def __init__(self, audio_source, options, callback, url, headers, http_proxy_hos
5353
)
5454
self.ws_client.run_forever(http_proxy_host=self.http_proxy_host, http_proxy_port=self.http_proxy_port)
5555

56-
def build_start_message(self, options):
56+
@classmethod
57+
def build_start_message(cls, options):
5758
options[ACTION] = START
5859
return options
5960

60-
def build_closing_message(self):
61+
@classmethod
62+
def build_closing_message(cls):
6163
return json.dumps({ACTION: STOP}).encode('utf8')
6264

63-
def extract_transcripts(self, alternatives):
65+
@classmethod
66+
def extract_transcripts(cls, alternatives):
6467
transcripts = []
6568
for alternative in alternatives:
6669
transcript = {}

0 commit comments

Comments
 (0)