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

frontend: Revamp Import #2633

Closed
wants to merge 4 commits into from
Closed

frontend: Revamp Import #2633

wants to merge 4 commits into from

Conversation

TheEvilSkeleton
Copy link
Contributor

@TheEvilSkeleton TheEvilSkeleton commented Jan 29, 2023

Description

This removes the redundant Import page with entries in the primary menu.

image

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
  • UI

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 29, 2023

Pylint result on modfied files:
************* Module bottles.frontend.main
bottles/frontend/main.py:27:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:27:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:28:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:28:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:29:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:29:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:53:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:54:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:56:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:58:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:62:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:67:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:70:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:70:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:89:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:93:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:93:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:93:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:94:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:95:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:95:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:96:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:96:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:97:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:97:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:98:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:98:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:186:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:186:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:186:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:186:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:209:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:209:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:213:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:213:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:214:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:217:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:217:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:217:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:217:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/main.py:33:0: C0413: Import "from gi.repository import Gtk, Gio, Gdk, GLib, GObject, Adw" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:33:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/main.py:35:0: W0401: Wildcard import bottles.frontend.params (wildcard-import)
bottles/frontend/main.py:35:0: C0413: Import "from bottles.frontend.params import *" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:36:0: C0413: Import "from bottles.backend.logger import Logger" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:37:0: C0413: Import "from bottles.frontend.windows.main_window import MainWindow" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:38:0: C0413: Import "from bottles.frontend.views.preferences import PreferencesWindow" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:39:0: C0413: Import "from bottles.backend.health import HealthChecker" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:40:0: C0413: Import "from bottles.backend.utils.threading import RunAsync" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:41:0: C0413: Import "from bottles.backend.managers.backup import BackupManager" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:43:0: C0413: Import "from bottles.frontend.utils.filters import add_yaml_filters, add_all_filters" should be placed at the top of the module (wrong-import-position)
bottles/frontend/main.py:54:0: C0103: Constant name "base_dir" doesn't conform to UPPER_CASE naming style (invalid-name)
bottles/frontend/main.py:175:12: R1722: Consider using 'sys.exit' instead (consider-using-sys-exit)
bottles/frontend/main.py:181:12: W0105: String statement has no effect (pointless-string-statement)
bottles/frontend/main.py:185:16: C0103: Variable name "a" doesn't conform to snake_case naming style (invalid-name)
bottles/frontend/main.py:216:8: W0621: Redefining name 'subprocess' from outer scope (line 24) (redefined-outer-name)
bottles/frontend/main.py:203:12: C0415: Import outside toplevel (bottles.frontend.windows.bottlepicker.BottlePickerDialog) (import-outside-toplevel)
bottles/frontend/main.py:216:8: W0404: Reimport 'subprocess' (imported line 24) (reimported)
bottles/frontend/main.py:216:8: C0415: Import outside toplevel (subprocess) (import-outside-toplevel)
bottles/frontend/main.py:217:8: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
bottles/frontend/main.py:196:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
bottles/frontend/main.py:251:8: R1722: Consider using 'sys.exit' instead (consider-using-sys-exit)
bottles/frontend/main.py:245:15: W0613: Unused argument 'action' (unused-argument)
bottles/frontend/main.py:245:28: W0613: Unused argument 'param' (unused-argument)
bottles/frontend/main.py:254:15: W0613: Unused argument 'action' (unused-argument)
bottles/frontend/main.py:254:28: W0613: Unused argument 'param' (unused-argument)
bottles/frontend/main.py:262:24: W0613: Unused argument 'action' (unused-argument)
bottles/frontend/main.py:262:37: W0613: Unused argument 'param' (unused-argument)
bottles/frontend/main.py:270:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/main.py:274:4: W1113: Keyword argument before variable positional arguments list in the definition of __show_importer_view function (keyword-arg-before-vararg)
bottles/frontend/main.py:274:35: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/main.py:274:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/main.py:372:40: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/main.py:435:8: W0622: Redefining built-in 'filter' (redefined-builtin)
bottles/frontend/main.py:412:40: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/main.py:262:4: W0238: Unused private member `Bottles.__refresh(self, action=None, param=None)` (unused-private-member)
bottles/frontend/main.py:274:4: W0238: Unused private member `Bottles.__show_importer_view(self, widget=False, *args)` (unused-private-member)
bottles/frontend/main.py:240:8: W0201: Attribute 'win' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/main.py:241:8: W0201: Attribute 'manager' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/main.py:448:9: W0613: Unused argument 'version' (unused-argument)
bottles/frontend/main.py:20:0: C0411: standard import "import os" should be placed before "import gi" (wrong-import-order)
bottles/frontend/main.py:21:0: C0411: standard import "import gettext" should be placed before "import gi" (wrong-import-order)
bottles/frontend/main.py:22:0: C0411: standard import "import locale" should be placed before "import gi" (wrong-import-order)
bottles/frontend/main.py:23:0: C0411: standard import "import webbrowser" should be placed before "import gi" (wrong-import-order)
bottles/frontend/main.py:24:0: C0411: standard import "import subprocess" should be placed before "import gi" (wrong-import-order)
bottles/frontend/main.py:25:0: C0411: standard import "from os import path" should be placed before "import gi" (wrong-import-order)
bottles/frontend/main.py:24:0: W0611: Unused import subprocess (unused-import)
bottles/frontend/main.py:33:0: W0611: Unused Gdk imported from gi.repository (unused-import)
bottles/frontend/main.py:35:0: W0614: Unused import(s) APP_NAME_LOWER, APP_ID, BUILD_TYPE, ANIM_DURATION, EXECUTABLE_EXTS and DOC_URL from wildcard import of bottles.frontend.params (unused-wildcard-import)
************* Module bottles.frontend.windows.main_window
bottles/frontend/windows/main_window.py:53:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/main_window.py:55:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/main_window.py:171:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/main_window.py:196:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/main_window.py:196:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/frontend/windows/main_window.py:24:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/windows/main_window.py:36:0: W0401: Wildcard import bottles.frontend.const (wildcard-import)
bottles/frontend/windows/main_window.py:38:0: W0401: Wildcard import bottles.frontend.params (wildcard-import)
bottles/frontend/windows/main_window.py:124:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/windows/main_window.py:151:35: W0613: Unused argument 'status' (unused-argument)
bottles/frontend/windows/main_window.py:168:41: W0613: Unused argument 'error' (unused-argument)
bottles/frontend/windows/main_window.py:253:32: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:257:32: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:261:32: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:268:28: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:272:29: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:275:30: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:275:44: W0613: Unused argument 'view' (unused-argument)
bottles/frontend/windows/main_window.py:290:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/frontend/windows/main_window.py:311:12: C0103: Variable name "w" doesn't conform to snake_case naming style (invalid-name)
bottles/frontend/windows/main_window.py:314:4: R0913: Too many arguments (6/5) (too-many-arguments)
bottles/frontend/windows/main_window.py:328:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/windows/main_window.py:344:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/windows/main_window.py:351:8: R1722: Consider using 'sys.exit' instead (consider-using-sys-exit)
bottles/frontend/windows/main_window.py:354:17: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/windows/main_window.py:176:12: W0201: Attribute 'page_details' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/windows/main_window.py:177:12: W0201: Attribute 'page_list' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/windows/main_window.py:178:12: W0201: Attribute 'page_library' defined outside __init__ (attribute-defined-outside-init)
bottles/frontend/windows/main_window.py:54:0: R0904: Too many public methods (24/20) (too-many-public-methods)
bottles/frontend/windows/main_window.py:38:0: W0614: Unused import(s) APP_NAME, APP_NAME_LOWER, APP_VERSION, APP_ICON, ANIM_DURATION, EXECUTABLE_EXTS and DOC_URL from wildcard import of bottles.frontend.params (unused-wildcard-import)

@TheEvilSkeleton
Copy link
Contributor Author

TheEvilSkeleton commented Jan 29, 2023

I'm getting this error while trying to import a configuration:

15:58:52 (INFO) Importing backup: backup_test__113.yml 
15:58:52 (ERROR) Error while running async job: <function BackupManager.import_backup at 0x7f7b50e64700>
	Exception: 'NoneType' object has no attribute 'create_bottle_from_config'
 
  File "/var/home/TheEvilSkeleton/Projects/Bottles/build/share/bottles/bottles/backend/utils/threading.py", line 59, in __target
    result = self.task_func(*args, **kwargs)
  File "/var/home/TheEvilSkeleton/Projects/Bottles/build/share/bottles/bottles/backend/managers/backup.py", line 114, in import_backup
    if config_load.status and manager.create_bottle_from_config(config_load.data):
Exception in thread Thread-12 (__target):
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/var/home/TheEvilSkeleton/Projects/Bottles/build/share/bottles/bottles/backend/utils/threading.py", line 70, in __target
    self.callback(result, error)
  File "/var/home/TheEvilSkeleton/Projects/Bottles/build/share/bottles/bottles/frontend/main.py", line 373, in finish
    if result.status:
AttributeError: 'AttributeError' object has no attribute 'status'

@StoneMoe
Copy link
Contributor

StoneMoe commented Feb 27, 2023

I'm getting this error while trying to import a configuration:

This is caused by a piece of overlooked code during backend rewrite, fixing in #2749.

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import: Interface confusing
2 participants