Skip to content

Commit

Permalink
Indentation error in hono_events.py (#344)
Browse files Browse the repository at this point in the history
[#343] Indentation error in hono_events.py

Signed-off-by: Kristiyan Gostev <[email protected]>
  • Loading branch information
k-gostev authored Jun 5, 2024
1 parent 6874c0e commit a4edb62
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions quickstart/hono_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ def on_start(self, event):

def on_message(self, event):
if event.message.body is not None:
body = json.loads(event.message.body)
if topic_filter != "" and topic_filter != body['topic']:
return
print('[event received]')
print(json.dumps(body, indent=2))
else:
print('[empty event received]')
body = json.loads(event.message.body)
if topic_filter != "" and topic_filter != body['topic']:
return
print('[event received]')
print(json.dumps(body, indent=2))
else:
print('[empty event received]')


# Parse command line args
options, reminder = getopt.getopt(sys.argv[1:], 't:f:')
opts_dict = dict(options)
tenant_id = os.environ.get("TENANT") or opts_dict['-t']
if '-f' in opts_dict:
topic_filter = opts_dict['-f']
else:
topic_filter = ""
options, reminder = getopt.getopt(sys.argv[1:], 't:f:')
opts_dict = dict(options)
tenant_id = os.environ.get("TENANT") or opts_dict['-t']
if '-f' in opts_dict:
topic_filter = opts_dict['-f']
else:
topic_filter = ""

uri = 'amqps://hono.eclipseprojects.io:15671'
address = 'event/{}'.format(tenant_id)
Expand Down

0 comments on commit a4edb62

Please sign in to comment.