-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Added CLI Interface #179
Added CLI Interface #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution. Added a couple of suggestions.
plugins/cli.py
Outdated
import argparse as ap | ||
|
||
from .thread import ProcessThread | ||
from .options import AUTO_FILL_OPT, AUTO_TRANSLATE_OPT, EXCLUDE_DNP_OPT, EXTEND_EDGE_CUT_OPT, ALTERNATIVE_EDGE_CUT_OPT, EXTRA_LAYERS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In sake of completeness, would you mind adding also 'ALL_ACTIVE_LAYERS_OPT' option? It was added in a recent PR.
plugins/thread.py
Outdated
|
||
def progress(self, percent): | ||
wx.PostEvent(self.wx, StatusEvent(percent)) | ||
def cliBar(percent, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', printEnd = "\r"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about moving this function to the utils module and make it generate the progress bar string instead of printing it. than it can be used in the progress function instead of nesting inside it.
I included your requested changes. |
Thank you |
I added a CLI interface which enables the plugin to be used standalone on an arbitrary board file.
Reason is that most other JLCPCB scripts available either require a schematic file (which in my case is not available).
No additional dependencies are added.
Changes to existing code have been kept to a bare minimum as the plugin functionality is the main feature.
CLI can simply be used by cloning the repository and running
python -m plugins.cli -p [pathToBoardFile]
.See
python -m plugins.cli --help
on how to set all options which are implemented in the GUI menu as command parameters.Feel free to make any suggestion on improvements.