CVS: python msp430-downloader.py,1.9,1.10

Chris Liechti <[email protected]> Thu, 18 May 2006 15:54:15 -0700
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/python
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20382/python

Modified Files:
	msp430-downloader.py 
Log Message:
- improve file filter list
- ask for parallel or USB JTAG
thanks to David Brown

Index: msp430-downloader.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-downloader.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -d -r1.9 -r1.10
--- msp430-downloader.py	24 Apr 2006 19:49:08 -0000	1.9
+++ msp430-downloader.py	18 May 2006 22:54:13 -0000	1.10
@@ -23,7 +23,13 @@
     #~ sys.exit(1)
     filename = EasyDialogs.AskFileForOpen(
         windowTitle = "Select MSP430 binary for download",
-        typeList=['*', 'elf', 'a43']
+        typeList=[
+            ('Binraries (*.hex, *.elf, *.a43)', '*.hex;*.elf;*.a43'),
+            ('ELF executable (*.elf)', '*.elf'),
+            ('Intel-hex (*.a43, *.hex)', '*.a43;*.hex'),
+            ('TI-Text (*.txt)', '*.txt'),
+            ('All files (*.*)', '*.*'),
+        ]
     )
     if filename is None:
         sys.exit(0)
@@ -35,12 +41,18 @@
 #redirect console output
 sys.stdout = sys.stderr = StringIO()
 
-if EasyDialogs.AskYesNoCancel(
-    "MSP430 downloader\n\nDownload '%s' using the JTAG interface?" % (filename,),
-    cancel=""
-) != 1:
+#swap the buttons, so that cancel is the sparate button at left
+answer = EasyDialogs.AskYesNoCancel(
+    "MSP430 downloader\n\nDownload '%s'?\n\n" % (filename,),
+    default=0, cancel="USB", yes="Parallel port", no="Cancel"
+)
+if answer == 0: #NO -> abort
     print "User aborted"
     sys.exit(2)
+elif answer == 1: #YES -> parallel
+    lpt = "1"
+else:   #CANCEL -> USB
+    lpt = "TIUSB"
 
 #~ answer = EasyDialogs.AskYesNoCancel("Use JTAG or BSL?", 
     #~ default=1,yes="BSL", no="JTAG")



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642