Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation error in hono_events.py #344

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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