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

Skippable ipk & script generation #59

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Skippable ipk & script generation #59

wants to merge 3 commits into from

Conversation

timothyqiu
Copy link
Contributor

Added options --no-sh and --no-ipk to skip the generation of swjsq_wget.sh and swjsq_0.0.1_all.ipk. Without these options, the behavior is not changed.

This is a feature requested in #34 and my daily usage 😄

@fffonion
Copy link
Owner

fffonion commented Jun 3, 2016

In some embedded distributions (like openembedded) argparse is not shipped with python installation, it would be better to wrap import argparse with try...except and disable this feature for these users.

@timothyqiu
Copy link
Contributor Author

OK, I'll change it to use getopt instead.

@fffonion
Copy link
Owner

fffonion commented Jun 3, 2016

getopt is good alternative but the code can be annoying. My suggestion is to read environment variables if argparse is not available, if you insists enabling this feature for all distros.😀

@timothyqiu
Copy link
Contributor Author

Done. Got rid of argparse and always use getopt...

btw, since with open(...) as f pattern is used, the minimal python version support is 2.6, right?

@fffonion
Copy link
Owner

fffonion commented Jun 5, 2016

getopt introduces too much irrelevant code. As I suggested before, it would be better to keep using argparse but at the same time adding an alternative for users who don't have this module (eg. use environment variables). In the way codes can be clean🌚

@timothyqiu
Copy link
Contributor Author

IMHO, it is inappropriate to change the interface depending on the Python version used. (i.e. Use command line options if 2.7 or later, use environment variables if 2.6 or before) There're already weird things happening in Python 3 support which needs to be fixed. Doing so further breaks the interface consistency between 2.6.X and 2.7.X apart, also yielding not-so-clean code.

In the case of "introducing too much irrelevant code", the common solution is simple and pretty obvious: move those code into a separate module. But, if I understand correctly, this project is standalone (no 3rd part library) and single-filed on purpose, so newbies could easily use it. Therefore, it is destined to be including various irrelevant code as time goes on.

If you still think this pull request unacceptable, feel free to close it. I'll keep this in my own fork instead. 😞

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