diff options
author | Martin Peres <martin.peres@linux.intel.com> | 2017-06-13 10:54:44 +0300 |
---|---|---|
committer | Martin Peres <martin.peres@linux.intel.com> | 2017-10-04 17:48:28 +0300 |
commit | 49ad4179e48d3f5acf83198f66bb462e08b86a22 (patch) | |
tree | 9f08f75df9bee6172f0fe808db14c5c97880d972 | |
parent | aa1f1e063a79a04ad77dafe0228f826d2eda78a5 (diff) |
smartezbench: allow seeing if a report got created or not
-rw-r--r-- | python-modules/ezbench/smartezbench.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python-modules/ezbench/smartezbench.py b/python-modules/ezbench/smartezbench.py index 3a9a115..86bf64c 100644 --- a/python-modules/ezbench/smartezbench.py +++ b/python-modules/ezbench/smartezbench.py @@ -225,6 +225,7 @@ class SmartEzbench: self.smart_ezbench_lock = self.log_folder + "/smartezbench.lock" self.smart_ezbench_log = self.log_folder + "/smartezbench.log" self._report_cached = None + self._first_run = False self._deleted = False self.state = dict() @@ -239,16 +240,15 @@ class SmartEzbench: self.min_criticality = Criticality.II # Create the log directory - first_run = False if not readonly and not os.path.exists(self.log_folder): os.makedirs(self.log_folder) - first_run = True + self._first_run = True # Open the log file as append self.log_file = open(self.smart_ezbench_log, "a") # Add the welcome message - if first_run or not self.__reload_state(): + if self._first_run or not self.__reload_state(): if readonly: raise RuntimeError("The report {} does not exist".format(report_name)) self.__save_state() @@ -489,6 +489,10 @@ class SmartEzbench: return True + # Return True if the reported got created by this instance of SmartEzbench + def first_run(self): + return self._first_run + def profile(self): return self.__read_attribute__('profile') |