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

Pkgdata rework #2552

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

yunline
Copy link
Contributor

@yunline yunline commented Nov 7, 2023

  • Deprecte getResource()
    Reasons:
    • pkg_resources lib is out dated.
    • Most of use cases in our c code only need the resource path. Why not return a path directly instead of a file object?
  • Add get_resource_path()
    Get the pygame resource path by its filename
    Example:
    >>> get_resource_path("pygame_icon.bmp") 
    'C:\\Users\\yunline\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\pygame_ce-2.4.0.dev3-py3.10-win-amd64.egg\\pygame\\pygame_icon.bmp'
  • Add load_pygame_icon()
    Load the default pygame icon
  • Update C code and Python code to use load_pygame_icon() and get_resource_path()
  • All these should work with pyinstaller

@yunline yunline requested a review from a team as a code owner November 7, 2023 02:55
Copy link
Member

@MyreMylar MyreMylar left a comment

Choose a reason for hiding this comment

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

Looks good overall. Just some small concerns about reference counting versus the code being replaced.

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

Hmmm... There is a common pattern of importing the module in C code and calling the function. Maybe it could be better abstracted away in a common function?

@ankith26 ankith26 marked this pull request as draft August 14, 2024 20:06
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