Skip to content

Commit

Permalink
Code cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
drandreas committed Sep 9, 2015
1 parent 9699fba commit 021dc28
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tools/test-interface/TerminalApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ def execute_test(self, client, args):

def main(self):
try:
# Setup argument parser
#Setup argument parser
parser = ArgumentParser(formatter_class=RawDescriptionHelpFormatter);
parser.add_argument("-a", "--ip-address",dest="ip", metavar="a", help="TCP/IP Address to use instead of serial port");
parser.add_argument("-p", "--port", dest="port", metavar="p", help="TCP Port to use in conjunction with address");
parser.add_argument("-d", "--no-reset", dest="reset", action="store_false", help="don't reset target");
parser.add_argument("-r", "--relic", dest="engine", action="store_true", help="use relics implementation (default: hw)");
parser.add_argument("-e", "--export", dest="export", action="store_true", help="enable timer output on GPIOs");

# Call into subclass for additional arguments
#Call into subclass for additional arguments
self.define_arguments(parser);

#Process arguments
args = parser.parse_args();

# Call into subclass to obtain test interface
# TODO Rewrite test interface to make this hack obsolete
#Call into subclass to obtain test interface
#TODO Rewrite test interface to make this hack obsolete
client = self.instantiate_interface(args);

#Connect to Target
Expand All @@ -100,20 +100,20 @@ def main(self):
except AttributeError:
sys.stderr.write("Hardware crypto not available!\n");

#Enable Timer output on GPIOs
#Enable Timer output on GPIOs
if args.export:
client.enableTimerOutput();

# Call into subclass to execute test and return result ocde
#Call into subclass to execute test and return result ocde
return self.execute_test(client, args);

#Handle keyboard interrupt
except KeyboardInterrupt:
return 1;

#Handle keyboard exceptions
#except Exception, e:
# indent = len(self.program_name) * " ";
# sys.stderr.write(self.program_name + ": " + repr(e) + "\n");
# sys.stderr.write(indent + " for help use --help\n");
# return 2;
#Handle remaining exceptions
except Exception, e:
indent = len(self.program_name) * " ";
sys.stderr.write(self.program_name + ": " + repr(e) + "\n");
sys.stderr.write(indent + " for help use --help\n");
return 2;

0 comments on commit 021dc28

Please sign in to comment.