Support to mill all holes from the command line. Fixes #218.

This commit is contained in:
Juan Pablo Caram
2017-05-05 16:20:14 -04:00
parent 626176a9a4
commit 62f0662083
4 changed files with 42 additions and 21 deletions

View File

@@ -824,7 +824,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
"""
Note: This method is a good template for generic operations as
it takes it's options from parameters or otherwise from the
object's options and returns a success, msg tuple as feedback
object's options and returns a (success, msg) tuple as feedback
for shell operations.
:return: Success/failure condition tuple (bool, str).
@@ -842,6 +842,13 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
if tooldia is None:
tooldia = self.options["tooldia"]
# Sort tools by diameter. items() -> [('name', diameter), ...]
sorted_tools = sorted(self.tools.items(), key=lambda tl: tl[1])
if tools == "all":
tools = [i[0] for i in sorted_tools] # List if ordered tool names.
log.debug("Tools 'all' and sorted are: %s" % str(tools))
if len(tools) == 0:
self.app.inform.emit("Please select one or more tools from the list and try again.")
return False, "Error: No tools."