Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery Starbot ⭐ refactored uri-tech/p-2022-091 #212

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

Conversation

SourceryAI
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/p-2022-091 master
git merge --ff-only FETCH_HEAD
git reset HEAD^

print("{} wrote:".format(self.client_address[0]))
print(f"{self.client_address[0]} wrote:")
Copy link
Author

Choose a reason for hiding this comment

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

Function CustomTCPHandler.handle refactored with the following changes:

print("{} wrote:".format(self.client_address[1]))
print(f"{self.client_address[1]} wrote:")
Copy link
Author

Choose a reason for hiding this comment

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

Function CustomTCPHandler.handle refactored with the following changes:

print("{} wrote:".format(self.client_address[0]))
print(f"{self.client_address[0]} wrote:")
Copy link
Author

Choose a reason for hiding this comment

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

Function CustomTCPHandler.handle refactored with the following changes:

print("{} wrote:".format(self.client_address[0]))
print(f"{self.client_address[0]} wrote:")
Copy link
Author

Choose a reason for hiding this comment

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

Function CustomTCPHandler.handle refactored with the following changes:

while(True):
while True:
Copy link
Author

Choose a reason for hiding this comment

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

Function ClientThread refactored with the following changes:

RANGE_CONNECTION_TIME: tuple = tuple((114, 124))
RANGE_CONNECTION_TIME: tuple = 114, 124
Copy link
Author

Choose a reason for hiding this comment

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

Lines 8-8 refactored with the following changes:

Comment on lines -33 to +42
if(time()-self.startTime < maxConnectionTime):
if (time()-self.startTime < maxConnectionTime):
# self.request is the TCP socket connected to the client
self.data = self.request.recv(1024).strip()
print("{} wrote:".format(self.client_address[0]))
print(f"{self.client_address[0]} wrote:")
print(self.data)
# just send back the same data, but upper-cased
self.request.sendall(self.data.upper())
# self.request is the TCP socket connected to the client
# self.request is the TCP socket connected to the client
else:
print(f"finish transmition with client")
print("finish transmition with client")
Copy link
Author

Choose a reason for hiding this comment

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

Function CustomTCPHandler.handle refactored with the following changes:

response = bytes("{}: {}".format(cur_thread.name, data), 'ascii')
response = bytes(f"{cur_thread.name}: {data}", 'ascii')
Copy link
Author

Choose a reason for hiding this comment

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

Function ThreadedTCPRequestHandler.handle refactored with the following changes:

print("Received: {}".format(response))
print(f"Received: {response}")
Copy link
Author

Choose a reason for hiding this comment

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

Function client refactored with the following changes:

print("{} wrote:".format(self.client_address[0]))
print(f"{self.client_address[0]} wrote:")
Copy link
Author

Choose a reason for hiding this comment

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

Function MyTCPHandler2.handle 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