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

AttributeError: 'Page' object has no attribute 'window' #258

Open
martonmiklos opened this issue Sep 26, 2024 · 5 comments
Open

AttributeError: 'Page' object has no attribute 'window' #258

martonmiklos opened this issue Sep 26, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@martonmiklos
Copy link
Contributor

I tried to run the current main branch and I got:
kép

I am running KDE Neon (technically it is a 22.04 Ubuntu), all requirements were installed with pip -r
Flet version is 0.22.1

Any advice would be recommended!

@T0jan
Copy link
Collaborator

T0jan commented Sep 30, 2024

Could you please add which version of Ki-nTree you are using and any output which is generated in the (python) console you are running Ki-nTree from?

@martonmiklos
Copy link
Contributor Author

here is the command line output:

[INFO]  TEMPLATE "internal_part_number.yaml" configuration file contains the following keys which are NOT in your user settings: {'IPN_USE_MANUFACTURER_PART_NUMBER'}
[INFO]  TEMPLATE "general.yaml" configuration file contains the following keys which are NOT in your user settings: {'CHECK_EXISTING'}
[INFO]  TEMPLATE "supplier_parameters.yaml" configuration file contains the following keys which are NOT in your user settings: {'Passives', 'Base'}
[INFO]  TEMPLATE "suppliers.yaml" configuration file contains the following keys which are NOT in your user settings: {'Jameco', 'AutomationDirect'}
package:media_kit_libs_linux registered.
Unhandled error processing page session : Traceback (most recent call last):
  File "/home/mm/.local/lib/python3.10/site-packages/flet_runtime/app.py", line 242, in on_session_created
    await asyncio.get_running_loop().run_in_executor(
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/gui.py", line 46, in kintree_gui
    init_gui(page)
  File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/gui.py", line 29, in init_gui
    page.window.icon = os.path.join(settings.PROJECT_DIR, 'gui', 'logo.ico')
AttributeError: 'Page' object has no attribute 'window'

I am trying it with the code in the main branch.
The 1.1.3 loads, however I needed to remove the .config/kintree folder as it failed with:

mm@P15:~/Projektek/inventree2/Ki-nTree$ python kintree_gui.py 
[INFO]  TEMPLATE "internal_part_number.yaml" configuration file contains the following keys which are NOT in your user settings: {'IPN_USE_MANUFACTURER_PART_NUMBER'}
[INFO]  TEMPLATE "general.yaml" configuration file contains the following keys which are NOT in your user settings: {'CHECK_EXISTING'}
[INFO]  TEMPLATE "supplier_parameters.yaml" configuration file contains the following keys which are NOT in your user settings: {'Base', 'Passives'}
[INFO]  TEMPLATE "suppliers.yaml" configuration file contains the following keys which are NOT in your user settings: {'AutomationDirect', 'Jameco'}
package:media_kit_libs_linux registered.
Unhandled error processing page session : Traceback (most recent call last):
  File "/home/mm/.local/lib/python3.10/site-packages/flet_runtime/app.py", line 242, in on_session_created
    await asyncio.get_running_loop().run_in_executor(
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/gui.py", line 48, in kintree_gui
    inventree_settings_view = InvenTreeSettingsView(page)
  File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/views/settings.py", line 922, in __init__
    super().__init__(page)
  File "/home/mm/Projektek/inventree2/Ki-nTree/kintree/gui/views/settings.py", line 358, in __init__
    self.fields[field_name].value = self.settings[field_data[0]]
KeyError: 'IPN_USE_MANUFACTURER_PART_NUMBER'

I would like to do some developments so getting main working would be my goal.

@eeintech
Copy link
Contributor

eeintech commented Oct 1, 2024

@martonmiklos Flet version is incorrect, how do you install Ki-nTree?

Flet version is now at 0.24.1: flet = "^0.24.1"

@martonmiklos
Copy link
Contributor Author

@eeintech
I installed the reqiurements with pip install -r requirements.txt

In the current main the Flet is set to:
Flet>=0.22.0,<0.23.0
https://github.com/sparkmicro/Ki-nTree/blob/main/requirements.txt#L3C1-L3C21

Manually altering the requirements and installing Flet 0.24.1 get the thing working.

Many thanks for the quick support!

Shall I file a PR on the requirements.txt?

@eeintech
Copy link
Contributor

eeintech commented Oct 7, 2024

@martonmiklos Good point, I will just keep this ticket opened until requirements.txt file is fixed, thanks!

@eeintech eeintech reopened this Oct 7, 2024
@eeintech eeintech added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants