Skip to content

Commit 8a6649d

Browse files
authored
Merge pull request #21 from FoamyGuy/fix_format
code format and pylint fixes
2 parents 91bc610 + c0fb6e7 commit 8a6649d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

adafruit_gc_iot_core.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -345,22 +345,27 @@ def generate_jwt(self, ttl=43200, algo="RS256"):
345345
self.logger.debug("Generating JWT...")
346346

347347
if self._esp is not None:
348-
# Not all boards have ESP access easily (eg: featherS2). If we pass in a False or None in init, lets
348+
# Not all boards have ESP access easily (eg: featherS2).
349+
# If we pass in a False or None in init, lets
349350
# assume that we've handled setting the RTC outside of here
351+
# pylint: disable=import-outside-toplevel
350352
import adafruit_ntp as NTP
353+
351354
ntp = NTP.NTP(self._esp)
352355
ntp.set_time()
353356
else:
354357
if self.logger:
355-
self.logger.info(f"No self._esp instance found, assuming RTC has been previously set")
358+
self.logger.info(
359+
"No self._esp instance found, assuming RTC has been previously set"
360+
)
356361

357362
claims = {
358363
# The time that the token was issued at
359364
"iat": time.time(),
360365
# The time the token expires.
361366
"exp": time.time() + ttl,
362367
# The audience field should always be set to the GCP project id.
363-
"aud": self._proj_id
368+
"aud": self._proj_id,
364369
}
365370
jwt = JWT.generate(claims, self._private_key, algo)
366371
return jwt

0 commit comments

Comments
 (0)