Skip to content

Commit

Permalink
fix: resolved lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mmubarak0 committed Jul 8, 2024
1 parent bce9fb8 commit 730bebc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/send_ussd.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
DONE = False


def animate():
def animate() -> None:
"""Add a simple loading animation while waiting for the response."""
for c in itertools.cycle(['|', '/', '-', '\\']):
if DONE:
Expand All @@ -57,16 +57,16 @@ def animate():

# Send the ussd code.
try:
if client.ussd.send(code) == ResponseEnum.OK.value:
res = client.ussd.send(code)
if str(res) == ResponseEnum.OK.value:
print(f'\033[95m> {code}\033[0m')
t = threading.Thread(target=animate)
t.start()
else:
print('Error: Cannot send USSD code')
break
except Exception as e:
print(f'Error: {e}')
break
raise e

# Wait for the response from the service provider.
while int(client.ussd.status().get('result', '1')) >= 1:
Expand Down

0 comments on commit 730bebc

Please sign in to comment.