i2cgui now accepts a port on the command-line

[#9]
This commit is contained in:
James Bowman 2019-03-17 18:49:00 -07:00
parent dc075ca988
commit c2c258acac
1 changed files with 6 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class HexTextCtrl(wx.TextCtrl):
self.SetSelection(*selection)
class Frame(wx.Frame):
def __init__(self):
def __init__(self, preferred = None):
self.sd = None
@ -209,6 +209,9 @@ class Frame(wx.Frame):
self.SetAutoLayout(True)
if len(self.devs) > 0:
if preferred in self.devs:
d1 = preferred
else:
d1 = min(self.devs)
self.connect(self.devs[d1])
cb.SetValue(d1)
@ -335,6 +338,6 @@ class Frame(wx.Frame):
if __name__ == '__main__':
app = wx.App(0)
f = Frame()
f = Frame(*sys.argv[1:])
f.Show(True)
app.MainLoop()