if options.full:
notShownCommands = []
+ # If the last option is invoked, just, show the last log file
+ if options.last:
+ lastLogFilePath = get_last_log_file(logDir, notShownCommands)
+ if options.terminal:
+ # Show the log corresponding to the selected command call
+ print_log_command_in_terminal(lastLogFilePath, logger)
+ else:
+ # open the log xml file in the user editor
+ src.system.show_in_editor(runner.cfg.USER.browser,
+ lastLogFilePath, logger)
+ return 0
+
# If the user asks for a terminal display
if options.terminal:
# Parse the log directory in order to find
shutil.copy2(xslHat, logDir)
shutil.copy2(imgLogo, logDir)
- # If the last option is invoked, just, show the last log file
- if options.last:
- lastLogFilePath = get_last_log_file(logDir, notShownCommands)
- # open the log xml file in the user editor
- src.system.show_in_editor(runner.cfg.USER.browser,
- lastLogFilePath, logger)
- return 0
-
# Create or update the hat xml that gives access to all the commands log files
xmlHatFilePath = os.path.join(logDir, 'hat.xml')
src.logger.update_hat_xml(runner.cfg.SITE.log.logDir,
return
# The hooks must be defined in the application pyconf in the
- # APPLICATION section, hooks : { command : 'script_path.py'}
+ # APPLICATION section, hook : { command : 'script_path.py'}
if "hook" not in self.cfg.APPLICATION \
or cmd_name not in self.cfg.APPLICATION.hook:
return
# pyunit method to compare 2 str
self.assertEqual(OK, "OK")
+ def test_option_terminal7(self):
+ '''Test the terminal option and option last
+ '''
+
+ OK = "KO"
+
+ # launch the command that will write a log
+ sat = Sat()
+
+ try:
+ sat.log('--terminal --last')
+ OK = "OK"
+ finally:
+ sys.stdin = sys.__stdin__
+
+ # pyunit method to compare 2 str
+ self.assertEqual(OK, "OK")
+
def test_option_last(self):
'''Test the option --last
'''