Skip to content

Commit

Permalink
cli client, server, online cmd, ignore empty input
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Jun 15, 2024
1 parent e327af0 commit 1898212
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chatbridge/impl/cli/cli_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def on_chat(self, sender: str, payload: ChatPayload):
def console_loop(self):
while True:
text = input()
if len(text) == 0:
continue

self.logger.info('Processing user input "{}"'.format(text))
if text == 'start':
self.start()
Expand Down
3 changes: 3 additions & 0 deletions chatbridge/impl/cli/cli_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def on_chat(self, sender: str, content: ChatPayload):
def console_loop(self):
while self.is_running():
text = input()
if len(text) == 0:
continue

self.logger.info('Processing user input "{}"'.format(text))
if text == 'stop':
self.stop()
Expand Down
3 changes: 3 additions & 0 deletions chatbridge/impl/online/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def console_input_loop():
while True:
try:
text = input()
if len(text) == 0:
continue

if text in ['!!online', 'online']:
print('\n'.join(chatClient.query()))
elif text == 'stop':
Expand Down

0 comments on commit 1898212

Please sign in to comment.