disco.util – Helper functions¶
This module provides utility functions that are mostly used by Disco internally.
Extracts the job name from url.
This function is particularly useful for using the methods in
disco.core.Discogiven only the results of a job. A typical case is that you no longer need the results. You can tell Disco to delete the unneeded data as follows:
from disco.core import Disco from disco.util import jobname Disco().purge(jobname(results))
Group the values of consecutive keys which compare equal.
Takes an iterator over
k, vpairs, and returns an iterator over
k, vs. Does not sort the input first.
Translates a directory URL (
dir://...) to a list of normal URLs.
This function might be useful for other programs that need to parse results returned by
disco.core.Disco.wait(), for instance.
Parameters: dir – a directory url, such as