Skip to content

pr.tree_ul.expanded_folders references wrong object #95

@Pluglug

Description

@Pluglug

Overview

editors/base.py:on_pm_rename() uses pr.tree_ul.expanded_folders but this is incorrect.

Problem

  • pr.tree_ul returns the PME_UL_pm_tree class, not an instance
  • expanded_folders is an instance attribute of TreeState, not a class attribute of PME_UL_pm_tree
  • This causes AttributeError: type object 'PME_UL_pm_tree' has no attribute 'expanded_folders'

Current Workaround

Changed to use tree_state.expanded_folders directly (commit pending).

Root Cause

The tree_ul property in preferences.py returns the class itself:

@property
def tree_ul(self):
    return PME_UL_pm_tree

This worked previously because expanded_folders may have been a class attribute, but after the tree.py refactoring it became an instance attribute of TreeState.

Recommended Fix

Either:

  1. Remove pr.tree_ul property and use tree_state directly everywhere
  2. Or make tree_ul return tree_state instead of the class

Related: Phase 9-X extend_target implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions