datalad.plugin.wtf

provide information about this DataLad installation

class datalad.plugin.wtf.WTF[source]

Bases: datalad.interface.base.Interface

Generate a report about the DataLad installation and configuration

IMPORTANT: Sharing this report with untrusted parties (e.g. on the web) should be done with care, as it may include identifying information, and/or credentials or access tokens.

class EnsureChoice(*values)

Bases: datalad.support.constraints.Constraint

Ensure an input is element of a set of possible values

long_description()
short_description()
class EnsureDataset

Bases: datalad.support.constraints.Constraint

long_description()
short_description()
class EnsureNone

Bases: datalad.support.constraints.Constraint

Ensure an input is of value None

long_description()
short_description()
class Parameter(constraints=None, doc=None, args=None, **kwargs)

Bases: object

This class shall serve as a representation of a parameter.

get_autodoc(name, indent=' ', width=70, default=None, has_default=False)

Docstring for the parameter to be used in lists of parameters

Returns:
Return type:string or list of strings (if indent is None)
static custom_result_renderer(res, **kwargs)[source]
datasetmethod(name=None, dataset_argname='dataset')
eval_results()

Decorator for return value evaluation of datalad commands.

Note, this decorator is only compatible with commands that return status dict sequences!

Two basic modes of operation are supported: 1) “generator mode” that yields individual results, and 2) “list mode” that returns a sequence of results. The behavior can be selected via the kwarg return_type. Default is “list mode”.

This decorator implements common functionality for result rendering/output, error detection/handling, and logging.

Result rendering/output can be triggered via the datalad.api.result-renderer configuration variable, or the result_renderer keyword argument of each decorated command. Supported modes are: ‘default’ (one line per result with action, status, path, and an optional message); ‘json’ (one object per result, like git-annex), ‘json_pp’ (like ‘json’, but pretty-printed spanning multiple lines), ‘tailored’ custom output formatting provided by each command class (if any).

Error detection works by inspecting the status item of all result dictionaries. Any occurrence of a status other than ‘ok’ or ‘notneeded’ will cause an IncompleteResultsError exception to be raised that carries the failed actions’ status dictionaries in its failed attribute.

Status messages will be logged automatically, by default the following association of result status and log channel will be used: ‘ok’ (debug), ‘notneeded’ (debug), ‘impossible’ (warning), ‘error’ (error). Logger instances included in the results are used to capture the origin of a status report.

Parameters:func (function) – __call__ method of a subclass of Interface, i.e. a datalad command definition
result_renderer = 'tailored'
datalad.plugin.wtf.get_max_path_length(top_path=None, maxl=1000)[source]

Deduce the maximal length of the filename in a given path