Permalink
Browse files

updated j00dans UI

  • Loading branch information...
sweemeng committed Apr 13, 2011
1 parent 45d991e commit 9ccdee4ec9c4088e4274ca4b4212d30c541f57fd
Showing with 17 additions and 8 deletions.
  1. +17 −8 uploader/storyboard.py
View
@@ -1,6 +1,7 @@
import pygtk
pygtk.require('2.0')
import gtk
+#import serial
class StoryBoard:
def file_dialog(self, widget, file_name_entry):
@@ -38,13 +39,21 @@ def entry_toggle_add(self, checkbutton, entry):
def entry_toggle_visibility(self, checkbutton, entry):
entry.set_visibility(checkbutton.get_active())
+ #def file_processing
# add in one parameter for function
- def ok_button_callback(self, widget, file_name_entry):
+ def ok_button_callback(self, widget, file_name_entry, port_name_entry):
file_name = file_name_entry.get_text()
+ port_name = port_name_entry.get_text()
file = open(file_name, 'r')
+ packet = ""
for line in file:
print line.rstrip()
+ packet += line.rstrip() + ':'
file.closed
+ print "packet: %s" % packet
+ #comm = serial.Serial(port_name, 9600)
+ #comm.write(packet)
+
# serial connection at here
@@ -87,12 +96,12 @@ def __init__(self):
hbox.pack_start(port_label, False, False, 5)
port_label.show()
- entry = gtk.Entry()
- entry.set_max_length(50)
- entry.connect("activate", self.enter_callback, entry)
- port_name = entry.get_text()
- hbox.pack_start(entry, False, False, 0)
- entry.show()
+ port_name_entry = gtk.Entry()
+ port_name_entry.set_max_length(50)
+ port_name_entry.connect("activate", self.enter_callback, port_name_entry)
+ #port_name = port_name_entry.get_text()
+ hbox.pack_start(port_name_entry, False, False, 0)
+ port_name_entry.show()
hbox_filename = gtk.HBox(False, 0)
vbox.pack_start(hbox_filename)
@@ -127,7 +136,7 @@ def __init__(self):
# Buttons
ok_button = gtk.Button(stock=gtk.STOCK_OK)
- ok_button.connect("clicked", self.ok_button_callback, file_name_entry)
+ ok_button.connect("clicked", self.ok_button_callback, file_name_entry, port_name_entry)
hbox3.pack_start(ok_button, False, False, 0)
ok_button.show()

0 comments on commit 9ccdee4

Please sign in to comment.