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

Minor improvements #2531

Closed
wants to merge 13 commits into from
Closed

Minor improvements #2531

wants to merge 13 commits into from

Conversation

TheEvilSkeleton
Copy link
Contributor

@TheEvilSkeleton TheEvilSkeleton commented Jan 13, 2023

Description

This optimizes the app by reducing the codebase by using built-in GTK features. I also spent the time to make the code more consistent.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.

  • Locally

@github-actions
Copy link
Contributor

github-actions bot commented Jan 31, 2023

Pylint result on modfied files:
************* Module bottles.backend.health
bottles/backend/health.py:192:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/health.py:194:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/health.py:196:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/health.py:80:8: C0103: Attribute name "ImageMagick" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:81:8: C0103: Attribute name "FVS" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:121:4: C0103: Method name "check_ImageMagick" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:127:12: C0415: Import outside toplevel (icoextract) (import-outside-toplevel)
bottles/backend/health.py:127:12: W0611: Unused import icoextract (unused-import)
bottles/backend/health.py:135:12: C0415: Import outside toplevel (pefile) (import-outside-toplevel)
bottles/backend/health.py:135:12: W0611: Unused import pefile (unused-import)
bottles/backend/health.py:143:12: C0415: Import outside toplevel (markdown) (import-outside-toplevel)
bottles/backend/health.py:143:12: W0611: Unused import markdown (unused-import)
bottles/backend/health.py:151:12: C0415: Import outside toplevel (orjson) (import-outside-toplevel)
bottles/backend/health.py:151:12: W0611: Unused import orjson (unused-import)
bottles/backend/health.py:157:4: C0103: Method name "check_FVS" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:159:12: C0415: Import outside toplevel (fvs.repo.FVSRepo) (import-outside-toplevel)
bottles/backend/health.py:159:12: W0611: Unused FVSRepo imported from fvs.repo (unused-import)
bottles/backend/health.py:165:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
bottles/backend/health.py:192:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/health.py:244:15: C0103: Variable name "v" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:33:0: R0904: Too many public methods (21/20) (too-many-public-methods)
bottles/backend/health.py:20:0: C0411: standard import "import shutil" should be placed before "from bottles.backend.utils import yaml" (wrong-import-order)
bottles/backend/health.py:21:0: C0411: standard import "import contextlib" should be placed before "from bottles.backend.utils import yaml" (wrong-import-order)
************* Module bottles.frontend.windows.fsr
bottles/frontend/windows/fsr.py:84:0: C0305: Trailing newlines (trailing-newlines)
bottles/frontend/windows/fsr.py:24:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/fsr.py:26:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/fsr.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/fsr.py:72:8: C0206: Consider iterating with .items() (consider-using-dict-items)
bottles/frontend/windows/fsr.py:72:23: C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
bottles/frontend/windows/fsr.py:25:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.windows.vmtouch
bottles/frontend/windows/vmtouch.py:66:0: C0305: Trailing newlines (trailing-newlines)
bottles/frontend/windows/vmtouch.py:23:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/vmtouch.py:25:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/vmtouch.py:20:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/vmtouch.py:54:8: C0206: Consider iterating with .items() (consider-using-dict-items)
bottles/frontend/windows/vmtouch.py:54:23: C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
bottles/frontend/windows/vmtouch.py:24:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.windows.exclusionpatterns
bottles/frontend/windows/exclusionpatterns.py:21:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/exclusionpatterns.py:23:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/exclusionpatterns.py:60:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/exclusionpatterns.py:62:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/exclusionpatterns.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/exclusionpatterns.py:22:0: R0903: Too few public methods (0/2) (too-few-public-methods)
bottles/frontend/windows/exclusionpatterns.py:61:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.windows.dlloverrides
bottles/frontend/windows/dlloverrides.py:21:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/dlloverrides.py:23:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/dlloverrides.py:49:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/dlloverrides.py:80:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/dlloverrides.py:82:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/dlloverrides.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/dlloverrides.py:22:0: R0903: Too few public methods (0/2) (too-few-public-methods)
bottles/frontend/windows/dlloverrides.py:81:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.windows.gamescope
bottles/frontend/windows/gamescope.py:110:0: C0305: Trailing newlines (trailing-newlines)
bottles/frontend/windows/gamescope.py:21:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/gamescope.py:23:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/gamescope.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/gamescope.py:56:29: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/gamescope.py:98:8: C0206: Consider iterating with .items() (consider-using-dict-items)
bottles/frontend/windows/gamescope.py:98:23: C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
bottles/frontend/windows/gamescope.py:22:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.windows.envvars
bottles/frontend/windows/envvars.py:23:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/envvars.py:25:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/envvars.py:74:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/envvars.py:76:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/envvars.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/envvars.py:24:0: R0903: Too few public methods (0/2) (too-few-public-methods)
bottles/frontend/windows/envvars.py:99:8: W0201: Attribute '__valid_name' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/windows/envvars.py:109:12: W0201: Attribute '__valid_name' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/windows/envvars.py:75:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.windows.drives
bottles/frontend/windows/drives.py:24:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/drives.py:26:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/drives.py:91:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/drives.py:93:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/drives.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/drives.py:25:0: R0903: Too few public methods (0/2) (too-few-public-methods)
bottles/frontend/windows/drives.py:110:23: E0602: Undefined variable 'window' (undefined-variable)
bottles/frontend/windows/drives.py:136:8: C0206: Consider iterating with .items() (consider-using-dict-items)
bottles/frontend/windows/drives.py:92:0: R0903: Too few public methods (0/2) (too-few-public-methods)
bottles/frontend/windows/drives.py:21:0: C0411: standard import "from string import ascii_uppercase" should be placed before "from gi.repository import Gtk, GLib, Adw" (wrong-import-order)
************* Module bottles.frontend.windows.sandbox
bottles/frontend/windows/sandbox.py:21:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/sandbox.py:23:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/sandbox.py:18:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/sandbox.py:37:23: E0602: Undefined variable 'window' (undefined-variable)
bottles/frontend/windows/sandbox.py:45:25: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/sandbox.py:22:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module bottles.frontend.views.bottle_preferences
bottles/frontend/views/bottle_preferences.py:1:0: C0302: Too many lines in module (1113/1000) (too-many-lines)
bottles/frontend/views/bottle_preferences.py:430:13: W0511: "vista": "Windows Vista", # TODO: implement this in the backend (fixme)
bottles/frontend/views/bottle_preferences.py:55:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/views/bottle_preferences.py:57:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/views/bottle_preferences.py:166:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/views/bottle_preferences.py:23:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/views/bottle_preferences.py:172:8: W0105: String statement has no effect (pointless-string-statement)
bottles/frontend/views/bottle_preferences.py:177:8: W0105: String statement has no effect (pointless-string-statement)
bottles/frontend/views/bottle_preferences.py:186:8: W0105: String statement has no effect (pointless-string-statement)
bottles/frontend/views/bottle_preferences.py:272:8: W0212: Access to a protected member __library of a client class (protected-access)
bottles/frontend/views/bottle_preferences.py:285:25: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:513:40: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:520:39: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:527:34: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:545:48: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:552:38: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:559:28: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:566:43: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:574:38: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:602:32: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:611:30: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:620:32: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:629:27: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:638:29: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:658:32: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:667:33: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:676:31: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:685:31: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:694:37: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:703:36: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:712:46: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:742:39: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:751:43: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:760:31: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:773:16: C0103: Variable name "w" doesn't conform to snake_case naming style (invalid-name)
bottles/frontend/views/bottle_preferences.py:789:41: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/views/bottle_preferences.py:828:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1002:19: W0613: Unused argument 'result' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1002:27: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1012:8: C0103: Variable name "rk" doesn't conform to snake_case naming style (invalid-name)
bottles/frontend/views/bottle_preferences.py:1039:40: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1048:30: W0613: Unused argument 'status' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1048:43: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1060:31: W0613: Unused argument 'status' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1060:44: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1072:31: W0613: Unused argument 'status' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1072:44: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1089:37: W0613: Unused argument 'status' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1089:50: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/views/bottle_preferences.py:1102:17: R1719: The if expression can be replaced with 'not test' (simplifiable-if-expression)
bottles/frontend/views/bottle_preferences.py:1104:12: C0103: Variable name "w" doesn't conform to snake_case naming style (invalid-name)
bottles/frontend/views/bottle_preferences.py:272:8: W0238: Unused private member `PreferencesView.__library` (unused-private-member)
bottles/frontend/views/bottle_preferences.py:247:16: W0201: Attribute '__valid_name' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/views/bottle_preferences.py:250:8: W0201: Attribute '__valid_name' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/views/bottle_preferences.py:256:12: W0201: Attribute '__valid_name' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/views/bottle_preferences.py:423:8: W0201: Attribute 'windows_versions' defined outside __init__ (attribute-defined-outside-init)

@TheEvilSkeleton TheEvilSkeleton added this to the 52.0 milestone Feb 20, 2023
@orowith2os
Copy link
Contributor

Is there any reason why this is a draft? The changes themselves are minor enough to not be considered such.

This was referenced Sep 27, 2023
@TheEvilSkeleton
Copy link
Contributor Author

Closing this as I won't be working on it anymore

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.

None yet

2 participants