chore: rewording

This commit is contained in:
Benny Megidish
2025-10-13 10:22:18 +03:00
parent a20484abc5
commit 87fe0fc675
4 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -11,15 +11,15 @@ if __name__ == '__main__':
parser.add_argument("--path", "-p", type=str, help="Path to KiCAD board file", required=True)
parser.add_argument("--additionalLayers", "-aL", type=str, help="Additional layers(comma-separated)", metavar="LAYERS")
parser.add_argument("--user1VCut", "-u1", action="store_true", help="Set User.1 as V-Cut layer")
parser.add_argument("--user2AltVCut", "-u2", action="store_true", help="Use User.2 for alternative Edge-Cut layer")
parser.add_argument("--user2AltVCut", "-u2", action="store_true", help="Set User.2 as alternative Edge-Cut layer")
parser.add_argument("--autoTranslate", "-t", action="store_true", help="Apply automatic position/rotation translations")
parser.add_argument("--autoFill", "-f", action="store_true", help="Apply automatic fill for all zones")
parser.add_argument("--excludeDNP", "-e", action="store_true", help="Exclude DNP components from BOM")
parser.add_argument("--allActiveLayers", "-aaL",action="store_true", help="Export all active layers instead of only commonly used ones")
parser.add_argument("--archiveName", "-aN", type=str, help="Name of the generated archives", metavar="NAME")
parser.add_argument("--openBrowser", "-b", action="store_true", help="Open webbrowser with directory file overview after generation")
parser.add_argument("--nonInteractive", "-nI" ,action="store_true", help="Run in non-Interactive mode. Usefull in CI/CD enviroment.")
parser.add_argument("--noBackup", "-nB", action="store_true", help="Do not create backup files")
parser.add_argument("--nonInteractive", "-nI" ,action="store_true", help="Run in non-Interactive mode. Useful in CI/CD environment.")
parser.add_argument("--noBackup", "-nB", action="store_true", help="Do not create backup files")
args = parser.parse_args()
options = dict()
@@ -31,7 +31,7 @@ if __name__ == '__main__':
options[ALL_ACTIVE_LAYERS_OPT] = args.allActiveLayers
options[ARCHIVE_NAME] = args.archiveName
options[EXTRA_LAYERS] = args.additionalLayers
options[NO_BACKUP] = args.no_backup
options[NO_BACKUP_OPT] = args.no_backup
openBrowser = args.openBrowser
nonInteractive = args.nonInteractive
+1 -1
View File
@@ -8,4 +8,4 @@ ALL_ACTIVE_LAYERS_OPT = "ALL_ACTIVE_LAYERS"
OPEN_BROWSER_OPT = "OPEN BROWSER"
ARCHIVE_NAME = "ARCHIVE_NAME"
EXTRA_LAYERS = "EXTRA_LAYERS"
NO_BACKUP = "NO_BACKUP"
NO_BACKUP_OPT = "NO_BACKUP_OPT"
+6 -6
View File
@@ -4,7 +4,7 @@ import pcbnew # type: ignore
from .thread import ProcessThread
from .events import StatusEvent
from .options import AUTO_FILL_OPT, AUTO_TRANSLATE_OPT, EXCLUDE_DNP_OPT, EXTEND_EDGE_CUT_OPT, ALTERNATIVE_EDGE_CUT_OPT, EXTRA_LAYERS, ALL_ACTIVE_LAYERS_OPT, ARCHIVE_NAME, OPEN_BROWSER_OPT, NO_BACKUP
from .options import AUTO_FILL_OPT, AUTO_TRANSLATE_OPT, EXCLUDE_DNP_OPT, EXTEND_EDGE_CUT_OPT, ALTERNATIVE_EDGE_CUT_OPT, EXTRA_LAYERS, ALL_ACTIVE_LAYERS_OPT, ARCHIVE_NAME, OPEN_BROWSER_OPT, NO_BACKUP_OPT
from .utils import load_user_options, save_user_options, get_layer_names
@@ -37,7 +37,7 @@ class KiCadToJLCForm(wx.Frame):
AUTO_FILL_OPT: True,
EXCLUDE_DNP_OPT: False,
OPEN_BROWSER_OPT: True,
NO_BACKUP: False,
NO_BACKUP_OPT: False,
})
self.mOptionsLabel = wx.StaticText(self, label='Options:')
@@ -57,9 +57,9 @@ class KiCadToJLCForm(wx.Frame):
self.mAllActiveLayersCheckbox.SetValue(userOptions[ALL_ACTIVE_LAYERS_OPT])
self.mExtendEdgeCutsCheckbox = wx.CheckBox(self, label='Set User.1 as V-Cut layer')
self.mExtendEdgeCutsCheckbox.SetValue(userOptions[EXTEND_EDGE_CUT_OPT])
self.mAlternativeEdgeCutsCheckbox = wx.CheckBox(self, label='Use User.2 for alternative Edge-Cut layer')
self.mAlternativeEdgeCutsCheckbox = wx.CheckBox(self, label='Set User.2 as alternative Edge-Cut layer')
self.mAlternativeEdgeCutsCheckbox.SetValue(userOptions[ALTERNATIVE_EDGE_CUT_OPT])
self.mAutomaticTranslationCheckbox = wx.CheckBox(self, label='Apply automatic translations')
self.mAutomaticTranslationCheckbox = wx.CheckBox(self, label='Apply automatic component translations')
self.mAutomaticTranslationCheckbox.SetValue(userOptions[AUTO_TRANSLATE_OPT])
self.mAutomaticFillCheckbox = wx.CheckBox(self, label='Apply automatic fill for all zones')
self.mAutomaticFillCheckbox.SetValue(userOptions[AUTO_FILL_OPT])
@@ -68,7 +68,7 @@ class KiCadToJLCForm(wx.Frame):
self.mOpenBrowserCheckbox = wx.CheckBox(self, label='Open browser after generation')
self.mOpenBrowserCheckbox.SetValue(userOptions[OPEN_BROWSER_OPT])
self.mNoBackupCheckbox = wx.CheckBox(self, label='Do not create backup files')
self.mNoBackupCheckbox.SetValue(userOptions[NO_BACKUP])
self.mNoBackupCheckbox.SetValue(userOptions[NO_BACKUP_OPT])
self.mGaugeStatus = wx.Gauge(
self, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size(600, 20), wx.GA_HORIZONTAL)
@@ -122,7 +122,7 @@ class KiCadToJLCForm(wx.Frame):
options[AUTO_FILL_OPT] = self.mAutomaticFillCheckbox.GetValue()
options[EXCLUDE_DNP_OPT] = self.mExcludeDnpCheckbox.GetValue()
options[OPEN_BROWSER_OPT] = self.mOpenBrowserCheckbox.GetValue()
options[NO_BACKUP] = self.mNoBackupCheckbox.GetValue()
options[NO_BACKUP_OPT] = self.mNoBackupCheckbox.GetValue()
save_user_options(options)
+3 -3
View File
@@ -18,7 +18,7 @@ class ProcessThread(Thread):
def __init__(self, wx, options, cli = None, openBrowser = True, nonInteractive = False):
Thread.__init__(self)
# prevent use of cli and grapgical mode at the same time
# prevent use of cli and graphical mode at the same time
if (wx is None and cli is None) or (wx is not None and cli is not None):
logging.error("Specify either graphical or cli use!")
return
@@ -166,8 +166,8 @@ class ProcessThread(Thread):
os.rename(os.path.join(temp_dir, placementFileName), os.path.join(temp_dir, ProcessManager.normalize_filename("_".join((baseName.strip() + '_positions.csv').split()))))
os.rename(os.path.join(temp_dir, bomFileName), os.path.join(temp_dir, ProcessManager.normalize_filename("_".join((baseName.strip() + '_bom.csv').split()))))
# Make a backup as long as the NO_BACKUP flag isn't set.
if not self.options[NO_BACKUP]:
# Make a backup as long as the NO_BACKUP_OPT flag isn't set.
if not self.options[NO_BACKUP_OPT]:
timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
backup_name = ProcessManager.normalize_filename("_".join(("{} {}".format(baseName, timestamp).strip()).split()))
shutil.make_archive(os.path.join(output_path, 'backups', backup_name), 'zip', temp_dir)