Skip to content

Commit be5c52b

Browse files
dinkopehargguuss
authored andcommitted
Iot Core - Fix format on print functions (GoogleCloudPlatform#2241)
1 parent 530c8bf commit be5c52b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

iot/api-client/mqtt_example/README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ To run this sample:
110110
--ca_certs CA_CERTS CA root from https://pki.google.com/roots.pem
111111
--cloud_region CLOUD_REGION
112112
GCP cloud region
113+
113114
--data DATA The telemetry data sent on behalf of a device
114115
--device_id DEVICE_ID
115116
Cloud IoT Core device id
@@ -190,4 +191,4 @@ To run this sample:
190191
191192
192193
193-
.. _Google Cloud SDK: https://cloud.google.com/sdk/
194+
.. _Google Cloud SDK: https://cloud.google.com/sdk/

iot/api-client/mqtt_example/cloudiot_mqtt_example.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def listen_for_messages(
240240

241241
seconds_since_issue = (datetime.datetime.utcnow() - jwt_iat).seconds
242242
if seconds_since_issue > 60 * jwt_exp_mins:
243-
print('Refreshing token after {}s').format(seconds_since_issue)
243+
print('Refreshing token after {}s'.format(seconds_since_issue))
244244
jwt_iat = datetime.datetime.utcnow()
245245
client = get_client(
246246
project_id, cloud_region, registry_id, gateway_id,
@@ -284,7 +284,7 @@ def send_data_from_bound_device(
284284
print(gateway_state)
285285
client.publish(gateway_topic, gateway_state, qos=1)
286286

287-
# Publish num_messages mesages to the MQTT bridge
287+
# Publish num_messages messages to the MQTT bridge
288288
for i in range(1, num_messages + 1):
289289
client.loop()
290290

@@ -336,7 +336,7 @@ def parse_command_line_args():
336336
parser.add_argument(
337337
'--ca_certs',
338338
default='roots.pem',
339-
help=('CA root from https://pki.google.com/roots.pem'))
339+
help='CA root from https://pki.google.com/roots.pem')
340340
parser.add_argument(
341341
'--cloud_region', default='us-central1', help='GCP cloud region')
342342
parser.add_argument(
@@ -351,7 +351,7 @@ def parse_command_line_args():
351351
'--jwt_expires_minutes',
352352
default=20,
353353
type=int,
354-
help=('Expiration time, in minutes, for JWT tokens.'))
354+
help='Expiration time, in minutes, for JWT tokens.')
355355
parser.add_argument(
356356
'--listen_dur',
357357
default=60,
@@ -429,7 +429,7 @@ def mqtt_device_demo(args):
429429
args.device_id, args.private_key_file, args.algorithm,
430430
args.ca_certs, args.mqtt_bridge_hostname, args.mqtt_bridge_port)
431431

432-
# Publish num_messages mesages to the MQTT bridge once per second.
432+
# Publish num_messages messages to the MQTT bridge once per second.
433433
for i in range(1, args.num_messages + 1):
434434
# Process network events.
435435
client.loop()
@@ -455,7 +455,7 @@ def mqtt_device_demo(args):
455455
# [START iot_mqtt_jwt_refresh]
456456
seconds_since_issue = (datetime.datetime.utcnow() - jwt_iat).seconds
457457
if seconds_since_issue > 60 * jwt_exp_mins:
458-
print('Refreshing token after {}s').format(seconds_since_issue)
458+
print('Refreshing token after {}s'.format(seconds_since_issue))
459459
jwt_iat = datetime.datetime.utcnow()
460460
client = get_client(
461461
args.project_id, args.cloud_region,

0 commit comments

Comments
 (0)