diff --git a/contest/remote/lib/fetcher.py b/contest/remote/lib/fetcher.py index ca1f126..403d0e4 100644 --- a/contest/remote/lib/fetcher.py +++ b/contest/remote/lib/fetcher.py @@ -154,3 +154,10 @@ def _run_once(self): def run(self): while self.life.next_poll(): self._run_once() + + +def namify(what): + name = re.sub(r'[^0-9a-zA-Z]+', '-', what) + if name[-1] == '-': + name = name[:-1] + return name diff --git a/contest/remote/vmksft-p.py b/contest/remote/vmksft-p.py index 48ecba0..1ed1dcb 100755 --- a/contest/remote/vmksft-p.py +++ b/contest/remote/vmksft-p.py @@ -15,7 +15,7 @@ from core import NipaLifetime from lib import wait_loadavg from lib import CbArg -from lib import Fetcher +from lib import Fetcher, namify from lib import VM, new_vm, guess_indicators @@ -58,13 +58,6 @@ """ -def namify(what): - name = re.sub(r'[^0-9a-zA-Z]+', '-', what) - if name[-1] == '-': - name = name[:-1] - return name - - def get_prog_list(vm, target): tmpdir = tempfile.mkdtemp() vm.tree_cmd(f"make -C tools/testing/selftests/ TARGETS={target} INSTALL_PATH={tmpdir} install")