CVS: python msp430-downloader.py,1.11,1.12

Chris Liechti <[email protected]> Tue, 13 Mar 2007 04:34:02 -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-serv17483/python

Modified Files:
	msp430-downloader.py 
Log Message:
- fix progress bar for numbers > 32767
- fix load binary from .z43
- mspgcc.Memory's loadFile can handle file objects too

Index: msp430-downloader.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-downloader.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -d -r1.11 -r1.12
--- msp430-downloader.py	25 May 2006 22:14:47 -0000	1.11
+++ msp430-downloader.py	13 Mar 2007 11:34:00 -0000	1.12
@@ -10,7 +10,7 @@
 Now also with the ability to load the configuration from an ini file (.m43)
 which itself can be bundled with a binary in a zip file (.z43).
 
-(C) 2004-2006 [email protected]
+(C) 2004-2007 Chris Liechti <[email protected]>
               with inputs from David Brown
 """
 
@@ -144,7 +144,8 @@
             interpret_config(config, abspath=False)
     #get binary from zip file
     if options.filename:
-        binary = StringIO(archive.read(options.filename))
+        binary = mspgcc.memory.Memory()   #prepare downloaded data
+        binary.loadFile(options.filename, fileobj = StringIO(archive.read(options.filename)))
     #get readme from zip file and display it
     if options.readme:
         readme_text = archive.read(options.readme)
@@ -251,10 +252,8 @@
             pass
     
     try:
-        if options.fake_progress:
-            jtagobj = mspgcc.jtag.JTAG()
-        else:
             jtagobj = ProgressJTAG()
+        if not options.fake_progress:
         jtagobj.showprogess = True
         jtagobj.bar = EasyDialogs.ProgressBar('Programming %r' % options.filename[-50:], 100)
         showError = False


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV