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

Change 'ini_file_name' and 'log_file_name' to accept str, bytes, or None #292

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

KinoxKlark
Copy link
Member

This has been issued in #290

For python users, it feels more natural to use strings to manage config and log filenames instead of bytes. I thus changed the interface of ini_file_name and log_file_name to accept str and None. It is now possible to write:

io = imgui.get_io()
io.ini_file_name = "other_name.ini"
io.ini_file_name = None
io.ini_file_name = ""

I kept the option of passing a bytes for backward compatibilities; this still works:

io = imgui.get_io()
io.ini_file_name = b'other_name.ini'

I also changed the return type of the getter to be an str instead of a bytes. This is unfortunately not backward compatible but feels more python friendly, and I don't think this is a feature that was intensively used.

…one + change return value to str instead of bytes
@learn-more
Copy link
Collaborator

Makes sense 👍

@KinoxKlark KinoxKlark merged commit 932ac3d into dev/version-2.0 Aug 8, 2022
@KinoxKlark KinoxKlark added the release pending Merged but still needs official release label Aug 8, 2022
@KinoxKlark KinoxKlark deleted the fix/ini-file-management branch August 8, 2022 12:19
@KinoxKlark KinoxKlark removed the release pending Merged but still needs official release label Apr 19, 2023
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.

2 participants