diff options
author | Martin Peres <martin.peres@linux.intel.com> | 2017-05-24 17:15:31 +0300 |
---|---|---|
committer | Martin Peres <martin.peres@linux.intel.com> | 2017-10-04 17:48:28 +0300 |
commit | 285d44c71a4ef38f722281326ca60c44b8703cfd (patch) | |
tree | d64704bce4502a32cef212839ee5f2325a15508e | |
parent | aaba1e584241eb081de77ef39055cecab7309d27 (diff) |
smartezbench: move list_smart_ezbench_report_names to SmartEzbench.list_reports
-rwxr-xr-x | ezbenchd.py | 2 | ||||
-rw-r--r-- | python-modules/ezbench/smartezbench.py | 32 |
2 files changed, 17 insertions, 17 deletions
diff --git a/ezbenchd.py b/ezbenchd.py index 0abf769..928cd73 100755 --- a/ezbenchd.py +++ b/ezbenchd.py @@ -344,7 +344,7 @@ def sbench_run(report_name): lastPoll = 0 while not stop_requested: futureLastPoll = time.time() - reports = list_smart_ezbench_report_names(ezbench_dir, lastPoll) + reports = SmartEzbench.list_reports(ezbench_dir, lastPoll) lastPoll = futureLastPoll for report_name in reports: try: diff --git a/python-modules/ezbench/smartezbench.py b/python-modules/ezbench/smartezbench.py index 76409da..198880f 100644 --- a/python-modules/ezbench/smartezbench.py +++ b/python-modules/ezbench/smartezbench.py @@ -76,22 +76,6 @@ class RunningMode(Enum): PAUSING = 102 ABORTING = 103 - -def list_smart_ezbench_report_names(ezbench_dir, updatedSince = 0): - log_dir = ezbench_dir + '/logs' - state_files = glob.glob("{}/**/smartezbench.state".format(log_dir), recursive=True) - - reports = [] - for state_file in state_files: - if updatedSince > 0 and os.path.getmtime(state_file) < updatedSince: - continue - - start = len(log_dir) + 1 - stop = len(state_file) - 19 - reports.append(state_file[start:stop]) - - return reports - class TaskEntry: def __init__(self, commit, test, rounds, resumeResultFile = None, user_requested = True): @@ -210,6 +194,22 @@ class SmartEzbenchAttributes(Enum): report_deadline_hard = 402 class SmartEzbench: + @classmethod + def list_reports(cls, ezbench_dir, updatedSince = 0): + log_dir = ezbench_dir + '/logs' + state_files = glob.glob("{}/**/smartezbench.state".format(log_dir), recursive=True) + + reports = [] + for state_file in state_files: + if updatedSince > 0 and os.path.getmtime(state_file) < updatedSince: + continue + + start = len(log_dir) + 1 + stop = len(state_file) - 19 + reports.append(state_file[start:stop]) + + return reports + def __init__(self, ezbench_dir, report_name, readonly = False, hook_binary_path = None, logs_callback = None, hooks_callback = None): |