Skip to content

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/splinterbot master
git merge --ff-only FETCH_HEAD
git reset HEAD^

cart = panelBrowser.parse_shopping_cart()

return cart
return panelBrowser.parse_shopping_cart()
Copy link
Author

Choose a reason for hiding this comment

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

Function EnrollmentChecker.check_shopping_cart refactored with the following changes:


def nav_home(self):
self.driver.visit('http://' + self.domain)
self.driver.visit(f'http://{self.domain}')
Copy link
Author

Choose a reason for hiding this comment

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

Function MyRedBrowser.nav_home refactored with the following changes:

Comment on lines -36 to +37
if not self.domain in self.driver.url:
self.driver.visit('http://' + self.domain)
if self.domain not in self.driver.url:
self.driver.visit(f'http://{self.domain}')
Copy link
Author

Choose a reason for hiding this comment

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

Function WFBrowser.nav_home refactored with the following changes:

optionValues = [el.value for el in optionEls]

return optionValues
return [el.value for el in optionEls]
Copy link
Author

Choose a reason for hiding this comment

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

Function WFBrowser.option_values_of_select refactored with the following changes:

Comment on lines -31 to +32
username = raw_input(userLabel + ': ')
password = getpass(passLabel + ': ')
username = raw_input(f'{userLabel}: ')
password = getpass(f'{passLabel}: ')
Copy link
Author

Choose a reason for hiding this comment

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

Function LoginManager.ask refactored with the following changes:

Comment on lines +39 to +45
try:
assert len(value) == 2
except (TypeError, AssertionError):
pass
else:
try:
assert len(value) == 2
except (TypeError, AssertionError):
pass
else:
login = LoginManager.Login(*value)
return super(LoginManager, self).__setitem__(key, login)
login = LoginManager.Login(*value)
return super(LoginManager, self).__setitem__(key, login)
Copy link
Author

Choose a reason for hiding this comment

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

Function LoginManager.__setitem__ refactored with the following changes:

def _extend_driver(driver):
def find_by_text(self, text):
return self.find_by_xpath("//*[text()='%s']" % text)
return self.find_by_xpath(f"//*[text()='{text}']")
Copy link
Author

Choose a reason for hiding this comment

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

Function Browser._extend_driver refactored with the following changes:

# avoid colons in the email message
with GmailServer(self.address, self.password) as mailServer:
print('sending: ' + msg)
print(f'sending: {msg}')
Copy link
Author

Choose a reason for hiding this comment

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

Function Gmail.send_email refactored with the following changes:

@sweep-ai-deprecated
Copy link

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

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