Skip to content

Sourcery Starbot ⭐ refactored ryanwalder/i3blocks-cryptocurrency#1

Open
SourceryAI wants to merge 1 commit intoryanwalder:masterfrom
SourceryAI:master
Open

Sourcery Starbot ⭐ refactored ryanwalder/i3blocks-cryptocurrency#1
SourceryAI wants to merge 1 commit intoryanwalder:masterfrom
SourceryAI:master

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

Comment on lines -62 to +73
if args.polybar:
change_direction = '%{F#00ff00}↑%{F-}'
else:
change_direction = '↑'
change_direction = '%{F#00ff00}↑%{F-}' if args.polybar else '↑'
else:
change = str(change)
change = '-{}{}'.format(lookup[fiat], change[1:])
if args.polybar:
change_direction = '%{F#f00}↓%{F-}'
else:
change_direction = '↓'

change_direction = '%{F#f00}↓%{F-}' if args.polybar else '↓'
if diff_price > 0:
diff_price = '{}{}'.format(lookup[fiat], diff_price)
if args.polybar:
diff_direction = '%{F#00ff00}↑%{F-}'
else:
diff_direction = '↑'
diff_direction = '%{F#00ff00}↑%{F-}' if args.polybar else '↑'
else:
str(diff_price)
diff_price = '-{}{}'.format(lookup[fiat], diff_price)
if args.polybar:
diff_direction = '%{F#f00}↓%{F-}'
else:
diff_direction = '↓'

diff_direction = '%{F#f00}↓%{F-}' if args.polybar else '↓'
Copy link
Author

Choose a reason for hiding this comment

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

Lines 62-87 refactored with the following changes:

  • Replace if statement with if expression (assign-if-exp)

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