Skip to content

Commit

Permalink
Fixed linting issues in tshirt_launcher.py and otel_decorators.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr. GPT authored and Mr. GPT committed Jan 7, 2024
1 parent fd3624c commit e5fb208
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/pygptcourse/otel_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.trace import get_tracer_provider, set_tracer_provider

# isort: off
from pygptcourse.credentials import OpenTelemetryCredentials

# isort: on

logging.getLogger().setLevel(logging.INFO)


Expand Down
7 changes: 5 additions & 2 deletions src/pygptcourse/tshirt_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
import usb.core # type: ignore
import usb.util # type: ignore

# isort: off
from pygptcourse.otel_decorators import otel_handler

# isoft: on

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -228,7 +231,7 @@ def send_command(self, command):
self.command = command
self.dev.ctrl_transfer(0x21, 0x09, 0x200, 0, [command])
except usb.core.USBError as e:
logger.warning("SEND ERROR", e)
logger.warning(f"SEND ERROR {e}")

@otel_handler.trace
def move(self, command, duration):
Expand All @@ -237,7 +240,7 @@ def move(self, command, duration):
time.sleep(duration)
self.send_command(STOP)
except usb.core.USBError as e:
logger.warning("SEND ERROR", e)
logger.warning(f"SEND ERROR {e}")

@otel_handler.trace
def fire(self):
Expand Down

0 comments on commit e5fb208

Please sign in to comment.