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

small refactor: reuse code, increase readability #130

Merged
merged 3 commits into from
May 19, 2023
Merged

small refactor: reuse code, increase readability #130

merged 3 commits into from
May 19, 2023

Conversation

nobkd
Copy link
Contributor

@nobkd nobkd commented May 17, 2023

bin/opi

  • update search regex: (L24)
    • \d for 0-9
    • * instead of {0,}

opi/__init__.py

  • saving the results of get_cpu_arch() in a variable to reuse them (L307-320)
  • simplify if statement for setting the weight of a result (L348)
  • deduplicate URL building for GPG key in install_binary() (L394)
  • use default math function log10() instead of log() with parameter 10 (L443)
  • default_answer for ask_yes_or_no() is now 'y' (L423, plugins) ⇾ if not liked, I can undo the last commit

opi/plugins/__init__.py

  • removing (object) inheritance as not needed in python3
  • use str.endswith() instead of string comparison by range (L23)

opi/config/__init__.py

  • remove unused code

opi/plugins/yandex-browser.py

  • get last part of split string with [-1] instead of [2]

  • some minimal changes

@asdil12 asdil12 merged commit 137ca90 into openSUSE:master May 19, 2023
@nobkd nobkd deleted the fix/code branch May 19, 2023 12:04
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.

2 participants