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

refactor: Remove legacy custombtn and configfile #1483

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

rockstorm101
Copy link
Collaborator

This PR removes code, which is not standard practice and constitutes a breaking change. Such changes should only be introduced on major version upgrades. However I believe it could be justified in this case and only a minor version upgrade would be needed in the future.

custombtn.txt was deprecated before Printrun 2.x but the code was left. The code didn't even work as expected so this potentially breaking change has a very low chance of affecting any users.
Closes #1236

The configfile function was outdated and only used for handling custombtn.txt so it is safe to remove as well.
Closes #1286

@DivingDuck
Copy link
Collaborator

DivingDuck commented Feb 16, 2025

Just check the Windows binary. Is it possible that you delete the function configfile in utils.py by accidentally? I got this error when I try to run Pronterface:

Traceback (most recent call last):
  File "pronterface.py", line 30, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 450, in exec_module
  File "printrun\pronterface.py", line 36, in <module>
ImportError: cannot import name 'configfile' from 'printrun.utils' (C:Users\Armin\AppData\Local\Temp\_MEI71082\printrun\utils.pyc)

Edit:
I correct myself. In utils.py line 37 we need to delete in addition configfile from the import list

from .utils import install_locale, setup_logging, dosify, \
    iconfile, configfile, format_time, format_duration, \
    hexcolor_to_float, parse_temperature_report, \
    prepare_command, check_rgb_color, check_rgba_color, compile_file, \
    write_history_to, read_history_from

@rockstorm101
Copy link
Collaborator Author

I correct myself. In utils.py line 37 we need to delete in addition configfile from the import list

Ooops, of course. Thanks for testing. What a silly mistake lol. I'll push a fixed commit now.

custombtn.txt was deprecated before Printrun 2.x but the code was left. The
code didn't even work as expected so this potentially breaking change has a
very low chance of affecting any users.
Closes kliment#1236

The `configfile` function was outdated and only used for handling
custombtn.txt so it is safe to remove as well.
Closes kliment#1286
@DivingDuck
Copy link
Collaborator

Guess, you can merge it. I'll wait for updating the translation in #1464.

@rockstorm101 rockstorm101 merged commit 1af6ad9 into kliment:master Feb 17, 2025
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants