Skip to content

Conversation

@Wolfmyths
Copy link

Hello, I see this python file has some syntax issues so I figured I'd try and clean things up, I cannot test this code nor know how so I advise to test this first before merging

[Addition] Added a requirements.txt to make it easier to install needed python packages (Needs confirmation if using correct packages and package versions)

[Bugfix] Fixed syntax errors that had unneeded semicolons and func calls that had missing parentheses

[Refactor] Refactored str2bool():

  • Function now accepts falsey values rather than only checking for true values
  • Replaced tuple literal with a set literal (in operator has a faster time complexity when used with a set rather than a tuple)
  • If a non-valid param is entered, will raise an exception

[Refactor] Replaced a lengthy use of string concats with a f-string in updateOSD()

[Refactor] Simplified some logical expressions in if statements

[Refactor] Made exceptions in except blocks include error description when logged

[Addition] Added a requirements.txt to make it easier to install needed python packages

[Bugfix] Fixed syntax errors that had unneeded semicolons and func calls that had missing parentheses

[Refactor] Refactored str2bool():
 + Function now accepts falsey values
 + Replaced tuple literal with a set literal (Faster time complexity with in operator)
 + If a non-valid param is entered, will raise an exception

[Refactor] Replaced a lengthy use of string concats with a f-string

[Refactor] Simplified some logical expressions in if statements

[Refactor] Made exceptions in except blocks include error description when logged
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