Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented May 24, 2023

Pull Request #1 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/machinekoder/respeaker pull/1/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Help us improve this pull request!


if data[5] == 'ro':
raise ValueError('{} is read-only'.format(name))
raise ValueError(f'{name} is read-only')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Tuning.write refactored with the following changes:

result = response[0] * (2.**response[1])

return result
return response[0] if data[2] == 'int' else response[0] * (2.**response[1])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Tuning.read refactored with the following changes:

Comment on lines -142 to -155
dev = usb.core.find(idVendor=vid, idProduct=pid)
if not dev:
return
if dev := usb.core.find(idVendor=vid, idProduct=pid):
# configuration = dev.get_active_configuration()

# configuration = dev.get_active_configuration()
# interface_number = None
# for interface in configuration:
# interface_number = interface.bInterfaceNumber

# interface_number = None
# for interface in configuration:
# interface_number = interface.bInterfaceNumber
# if dev.is_kernel_driver_active(interface_number):
# dev.detach_kernel_driver(interface_number)

# if dev.is_kernel_driver_active(interface_number):
# dev.detach_kernel_driver(interface_number)

return Tuning(dev)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function find refactored with the following changes:

Comment on lines -168 to +162
print('{}{}'.format(' '*60, extra))
print(f"{' ' * 60}{extra}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant