projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
goodfet.cc radioinfo
[goodfet]
/
client
/
GoodFETConsole.py
diff --git
a/client/GoodFETConsole.py
b/client/GoodFETConsole.py
index
72077e7
..
cf74cf9
100644
(file)
--- a/
client/GoodFETConsole.py
+++ b/
client/GoodFETConsole.py
@@
-19,6
+19,18
@@
class GoodFETConsole():
client.serInit();
client.setup();
client.start();
client.serInit();
client.setup();
client.start();
+ def prompt(self):
+ sys.stdout.write("gf% ");
+ sys.stdout.flush();
+ def run(self):
+ self.prompt();
+ #for cmd in sys.stdin:
+ while 1:
+ cmd=sys.stdin.readline();
+ if not cmd: break;
+ if(cmd.strip()!=""):
+ self.handle(cmd);
+ self.prompt();
def handle(self, str):
"""Handle a command string. First word is command."""
#Lines beginning with # are comments.
def handle(self, str):
"""Handle a command string. First word is command."""
#Lines beginning with # are comments.
@@
-66,6
+78,14
@@
class GoodFETConsole():
def CMDflash(self,args):
file=args[1];
self.client.flash(self.expandfilename(file));
def CMDflash(self,args):
file=args[1];
self.client.flash(self.expandfilename(file));
+ def CMDchip(self,args):
+ cmd="self.client.CMD%s()" % args[1];
+ print cmd;
+ try:
+ eval(cmd);
+ except:
+ print sys.exc_info()[0];
+ print "Chip-specific command failed.";
def expandfilename(self,filename):
if(filename[0]=='~'):
return "%s%s" % (os.environ.get("HOME"),filename.lstrip('~'));
def expandfilename(self,filename):
if(filename[0]=='~'):
return "%s%s" % (os.environ.get("HOME"),filename.lstrip('~'));