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

Supply schematic file on command line #27

Open
ghost opened this issue Feb 23, 2018 · 1 comment
Open

Supply schematic file on command line #27

ghost opened this issue Feb 23, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 23, 2018

I've hacked bomsaway to take a filename on the command line so I can run it direct from KiCAD with the command:

python "/full/path/to/Boms-Away/bomsaway.py" "%P/%B.sch" &

Or just supply the filename on the command line in the normal way, or not.

Hoping this is useful.

Here's the diff:

diff --git bomsaway.py bomsaway.py
index ec09d86..2966997 100755
--- bomsaway.py
+++ bomsaway.py
@@ -2,6 +2,7 @@
 import os
 import csv
 import shutil
+import sys

 import wx
 from boms_away import sch, datastore
@@ -581,9 +582,15 @@ class MainFrame(wx.Frame):

 class BomsAwayApp(wx.App):
     def OnInit(self):
+        ifile = None
+        try:
+            ifile = sys.argv[1]
+        except:
+            pass
         frame = MainFrame(None, -1, 'Boms-Away!')
         frame.Show(True)
         self.SetTopWindow(frame)
+        if ifile: frame.load(ifile)
         return True

 if __name__ == '__main__':
@Jeff-Ciesielski
Copy link
Owner

Good idea, I'll fold this in ASAP

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

No branches or pull requests

1 participant