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

Refactored Python code base. #128

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

exislow
Copy link

@exislow exislow commented Nov 1, 2022

Added if statement to avoid execution of this file as module by accident. See https://stackoverflow.com/questions/419163/what-does-if-name-main-do-in-python

This file has a lot of code repetition. I just getting use to it and will push more refactoring PRs to remove all the code duplication etc.

Copy link
Collaborator

@dspverden dspverden left a comment

Choose a reason for hiding this comment

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

Did you test it? Does it produce the same output like the previous version?

import shutil
import gzip

try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This was needed, I think on a windows system or *nix system. Don't remember it anymore.

Copy link
Author

Choose a reason for hiding this comment

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

imports have just been re-ordered. gzip will be still imported. Output seems the same. I would appreciate it, if you could double check it. Thanks.

Copy link
Collaborator

@dspverden dspverden Nov 1, 2022

Choose a reason for hiding this comment

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

No it looks like that the try-block is gone, at least in the pull request review

Copy link
Author

Choose a reason for hiding this comment

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

Yes it is gone. It still works. I was asking myself, why would you like to use unicode?

You can also alter the docs here: https://github.com/freeDSP/freeDSP-aurora/wiki/Create-a-Custom-Plugin

This script runs also with python3.10. Maybe you could state this in the docs as well. Since Python 2.7 is also deprecated.

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