Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Sourcery Starbot ⭐ refactored Querela/termux-usb-python #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sourcery-ai-bot
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/termux-usb-python master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Comment on lines -174 to +178
+ "\n".join(["{:>12}: {}".format(k, repr(v)) for k, v in namespace.items()])
+ "\n"
)
+ "\n".join(
"{:>12}: {}".format(k, repr(v)) for k, v in namespace.items()
)
) + "\n"

Copy link
Author

Choose a reason for hiding this comment

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

Function shell_usbdevice refactored with the following changes:

Comment on lines -248 to +250
return -1 != self.buf.find(expected)
return self.buf.find(expected) != -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 Buffer.contains refactored with the following changes:

Comment on lines -272 to +274
if duration is not None:
self.target_time = self.TIME() + duration
else:
self.target_time = None
self.target_time = self.TIME() + duration if duration is not None else None
Copy link
Author

Choose a reason for hiding this comment

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

Function Timeout.__init__ refactored with the following changes:

Comment on lines -289 to +293
if delta > self.duration:
# clock jumped, recalculate
self.target_time = self.TIME() + self.duration
return self.duration
else:
if delta <= self.duration:
return max(0, delta)

# clock jumped, recalculate
self.target_time = self.TIME() + self.duration
return self.duration
Copy link
Author

Choose a reason for hiding this comment

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

Function Timeout.time_left refactored with the following changes:

Comment on lines -466 to +465
ret = self._device.ctrl_transfer(
return self._device.ctrl_transfer(
Copy link
Author

Choose a reason for hiding this comment

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

Function CP210xSerial.send_ctrl_cmd refactored with the following changes:

Comment on lines -865 to +857
if -1 == data_peek.find(expected):
if data_peek.find(expected) == -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 CP210xSerial.read_until_or_none refactored with the following changes:

Comment on lines -1104 to +1096
if ret < 0:
return False

return True
return ret >= 0
Copy link
Author

Choose a reason for hiding this comment

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

Function CP210xSerial.prepare_usb_cp210x refactored with the following changes:

Comment on lines -1129 to +1118
text = "".join([chr(v) for v in data])
text = "".join(chr(v) for v in data)
Copy link
Author

Choose a reason for hiding this comment

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

Function CP210xSerial.read_dump_forever refactored with the following changes:

text = "".join([chr(v) for v in data])
text = "".join(chr(v) for v in data)
Copy link
Author

Choose a reason for hiding this comment

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

Function dump_test.dumper refactored with the following changes:

text = "".join([chr(v) for v in data])
text = "".join(chr(v) for v in data)
Copy link
Author

Choose a reason for hiding this comment

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

Function buf_test.dumper refactored with the following changes:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant