Skip to content

fix TypeError: 'winrt._winrt_windows_foundation_collections.ValueSet'…#57

Closed
better-er wants to merge 1 commit intoGitHub30:mainfrom
better-er:main
Closed

fix TypeError: 'winrt._winrt_windows_foundation_collections.ValueSet'…#57
better-er wants to merge 1 commit intoGitHub30:mainfrom
better-er:main

Conversation

@better-er
Copy link
Copy Markdown

@better-er better-er commented Jan 10, 2026

… object is not callable & Python version 3.14 does not support the use of 'return' inside a 'finally' clause.

details in issue #56

… object is not callable & Python version 3.14 does not support the use of 'return' inside a 'finally' clause.
Copy link
Copy Markdown

@Radmond89 Radmond89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HELLO!!
I've studied your code.

  1. TABs and spaces )
  2. here's the corrected moment for win11 (py 3.14) in 165 line :
def activated_args(_, event):
    global result
    e = ToastActivatedEventArgs._from(event)
    user_input = {}
    if e.user_input:
        for name in e.user_input:
            if name in e.user_input:
                value = IPropertyValue._from(e.user_input[name])
                user_input[name] = value.get_string()
    result = {
        'arguments': e.arguments,
        'user_input': user_input
    }
    return result
  1. I noticed a strange behavior when working with icons and image.
    This solution helped me. But https doesn't work =(. It might be due to the blocking of win itself. I don't know.
    (in 46 line)
def add_icon(icon, document):
    if isinstance(icon, str):
        from pathlib import Path
        path = Path(icon)
        if path.is_file():
            icon = f"file:///{path.absolute().as_posix()}"

        icon = {
            'placement': 'appLogoOverride',
            'hint-crop': 'circle',
            'src': icon
        }

    binding = document.select_single_node('//binding')
    image = document.create_element('image')
    for name, value in icon.items():
        image.set_attribute(name, value)
    binding.append_child(image)


def add_image(img, document):
    if isinstance(img, str):
        from pathlib import Path
        path = Path(img)
        if path.is_file():
            img = f"file:///{path.absolute().as_posix()}"
        img = {
            'src': img
        }
    binding = document.select_single_node('//binding')
    image = document.create_element('image')
    for name, value in img.items():
        image.set_attribute(name, value)
    binding.append_child(image)```

@GitHub30
Copy link
Copy Markdown
Owner

#58 merged ok?
thank you

@better-er
Copy link
Copy Markdown
Author

ok

@better-er better-er closed this Jan 19, 2026
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.

3 participants