Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Sourcery refactored master branch #3

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

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Oct 27, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

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

Review changes via command line

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

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from larsenv October 27, 2023 16:16
log("u32 out of range: %s" % data, "INFO")
log(f"u32 out of range: {data}", "INFO")
Copy link
Author

Choose a reason for hiding this comment

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

Function u32 refactored with the following changes:

Comment on lines -36 to +39
else:
checkResult = check_output(
"wiino check {}".format(wiino), shell=True, universal_newlines=True
)
if int(checkResult) == 0:
return True
else:
return False
checkResult = check_output(
f"wiino check {wiino}", shell=True, universal_newlines=True
)
return int(checkResult) == 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 checkWiino refactored with the following changes:

Comment on lines -108 to +104
if len(mac) == 12 and mac.upper()[:6] in oui:
return True
else:
return False
return len(mac) == 12 and mac.upper()[:6] in oui
Copy link
Author

Choose a reason for hiding this comment

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

Function verifyMac refactored with the following changes:

Comment on lines -212 to -223
if storedIP != None:
if storedIP[0] == "None": # allows admins to reset a mii's IP
pass

elif storedIP[0] != ip:
pass
# result(610) #current IP address is different from the one the mii was initially uploaded with

else:
pass
# result(610)

Copy link
Author

Choose a reason for hiding this comment

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

Lines 212-223 refactored with the following changes:

This removes the following comments ( why? ):

# result(610)
# allows admins to reset a mii's IP
# result(610) #current IP address is different from the one the mii was initially uploaded with

Comment on lines -33 to +46
artisans.append(form["craftsno1"].value)
artisans.append(form["craftsno2"].value)
artisans.append(form["craftsno3"].value)
artisans.extend(
(
form["craftsno1"].value,
form["craftsno2"].value,
form["craftsno3"].value,
)
)
judgingMiis = True

except KeyError:
artisans.append(form["craftsno1"].value)
judgingMiis = False

if judgingMiis == True:
if judgingMiis:
Copy link
Author

Choose a reason for hiding this comment

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

Lines 33-59 refactored with the following changes:

Comment on lines -54 to -55
headers = "\t<tr>\n" + "".join(headers) + "\t</tr>\n"

Copy link
Author

Choose a reason for hiding this comment

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

Lines 54-86 refactored with the following changes:

if 232 < (0xD4A50FFF < num) + (crc & 0xFF):
if (num > 0xD4A50FFF) + (crc & 0xFF) > 232:
Copy link
Author

Choose a reason for hiding this comment

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

Function decToEntry refactored with the following changes:

Comment on lines -54 to -55
headers = "\t<tr>\n" + "".join(headers) + "\t</tr>\n"

Copy link
Author

Choose a reason for hiding this comment

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

Lines 54-86 refactored with the following changes:

if 232 < (0xD4A50FFF < num) + (crc & 0xFF):
if (num > 0xD4A50FFF) + (crc & 0xFF) > 232:
Copy link
Author

Choose a reason for hiding this comment

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

Function decToEntry refactored with the following changes:

mii_filename = "/var/www/rc24/wapp.wii.com/miicontest/public_html/render/entry-{}.mii".format(
entryno
)
mii_filename = f"/var/www/rc24/wapp.wii.com/miicontest/public_html/render/entry-{entryno}.mii"
Copy link
Author

Choose a reason for hiding this comment

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

Lines 80-100 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.

0 participants