mirror of
https://github.com/nasa/trick.git
synced 2025-06-22 08:50:06 +00:00
checksum enhancement for -d option (#1579)
* Added input file SHA1 info being printed on screen when running a trick sim with -d option (basically verifying the input) * Added additional checks to exclude trace info printout for file in /opt or .trick/ or not a real file such as <xxx> as the filename.
This commit is contained in:
@ -140,6 +140,11 @@ int Trick::IPPython::init() {
|
||||
}
|
||||
|
||||
if ( verify_input ) {
|
||||
std::stringstream ss ;
|
||||
ss << "import hashlib" << std::endl ;
|
||||
ss << "input_file = " << "'" << input_file.c_str() << "'" << std::endl;
|
||||
ss << "print('{0} SHA1: {1}'.format(input_file,hashlib.sha1(open(input_file, 'rb').read()).hexdigest()))" << std::endl ;
|
||||
PyRun_SimpleString(ss.str().c_str()) ;
|
||||
exec_terminate_with_return(ret , __FILE__ , __LINE__ , "Input file verification complete\n" ) ;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user